tcall TForm1 :: Variable_print_all (ParserVariable * variables [])
{(! variables) return; _t i; buffer [1024]; (i = 0; i
{(! variables [i]) continue; * var = variables [i]; (var-> val.type)
{TOK_NUMERIC: (buffer, "% s =% s n", var-> name, parser_value_show_as_string (& var-> val)); -> Lines-> Add (buffer);; TOK_STRING: (buffer, "% s =% s n", var-> name, var-> val.s); -> Lines-> Add (buffer);; : (buffer, "% s Має невідомий тип змінної% d. n", var-> name, var-> val.type); -> Lines-> Add (buffer);;
}
}
}
{();
}
Parser.cpp
# include "lexer.h"
# include "parser.h"
# include "Unit1.h"
# ifndef M_PI
# define M_PI 3.14159265358979323
# endifparser_statements (CodeBuffer * cb); parser_assign (CodeBuffer * cb); do_sqrt (ParserVal * a, int b); do_abs (ParserVal *, int); do_exp (ParserVal *, int); do_ln (ParserVal *, int); do_pow (ParserVal *, int); do_integer (ParserVal *, int); do_round (ParserVal *, int); do_fraction (ParserVal *, int); do_boolean_str (int oper, ParserVal * v1, ParserVal * v2); do_boolean (int oper, ParserVal * v1, ParserVal * v2); do_math (int oper, ParserVal * v1, ParserVal * v2); do_unary (int oper, ParserVal * v1); do_power (ParserVal * v1, ParserVal * v2 ); parser_do_print (ParserVal *, int); g_function_table [] = {
/* Масив внутрішніх функцій */
{"sqrt", 1, do_sqrt},
{"abs", 1, do_abs},
{"exp", 1, do_exp},
{"ln", 1, do_ln},
{"pow", 2, do_pow},
{"print", 1, parser_do_print},
{"int", 1, do_integer},
{"modf", 1, do_fraction}
}; * lookup_builtin_function (char * name); * builtin_function_arg_text (BuiltinFunction * func); _t parser_strlen (char * s); execute_builtin_function (CodeBuffer * cb, BuiltinFunction * func); parser_bool_or (CodeBuffer * cb ); parser_bool_and (CodeBuffer * cb); parser_bool1 (CodeBuffer * cb); parser_bool2 (CodeBuffer * cb); parser_bool3 (CodeBuffer * cb); parser_level1 (CodeBuffer * cb); parser_level2 (CodeBuffer * cb); parser_level3 (CodeBuffer * cb) ; parser_level4 (CodeBuffer * cb); parser_level5 (CodeBuffer * cb); parser_error (CodeBuffer * cb, char * msg, int opt); parser_convert_to_numeric (ParserVal * v); parser_convert_to_string (ParserVal * v); is_numeric (ParserVal * v); is_string (ParserVal * v); str_icmp (char * s1, char * s2); parser_add_strings (ParserVal * v1, ParserVal * v2); get_int_part ...