The interpreter pass 1 in a single flex file.
More...
#include <stdio.h>
#include <string.h>
#include <libgen.h>
#include <errno.h>
#include <quadmath.h>
#include "dry.h"
|
|
#define | MAXSTRINGLEN 100000 |
| | Maximum length of strings accepted and written to leon-format output.
|
| |
|
#define | MAXNAMELEN 1000 |
| | Maximum length of names accepted and written to leon-format output.
|
| |
|
#define | MAXVOCNESTING 16 |
| | Maximum nesting of vocabularies.
|
| |
|
| static void | unbackslash (char *p_str) |
| | String Cleaning.
|
| |
| static char * | norm_check_int (char *p_str) |
| | Normalization and range check for a string representation of an 128 bit integer.
|
| |
| static int | check_real (char *p_str) |
| | Range check for a string representation of an 128 bit float.
|
| |
|
int | yylex (void) |
| | The generated scanner.
|
| |
|
static enum ExitCode | commandline (int argc, char **argv) |
| | Command line parsing.
|
| |
|
int | main (int argc, char *argv[]) |
| | main().
|
| |
|
int | yywrap (void) |
| | yywrap().
|
| |
|
|
static int | g_verbose = 0 |
| | Global option "verbose".
|
| |
|
static int | g_linebuffer = 0 |
| | Global option "line buffering".
|
| |
|
static int | g_helpprinted = 0 |
| | Global status help printed
|
| |
|
static char | INT128_MAGNITUDE [] = "170141183460469231731687303715884105728" |
| | The absolute value of the smallest negative 128 bit integer.
|
| |
|
static char * | g_basename = NULL |
| | My program file name.
|
| |
|
static char * | g_dirname = NULL |
| | My program path name.
|
| |
| static char * | g_vocdir1 = NULL |
| | The path to the vocabularies.
|
| |
| static char * | g_vocdir2 = NULL |
| | The path to the vocabularies.
|
| |
|
static YY_BUFFER_STATE | g_buffer_stack [MAXVOCNESTING] |
| | A stack of buffers for the vocabulary nesting.
|
| |
|
static FILE * | g_file_stack [MAXVOCNESTING] |
| | A stack of FILE * for the vocabulary nesting.
|
| |
|
static int | g_buffer_stack_top = -1 |
| | Index into the stacks of buffers and FILE * for the vocabulary nesting.
|
| |
The interpreter pass 1 in a single flex file.
- Copyright
Leonardus, a minimalist stack-based programming system.
Copyright (C) 2025 Andreas Muckenschnabel
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program.
If not, see https://www.gnu.org/licenses/.
◆ check_real()
| static int check_real |
( |
char * |
p_str | ) |
|
|
static |
Range check for a string representation of an 128 bit float.
- Parameters
-
| [in] | p_str | ... String to check |
- Returns
- 0 for a valid string ERANGE for overflows, underflows and general errors.
◆ norm_check_int()
| static char * norm_check_int |
( |
char * |
p_str | ) |
|
|
static |
Normalization and range check for a string representation of an 128 bit integer.
Format of p_str is: [-]?[0-9]+
- Parameters
-
| [in] | p_str | ... String to check |
- Returns
- Points somewhere into the normalized p_str buffer.
Is NULL if the range check fails.
◆ unbackslash()
| static void unbackslash |
( |
char * |
p_str | ) |
|
|
static |
String Cleaning.
Removes all single backslashes from the string p_str, preserving double backslashes (\) and newline sequences (
). These are the only escape sequences recognized in the leon-format format.
◆ g_vocdir1
The path to the vocabularies.
Version 1.
◆ g_vocdir2
The path to the vocabularies.
Version 2.