This commit is contained in:
parent
f857751606
commit
aae2e8e05f
168 changed files with 11625 additions and 0 deletions
BIN
Utils/Parser Generator/BIN/ALex.exe
Normal file
BIN
Utils/Parser Generator/BIN/ALex.exe
Normal file
Binary file not shown.
BIN
Utils/Parser Generator/BIN/PARGEN.HLP
Normal file
BIN
Utils/Parser Generator/BIN/PARGEN.HLP
Normal file
Binary file not shown.
562
Utils/Parser Generator/BIN/ParGen.cnt
Normal file
562
Utils/Parser Generator/BIN/ParGen.cnt
Normal file
|
@ -0,0 +1,562 @@
|
||||||
|
:Base ParGen.hlp
|
||||||
|
1 Parser Generator
|
||||||
|
2 How to...
|
||||||
|
3 Setup Visual C++ Version 4.00=setup_visual_cpp_version_400
|
||||||
|
3 Setup Visual C++ Version 1.52=setup_visual_cpp_version_152
|
||||||
|
3 Setup Borland C++ Builder Version 3.0=setup_borland_cpp_builder_version_30
|
||||||
|
3 Setup Borland C++ Version 4.52=setup_borland_cpp_version_452
|
||||||
|
3 Setup Other C/C++ Compilers=setup_other_c_cpp_compilers
|
||||||
|
3 Solve Common Linker Problems=solve_common_linker_problems
|
||||||
|
2 Menus
|
||||||
|
3 File Menu=menu_file
|
||||||
|
3 Edit Menu=menu_edit
|
||||||
|
3 View Menu=menu_view
|
||||||
|
3 Project Menu=menu_project
|
||||||
|
3 Options Menu=menu_options
|
||||||
|
3 Window Menu=menu_window
|
||||||
|
3 Help Menu=menu_help
|
||||||
|
2 Control Bars
|
||||||
|
3 Toolbar=AFX_HIDW_TOOLBAR
|
||||||
|
3 Status Bar=AFX_HIDW_STATUS_BAR
|
||||||
|
2 Windows
|
||||||
|
3 Editor Window=HIDR_EDITORTYPE
|
||||||
|
3 Output Window=HIDR_OUTPUTTYPE
|
||||||
|
1 Options
|
||||||
|
2 AYACC Options
|
||||||
|
3 Operation=ayacc_operation
|
||||||
|
3 -? Option=ayacc_option_question
|
||||||
|
3 -$ Option=ayacc_option_dollar
|
||||||
|
3 -E Option=ayacc_option_capital_e
|
||||||
|
3 -G Option=ayacc_option_capital_g
|
||||||
|
3 -I Option=ayacc_option_capital_i
|
||||||
|
3 -N Option=ayacc_option_capital_n
|
||||||
|
3 -R Option=ayacc_option_capital_r
|
||||||
|
3 -S Option=ayacc_option_capital_s
|
||||||
|
3 -T Option=ayacc_option_capital_t
|
||||||
|
3 -c Option=ayacc_option_c
|
||||||
|
3 -d Option=ayacc_option_d
|
||||||
|
3 -e Option=ayacc_option_e
|
||||||
|
3 -f Option=ayacc_option_f
|
||||||
|
3 -l Option=ayacc_option_l
|
||||||
|
3 -m Option=ayacc_option_m
|
||||||
|
3 -o Option=ayacc_option_o
|
||||||
|
3 -p Option=ayacc_option_p
|
||||||
|
3 -s Option=ayacc_option_s
|
||||||
|
3 -v Option=ayacc_option_v
|
||||||
|
3 -x Option=ayacc_option_x
|
||||||
|
3 -z Option=ayacc_option_z
|
||||||
|
2 ALex Options
|
||||||
|
3 Operation=alex_operation
|
||||||
|
3 -? Option=alex_option_question
|
||||||
|
3 -$ Option=alex_option_dollar
|
||||||
|
3 -E Option=alex_option_capital_e
|
||||||
|
3 -R Option=alex_option_capital_r
|
||||||
|
3 -S Option=alex_option_capital_s
|
||||||
|
3 -T Option=alex_option_capital_t
|
||||||
|
3 -c Option=alex_option_c
|
||||||
|
3 -d Option=alex_option_d
|
||||||
|
3 -e Option=alex_option_e
|
||||||
|
3 -f Option=alex_option_f
|
||||||
|
3 -i Option=alex_option_i
|
||||||
|
3 -l Option=alex_option_l
|
||||||
|
3 -m Option=alex_option_m
|
||||||
|
3 -o Option=alex_option_o
|
||||||
|
3 -r Option=alex_option_r
|
||||||
|
3 -s Option=alex_option_s
|
||||||
|
3 -t Option=alex_option_t
|
||||||
|
3 -u Option=alex_option_u
|
||||||
|
3 -x Option=alex_option_x
|
||||||
|
3 -z Option=alex_option_z
|
||||||
|
1 Errors
|
||||||
|
2 AYACC Errors
|
||||||
|
2 AYACC Errors=ayacc_errors
|
||||||
|
3 Fatal Errors
|
||||||
|
4 Fatal Error Y1001=Y1001
|
||||||
|
4 Fatal Error Y1002=Y1002
|
||||||
|
4 Fatal Error Y1003=Y1003
|
||||||
|
4 Fatal Error Y1004=Y1004
|
||||||
|
4 Fatal Error Y1005=Y1005
|
||||||
|
4 Fatal Error Y1006=Y1006
|
||||||
|
4 Fatal Error Y1007=Y1007
|
||||||
|
4 Fatal Error Y1008=Y1008
|
||||||
|
4 Fatal Error Y1009=Y1009
|
||||||
|
4 Fatal Error Y1010=Y1010
|
||||||
|
4 Fatal Error Y1011=Y1011
|
||||||
|
4 Fatal Error Y1012=Y1012
|
||||||
|
4 Fatal Error Y1013=Y1013
|
||||||
|
4 Fatal Error Y1014=Y1014
|
||||||
|
4 Fatal Error Y1015=Y1015
|
||||||
|
4 Fatal Error Y1016=Y1016
|
||||||
|
4 Fatal Error Y1017=Y1017
|
||||||
|
4 Fatal Error Y1018=Y1018
|
||||||
|
3 Errors
|
||||||
|
4 Error Y2001=Y2001
|
||||||
|
4 Error Y2002=Y2002
|
||||||
|
4 Error Y2003=Y2003
|
||||||
|
4 Error Y2004=Y2004
|
||||||
|
4 Error Y2005=Y2005
|
||||||
|
4 Error Y2006=Y2006
|
||||||
|
4 Error Y2007=Y2007
|
||||||
|
4 Error Y2008=Y2008
|
||||||
|
4 Error Y2009=Y2009
|
||||||
|
4 Error Y2010=Y2010
|
||||||
|
4 Error Y2011=Y2011
|
||||||
|
4 Error Y2012=Y2012
|
||||||
|
4 Error Y2013=Y2013
|
||||||
|
4 Error Y2014=Y2014
|
||||||
|
4 Error Y2015=Y2015
|
||||||
|
4 Error Y2016=Y2016
|
||||||
|
4 Error Y2017=Y2017
|
||||||
|
4 Error Y2018=Y2018
|
||||||
|
4 Error Y2019=Y2019
|
||||||
|
4 Error Y2020=Y2020
|
||||||
|
4 Error Y2021=Y2021
|
||||||
|
4 Error Y2022=Y2022
|
||||||
|
4 Error Y2023=Y2023
|
||||||
|
4 Error Y2024=Y2024
|
||||||
|
4 Error Y2025=Y2025
|
||||||
|
4 Error Y2026=Y2026
|
||||||
|
4 Error Y2027=Y2027
|
||||||
|
4 Error Y2028=Y2028
|
||||||
|
4 Error Y2029=Y2029
|
||||||
|
4 Error Y2030=Y2030
|
||||||
|
4 Error Y2031=Y2031
|
||||||
|
3 Warnings
|
||||||
|
4 Warning Y4001=Y4001
|
||||||
|
4 Warning Y4002=Y4002
|
||||||
|
4 Warning Y4003=Y4003
|
||||||
|
4 Warning Y4004=Y4004
|
||||||
|
4 Warning Y4005=Y4005
|
||||||
|
4 Warning Y4006=Y4006
|
||||||
|
4 Warning Y4007=Y4007
|
||||||
|
4 Warning Y4008=Y4008
|
||||||
|
4 Warning Y4009=Y4009
|
||||||
|
4 Warning Y4010=Y4010
|
||||||
|
4 Warning Y4011=Y4011
|
||||||
|
2 ALex Errors
|
||||||
|
3 ALex Errors=alex_errors
|
||||||
|
3 Fatal Errors
|
||||||
|
4 Fatal Error L1001=L1001
|
||||||
|
4 Fatal Error L1002=L1002
|
||||||
|
4 Fatal Error L1003=L1003
|
||||||
|
4 Fatal Error L1004=L1004
|
||||||
|
4 Fatal Error L1005=L1005
|
||||||
|
4 Fatal Error L1006=L1006
|
||||||
|
4 Fatal Error L1007=L1007
|
||||||
|
4 Fatal Error L1008=L1008
|
||||||
|
4 Fatal Error L1009=L1009
|
||||||
|
4 Fatal Error L1010=L1010
|
||||||
|
4 Fatal Error L1011=L1011
|
||||||
|
4 Fatal Error L1012=L1012
|
||||||
|
4 Fatal Error L1013=L1013
|
||||||
|
4 Fatal Error L1014=L1014
|
||||||
|
4 Fatal Error L1015=L1015
|
||||||
|
4 Fatal Error L1016=L1016
|
||||||
|
4 Fatal Error L1017=L1017
|
||||||
|
4 Fatal Error L1018=L1018
|
||||||
|
3 Errors
|
||||||
|
4 Error L2001=L2001
|
||||||
|
4 Error L2002=L2002
|
||||||
|
4 Error L2003=L2003
|
||||||
|
4 Error L2004=L2004
|
||||||
|
4 Error L2005=L2005
|
||||||
|
4 Error L2006=L2006
|
||||||
|
4 Error L2007=L2007
|
||||||
|
4 Error L2008=L2008
|
||||||
|
4 Error L2009=L2009
|
||||||
|
4 Error L2010=L2010
|
||||||
|
4 Error L2011=L2011
|
||||||
|
4 Error L2012=L2012
|
||||||
|
4 Error L2013=L2013
|
||||||
|
4 Error L2014=L2014
|
||||||
|
4 Error L2015=L2015
|
||||||
|
4 Error L2016=L2016
|
||||||
|
4 Error L2017=L2017
|
||||||
|
4 Error L2018=L2018
|
||||||
|
4 Error L2019=L2019
|
||||||
|
4 Error L2020=L2020
|
||||||
|
4 Error L2021=L2021
|
||||||
|
3 Warnings
|
||||||
|
4 Warning L4001=L4001
|
||||||
|
4 Warning L4002=L4002
|
||||||
|
4 Warning L4003=L4003
|
||||||
|
4 Warning L4004=L4004
|
||||||
|
4 Warning L4005=L4005
|
||||||
|
4 Warning L4006=L4006
|
||||||
|
4 Warning L4007=L4007
|
||||||
|
4 Warning L4008=L4008
|
||||||
|
4 Warning L4009=L4009
|
||||||
|
4 Warning L4010=L4010
|
||||||
|
4 Warning L4011=L4011
|
||||||
|
4 Warning L4012=L4012
|
||||||
|
4 Warning L4013=L4013
|
||||||
|
1 YACC Language
|
||||||
|
2 YACC Language=yacc_language
|
||||||
|
2 Introduction=yacc_introduction
|
||||||
|
3 Grammar Summary=yacc_grammar_summary
|
||||||
|
2 Tokens
|
||||||
|
3 Tokens=yacc_tokens
|
||||||
|
3 Keywords=yacc_keywords
|
||||||
|
3 Identifiers=yacc_identifiers
|
||||||
|
3 Character Tokens=yacc_character_tokens
|
||||||
|
3 Integers=yacc_integers
|
||||||
|
3 Tags=yacc_tags
|
||||||
|
3 Actions=yacc_actions
|
||||||
|
3 Attributes=yacc_attributes
|
||||||
|
3 Comments=yacc_comments
|
||||||
|
3 Program Code=yacc_program_code
|
||||||
|
3 Declaration Code Block=yacc_declaration_code_block
|
||||||
|
3 Code Block=yacc_code_block
|
||||||
|
3 Other Tokens=yacc_other_tokens
|
||||||
|
2 Grammar
|
||||||
|
3 Grammar=yacc_grammar
|
||||||
|
2 Declarations Section
|
||||||
|
3 Declarations Section=yacc_declarations_section
|
||||||
|
3 Token Declaration=yacc_token_declaration
|
||||||
|
3 Start Declaration=yacc_start_declaration
|
||||||
|
3 Type Declaration=yacc_type_declaration
|
||||||
|
3 Union Declaration=yacc_union_declaration
|
||||||
|
3 Name Declaration=yacc_name_declaration
|
||||||
|
3 Include Declaration=yacc_include_declaration
|
||||||
|
3 Defines=yacc_defines
|
||||||
|
2 Rules Section
|
||||||
|
3 Rules Section=yacc_rules_section
|
||||||
|
3 Grammar Rule=yacc_grammar_rule
|
||||||
|
3 Production=yacc_production
|
||||||
|
3 Grammar Symbol=yacc_grammar_symbol
|
||||||
|
3 Action Symbol=yacc_action_symbol
|
||||||
|
3 Precedence Symbol=yacc_precedence_symbol
|
||||||
|
3 Symbol Destructor Rule=yacc_symbol_destructor_rule
|
||||||
|
3 Ambiguity Resolution=yacc_ambiguity_resolution
|
||||||
|
3 Error Recovery=yacc_error_recovery
|
||||||
|
3 Operator Precedence Grammars=yacc_operator_precedence_grammars
|
||||||
|
2 Programs Section
|
||||||
|
3 Programs Section=yacc_programs_section
|
||||||
|
2 Quick Reference Topics
|
||||||
|
3 Multiple C Parsers=yacc_multiple_parsers
|
||||||
|
1 Lex Language
|
||||||
|
2 Lex Language=lex_language
|
||||||
|
2 Introduction=lex_introduction
|
||||||
|
2 Grammar Summary=lex_grammar_summary
|
||||||
|
2 Tokens
|
||||||
|
3 Keywords=lex_keywords
|
||||||
|
3 Identifiers=lex_identifiers
|
||||||
|
3 Integers=lex_integers
|
||||||
|
3 Characters=lex_characters
|
||||||
|
3 Character Strings=lex_character_strings
|
||||||
|
3 Character Classes=lex_character_classes
|
||||||
|
3 Action=lex_action
|
||||||
|
3 Separator=lex_separator
|
||||||
|
3 Comments=lex_comments
|
||||||
|
3 Program Code=lex_program_code
|
||||||
|
3 Code Block=lex_code_block
|
||||||
|
3 Code Line=lex_code_line
|
||||||
|
3 Macro Name=lex_macro_name
|
||||||
|
3 Translation String=lex_translation_string
|
||||||
|
3 Macro Reference=lex_macro_reference
|
||||||
|
3 Declaration Code Block=lex_declaration_code_block
|
||||||
|
3 Other Tokens=lex_other_tokens
|
||||||
|
2 Grammar
|
||||||
|
3 Grammar=lex_grammar
|
||||||
|
2 Declarations Section
|
||||||
|
3 Declarations Section=lex_declarations_section
|
||||||
|
3 Start Declaration=lex_start_declaration
|
||||||
|
3 Table Declaration=lex_table_declaration
|
||||||
|
3 Macro Declaration=lex_macro_declaration
|
||||||
|
3 Array Declaration=lex_array_declaration
|
||||||
|
3 Option Declaration=lex_option_declaration
|
||||||
|
3 Name Declaration=lex_name_declaration
|
||||||
|
3 Include Declaration=lex_include_declaration
|
||||||
|
3 Defines=lex_defines
|
||||||
|
2 Rules Section
|
||||||
|
3 Rules Section=lex_rules_section
|
||||||
|
3 Group Rule=lex_group_rule
|
||||||
|
3 Expression Rule=lex_expression_rule
|
||||||
|
3 Left Context=lex_left_context
|
||||||
|
3 Right Context Expression=lex_right_context_expression
|
||||||
|
3 Union Expression=lex_union_expression
|
||||||
|
3 Concatenation Expression=lex_concatenation_expression
|
||||||
|
3 Repetition Expression=lex_repetition_expression
|
||||||
|
3 Primary Expression=lex_primary_expression
|
||||||
|
3 Ambiguity Resolution=lex_ambiguity_resolution
|
||||||
|
2 Programs Section
|
||||||
|
3 Programs Section=lex_programs_section
|
||||||
|
2 Quick Reference Topics
|
||||||
|
3 Multiple C Lexical Analysers=lex_multiple_lexical_analysers
|
||||||
|
3 Operator Summary=lex_operator_summary
|
||||||
|
3 ASCII Character Set=ascii_character_set
|
||||||
|
1 YACC And Lex Library
|
||||||
|
2 YACC And Lex Library=library
|
||||||
|
2 Classes
|
||||||
|
3 Classes=classes
|
||||||
|
3 yyparser
|
||||||
|
4 yyparser=yyparser
|
||||||
|
4 yyparser Members=yyparser_members
|
||||||
|
4 yyparser Member Variables
|
||||||
|
5 yychar=yyparser_yychar
|
||||||
|
5 yydebug=yyparser_yydebug
|
||||||
|
5 yydebugflush=yyparser_yydebugflush
|
||||||
|
5 yydebugout=yyparser_yydebugout
|
||||||
|
5 yydebugstack=yyparser_yydebugstack
|
||||||
|
5 yyerr=yyparser_yyerr
|
||||||
|
5 yyerrorcount=yyparser_yyerrorcount
|
||||||
|
5 yylookahead=yyparser_yylookahead
|
||||||
|
5 yystackgrow=yyparser_yystackgrow
|
||||||
|
5 yywipeflg=yyparser_yywipeflg
|
||||||
|
4 yyparser Construction Member Functions
|
||||||
|
5 yyparser=yyparser_yyparser
|
||||||
|
5 yycreate=yyparser_yycreate
|
||||||
|
5 yydestroy=yyparser_yydestroy
|
||||||
|
4 yyparser General Member Functions
|
||||||
|
5 yycleanup=yyparser_yycleanup
|
||||||
|
5 yydestructpop=yyparser_yydestructpop
|
||||||
|
5 yyparse=yyparser_yyparse
|
||||||
|
5 yysetstacksize=yyparser_yysetstacksize
|
||||||
|
5 yysetup=yyparser_yysetup
|
||||||
|
5 yywipe=yyparser_yywipe
|
||||||
|
5 yywork=yyparser_yywork
|
||||||
|
4 yyparser Service Member Functions
|
||||||
|
5 yydiscard=yyparser_yydiscard
|
||||||
|
5 yyerror=yyparser_yyerror
|
||||||
|
5 yygettoken=yyparser_yygettoken
|
||||||
|
5 yystackoverflow=yyparser_yystackoverflow
|
||||||
|
5 yysyntaxerror=yyparser_yysyntaxerror
|
||||||
|
4 yyparser Action Member Functions
|
||||||
|
5 yyabort=yyparser_yyabort
|
||||||
|
5 yyaccept=yyparser_yyaccept
|
||||||
|
5 yyclearin=yyparser_yyclearin
|
||||||
|
5 yydestructclearin=yyparser_yydestructclearin
|
||||||
|
5 yyerrok=yyparser_yyerrok
|
||||||
|
5 yyexit=yyparser_yyexit
|
||||||
|
5 yyforceerror=yyparser_yyforceerror
|
||||||
|
5 yypopping=yyparser_yypopping
|
||||||
|
5 yyrecovering=yyparser_yyrecovering
|
||||||
|
5 yyretire=yyparser_yyretire
|
||||||
|
5 yysetin=yyparser_yysetin
|
||||||
|
5 yythrowerror=yyparser_yythrowerror
|
||||||
|
5 yyunclearin=yyparser_yyunclearin
|
||||||
|
3 yyfparser
|
||||||
|
4 yyfparser=yyfparser
|
||||||
|
3 yycparser
|
||||||
|
4 yycparser=yycparser
|
||||||
|
3 yylexer
|
||||||
|
4 yylexer=yylexer
|
||||||
|
4 yylexer Members=yylexer_members
|
||||||
|
4 yylexer Member Variables
|
||||||
|
5 yyin=yylexer_yyin
|
||||||
|
5 yyeol=yylexer_yyeol
|
||||||
|
5 yydebug=yylexer_yydebug
|
||||||
|
5 yydebugout=yylexer_yydebugout
|
||||||
|
5 yyerr=yylexer_yyerr
|
||||||
|
5 yyleng=yylexer_yyleng
|
||||||
|
5 yylineno=yylexer_yylineno
|
||||||
|
5 yyout=yylexer_yyout
|
||||||
|
5 yystart=yylexer_yystart
|
||||||
|
5 yytext=yylexer_yytext
|
||||||
|
5 yytextgrow=yylexer_yytextgrow
|
||||||
|
5 yyunputgrow=yylexer_yyunputgrow
|
||||||
|
4 yylexer Construction Member Functions
|
||||||
|
5 yylexer=yylexer_yylexer
|
||||||
|
5 yycreate=yylexer_yycreate
|
||||||
|
5 yydestroy=yylexer_yydestroy
|
||||||
|
4 yylexer General Member Functions
|
||||||
|
5 yycleanup=yylexer_yycleanup
|
||||||
|
5 yylex=yylexer_yylex
|
||||||
|
5 yyreset=yylexer_yyreset
|
||||||
|
5 yysettextsize=yylexer_yysettextsize
|
||||||
|
5 yysetunputsize=yylexer_yysetunputsize
|
||||||
|
4 yylexer Service Member Functions
|
||||||
|
5 yygetchar=yylexer_yygetchar
|
||||||
|
5 yyinput=yylexer_yyinput
|
||||||
|
5 yyoutput=yylexer_yyoutput
|
||||||
|
5 yytextoverflow=yylexer_yytextoverflow
|
||||||
|
5 yyunput=yylexer_yyunput
|
||||||
|
5 yyunputoverflow=yylexer_yyunputoverflow
|
||||||
|
5 yywrap=yylexer_yywrap
|
||||||
|
4 yylexer Action Member Functions
|
||||||
|
5 yybegin=yylexer_yybegin
|
||||||
|
5 yyecho=yylexer_yyecho
|
||||||
|
5 yyless=yylexer_yyless
|
||||||
|
5 yymore=yylexer_yymore
|
||||||
|
5 yynewline=yylexer_yynewline
|
||||||
|
5 yyreject=yylexer_yyreject
|
||||||
|
5 yyunputcount=yylexer_yyunputcount
|
||||||
|
3 yyflexer
|
||||||
|
4 yyflexer=yyflexer
|
||||||
|
3 yyclexer
|
||||||
|
4 yyclexer=yyclexer
|
||||||
|
2 Functions
|
||||||
|
3 Functions=functions
|
||||||
|
3 Parser Instance Functions
|
||||||
|
4 Parser Instance Functions=parser_instance_functions
|
||||||
|
4 yymcreateparse=yymcreateparse
|
||||||
|
4 yymdestroyparse=yymdestroyparse
|
||||||
|
3 Parser General Functions
|
||||||
|
4 Parser General Functions=parser_general_functions
|
||||||
|
4 yycparse=yyparse
|
||||||
|
4 yycwipe=yycwipe
|
||||||
|
4 yycwork=yywork
|
||||||
|
4 yydestructpop=yydestructpop
|
||||||
|
4 yyparse=yyparse
|
||||||
|
4 yyparsecleanup=yyparsecleanup
|
||||||
|
4 yyparseinit=yyparseinit
|
||||||
|
4 yysetstacksize=yysetstacksize
|
||||||
|
4 yysetup=yysetup
|
||||||
|
4 yywipe=yywipe
|
||||||
|
4 yywork=yywork
|
||||||
|
4 yymcparse=yymparse
|
||||||
|
4 yymcwipe=yymcwipe
|
||||||
|
4 yymcwork=yymwork
|
||||||
|
4 yymdestructpop=yymdestructpop
|
||||||
|
4 yymparse=yymparse
|
||||||
|
4 yymparsecleanup=yymparsecleanup
|
||||||
|
4 yymparseinit=yymparseinit
|
||||||
|
4 yymsetstacksize=yymsetstacksize
|
||||||
|
4 yymsetup=yymsetup
|
||||||
|
4 yymwipe=yymwipe
|
||||||
|
4 yymwork=yymwork
|
||||||
|
3 Parser Service Functions
|
||||||
|
4 Parser Service Functions=parser_service_functions
|
||||||
|
4 yydiscard=yydiscard
|
||||||
|
4 yyerror=yyerror
|
||||||
|
4 yygettoken=yygettoken
|
||||||
|
4 yystackoverflow=yystackoverflow
|
||||||
|
4 yysyntaxerror=yysyntaxerror
|
||||||
|
4 yymdiscard=yymdiscard
|
||||||
|
4 yymerror=yymerror
|
||||||
|
4 yymgettoken=yymgettoken
|
||||||
|
4 yymstackoverflow=yymstackoverflow
|
||||||
|
4 yymsyntaxerror=yymsyntaxerror
|
||||||
|
3 Parser Action Functions
|
||||||
|
4 Parser Action Functions=parser_action_functions
|
||||||
|
4 yyabort=yyabort
|
||||||
|
4 yyaccept=yyaccept
|
||||||
|
4 yyclearin=yyclearin
|
||||||
|
4 yycdestructclearin=yycdestructclearin
|
||||||
|
4 yydestructclearin=yydestructclearin
|
||||||
|
4 yyerrok=yyerrok
|
||||||
|
4 yyexit=yyexit
|
||||||
|
4 yyforceerror=yyforceerror
|
||||||
|
4 yypopping=yypopping
|
||||||
|
4 yyrecovering=yyrecovering
|
||||||
|
4 yyretire=yyretire
|
||||||
|
4 yysetin=yysetin
|
||||||
|
4 yythrowerror=yythrowerror
|
||||||
|
4 yyunclearin=yyunclearin
|
||||||
|
4 yymcdestructclearin=yymcdestructclearin
|
||||||
|
4 yymdestructclearin=yymdestructclearin
|
||||||
|
4 yymabort=yymabort
|
||||||
|
4 yymaccept=yymaccept
|
||||||
|
4 yymclearin=yymclearin
|
||||||
|
4 yymerrok=yymerrok
|
||||||
|
4 yymexit=yymexit
|
||||||
|
4 yymforceerror=yymforceerror
|
||||||
|
4 yympopping=yympopping
|
||||||
|
4 yymrecovering=yymrecovering
|
||||||
|
4 yymretire=yymretire
|
||||||
|
4 yymsetin=yymsetin
|
||||||
|
4 yymthrowerror=yymthrowerror
|
||||||
|
4 yymunclearin=yymunclearin
|
||||||
|
3 Lexical Analyser Instance Functions
|
||||||
|
4 Lexical Analyser Instance Functions=lexical_analyser_instance_functions
|
||||||
|
4 yymcreatelex=yymcreatelex
|
||||||
|
4 yymdestroylex=yymdestroylex
|
||||||
|
3 Lexical Analyser General Functions
|
||||||
|
4 Lexical Analyser General Functions=lexical_analyser_general_functions
|
||||||
|
4 yyclex=yylex
|
||||||
|
4 yylex=yylex
|
||||||
|
4 yylexcleanup=yylexcleanup
|
||||||
|
4 yylexinit=yylexinit
|
||||||
|
4 yyreset=yyreset
|
||||||
|
4 yysettextsize=yysettextsize
|
||||||
|
4 yysetunputsize=yysetunputsize
|
||||||
|
4 yymclex=yymlex
|
||||||
|
4 yymlex=yymlex
|
||||||
|
4 yymlexcleanup=yymlexcleanup
|
||||||
|
4 yymlexinit=yymlexinit
|
||||||
|
4 yymreset=yymreset
|
||||||
|
4 yymsettextsize=yymsettextsize
|
||||||
|
4 yymsetunputsize=yymsetunputsize
|
||||||
|
3 Lexical Analyser Service Functions
|
||||||
|
4 Lexical Analyser Service Functions=lexical_analyser_service_functions
|
||||||
|
4 yygetchar=yygetchar
|
||||||
|
4 yyinput=yyinput
|
||||||
|
4 yyoutput=yyoutput
|
||||||
|
4 yytextoverflow=yytextoverflow
|
||||||
|
4 yyunput=yyunput
|
||||||
|
4 yyunputoverflow=yyunputoverflow
|
||||||
|
4 yywrap=yywrap
|
||||||
|
4 yymgetchar=yymgetchar
|
||||||
|
4 yyminput=yyminput
|
||||||
|
4 yymoutput=yymoutput
|
||||||
|
4 yymtextoverflow=yymtextoverflow
|
||||||
|
4 yymunput=yymunput
|
||||||
|
4 yymunputoverflow=yymunputoverflow
|
||||||
|
4 yymwrap=yymwrap
|
||||||
|
3 Lexical Analyser Action Functions
|
||||||
|
4 Lexical Analyser Action Functions=lexical_analyser_action_functions
|
||||||
|
4 yybegin=yybegin
|
||||||
|
4 yyecho=yyecho
|
||||||
|
4 yyless=yyless
|
||||||
|
4 yymore=yymore
|
||||||
|
4 yynewline=yynewline
|
||||||
|
4 yyreject=yyreject
|
||||||
|
4 yyunputcount=yyunputcount
|
||||||
|
4 yymbegin=yymbegin
|
||||||
|
4 yymecho=yymecho
|
||||||
|
4 yymless=yymless
|
||||||
|
4 yymmore=yymmore
|
||||||
|
4 yymnewline=yymnewline
|
||||||
|
4 yymreject=yymreject
|
||||||
|
4 yymunputcount=yymunputcount
|
||||||
|
2 Variables
|
||||||
|
3 Variables=variables
|
||||||
|
3 Parser Variables
|
||||||
|
4 Parser Variables=parser_variables
|
||||||
|
4 yychar=yychar
|
||||||
|
4 yyerrorcount=yyerrorcount
|
||||||
|
4 yylookahead=yylookahead
|
||||||
|
4 yyparsedebug=yyparsedebug
|
||||||
|
4 yyparsedebugflush=yyparsedebugflush
|
||||||
|
4 yyparsedebugout=yyparsedebugout
|
||||||
|
4 yyparsedebugstack=yyparsedebugstack
|
||||||
|
4 yyparseerr=yyparseerr
|
||||||
|
4 yystackgrow=yystackgrow
|
||||||
|
4 yywipeflg=yywipeflg
|
||||||
|
3 Lexical Analyser Variables
|
||||||
|
4 Lexical Analyser Variables=lexical_analyser_variables
|
||||||
|
4 yyin=yyin
|
||||||
|
4 yyeol=yyeol
|
||||||
|
4 yyleng=yyleng
|
||||||
|
4 yylexdebug=yylexdebug
|
||||||
|
4 yylexdebugflush=yylexdebugflush
|
||||||
|
4 yylexdebugout=yylexdebugout
|
||||||
|
4 yylexerr=yylexerr
|
||||||
|
4 yylineno=yylineno
|
||||||
|
4 yyout=yyout
|
||||||
|
4 yystart=yystart
|
||||||
|
4 yytext=yytext
|
||||||
|
4 yytextgrow=yytextgrow
|
||||||
|
4 yyunputgrow=yyunputgrow
|
||||||
|
3 Common Variables
|
||||||
|
4 Common Variables=common_variables
|
||||||
|
4 yydebug=yydebug
|
||||||
|
4 yydebugflush=yydebugflush
|
||||||
|
4 yydebugstack=yydebugstack
|
||||||
|
2 Types
|
||||||
|
3 Types=types
|
||||||
|
3 yymparse_t=yymparse_t
|
||||||
|
3 yymlex_t=yymlex_t
|
||||||
|
2 Constants
|
||||||
|
3 Constants=constants
|
||||||
|
2 Modifiers
|
||||||
|
3 Modifiers=modifiers
|
||||||
|
2 Flags
|
||||||
|
3 Flags=flags
|
||||||
|
2 Include Files
|
||||||
|
3 Include Files=include_files
|
||||||
|
1 License
|
||||||
|
2 License=license
|
||||||
|
2 License Agreement=license_agreement
|
||||||
|
2 Ordering Information=ordering_information
|
||||||
|
2 Parser Generator Order Form=parser_generator_order_form
|
BIN
Utils/Parser Generator/BIN/ParGen.exe
Normal file
BIN
Utils/Parser Generator/BIN/ParGen.exe
Normal file
Binary file not shown.
18
Utils/Parser Generator/BIN/ParGen.pgw
Normal file
18
Utils/Parser Generator/BIN/ParGen.pgw
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
[Application]
|
||||||
|
WindowPlacement=0 1 -1 -1 -1 -1 367 176 1437 1061
|
||||||
|
[Editor1]
|
||||||
|
FileName=C:\spongebob\Utils\scripter\parser.y
|
||||||
|
ReadOnly=0
|
||||||
|
WindowPlacement1=0 1 -1 -1 -1 -1 81 81 896 612
|
||||||
|
WindowOrder1=2
|
||||||
|
Position001=0 1
|
||||||
|
Cursor001=0 1 0 1
|
||||||
|
SyntaxColouring=2
|
||||||
|
[Editor2]
|
||||||
|
FileName=C:\spongebob\Utils\scripter\lexer.l
|
||||||
|
ReadOnly=0
|
||||||
|
WindowPlacement1=0 1 -1 -1 -1 -1 108 108 923 639
|
||||||
|
WindowOrder1=1
|
||||||
|
Position001=0 1
|
||||||
|
Cursor001=0 1 0 1
|
||||||
|
SyntaxColouring=1
|
BIN
Utils/Parser Generator/BIN/ayacc.exe
Normal file
BIN
Utils/Parser Generator/BIN/ayacc.exe
Normal file
Binary file not shown.
3
Utils/Parser Generator/BIN/pgvars16.bat
Normal file
3
Utils/Parser Generator/BIN/pgvars16.bat
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
set PATH=C:\PROGRA~1\PARSER~1\BIN;%PATH%
|
||||||
|
set INCLUDE=C:\PROGRA~1\PARSER~1\INCLUDE;%INCLUDE%
|
||||||
|
set LIB=C:\PROGRA~1\PARSER~1\LIB\MSVC;%LIB%
|
3
Utils/Parser Generator/BIN/pgvars32.bat
Normal file
3
Utils/Parser Generator/BIN/pgvars32.bat
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
set PATH=C:\Program Files\Parser Generator\BIN;%PATH%
|
||||||
|
set INCLUDE=C:\Program Files\Parser Generator\INCLUDE;%INCLUDE%
|
||||||
|
set LIB=C:\Program Files\Parser Generator\LIB\MSDEV;%LIB%
|
BIN
Utils/Parser Generator/DeIsL1.isu
Normal file
BIN
Utils/Parser Generator/DeIsL1.isu
Normal file
Binary file not shown.
237
Utils/Parser Generator/INCLUDE/clex.h
Normal file
237
Utils/Parser Generator/INCLUDE/clex.h
Normal file
|
@ -0,0 +1,237 @@
|
||||||
|
#ifndef CLEX_H
|
||||||
|
#define CLEX_H
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
clex.h
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
// defines
|
||||||
|
#include <yytdefs.h>
|
||||||
|
|
||||||
|
// user defines
|
||||||
|
#if defined(YYTUDEFS) || defined(YYUDEFS)
|
||||||
|
#include <yytudefs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define YY_ALEX
|
||||||
|
|
||||||
|
// modifiers
|
||||||
|
#ifndef YYCDECL
|
||||||
|
#define YYCDECL
|
||||||
|
#endif
|
||||||
|
#ifndef YYDCDECL
|
||||||
|
#define YYDCDECL
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEAR
|
||||||
|
#define YYNEAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYFAR
|
||||||
|
#define YYFAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEARFAR
|
||||||
|
#define YYNEARFAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYBASED_CODE
|
||||||
|
#define YYBASED_CODE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// forward references
|
||||||
|
class YYFAR yyparser;
|
||||||
|
|
||||||
|
// yylex return values
|
||||||
|
#define YYEOF 0 // end of file
|
||||||
|
|
||||||
|
#ifndef YYSTATE_T
|
||||||
|
#define YYSTATE_T
|
||||||
|
typedef struct yystate {
|
||||||
|
short def; // default state
|
||||||
|
short base; // base
|
||||||
|
short match; // action associated with state
|
||||||
|
} yystate_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYTRANSITION_T
|
||||||
|
#define YYTRANSITION_T
|
||||||
|
typedef struct yytransition {
|
||||||
|
short next; // next state on transition
|
||||||
|
short check; // check
|
||||||
|
} yytransition_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYCTRANSITION_T
|
||||||
|
#define YYCTRANSITION_T
|
||||||
|
typedef struct yyctransition {
|
||||||
|
unsigned char first; // first character in range
|
||||||
|
unsigned char last; // last character in range
|
||||||
|
short next; // next state on transition
|
||||||
|
} yyctransition_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef short yymatch_t;
|
||||||
|
typedef unsigned char yybackup_t;
|
||||||
|
|
||||||
|
class YYFAR yylexer {
|
||||||
|
public:
|
||||||
|
yylexer();
|
||||||
|
virtual ~yylexer();
|
||||||
|
|
||||||
|
// Attributes
|
||||||
|
protected:
|
||||||
|
// left context
|
||||||
|
int yystart; // current start state
|
||||||
|
unsigned char yyeol; // whether an end-of-line '\n' has been seen
|
||||||
|
unsigned char yyoldeol; // previous end-of-line value
|
||||||
|
|
||||||
|
// text buffer
|
||||||
|
int YYFAR* yystatebuf; // state buffer
|
||||||
|
int YYFAR* yysstatebuf; // initial (static) state buffer
|
||||||
|
char YYFAR* yystext; // initial (static) text buffer
|
||||||
|
int yytext_size; // text buffer size
|
||||||
|
int yystext_size; // initial (static) text buffer size
|
||||||
|
|
||||||
|
// unput buffer
|
||||||
|
int YYFAR* yyunputbufptr; // unput buffer
|
||||||
|
int YYFAR* yysunputbufptr; // initial (static) unput buffer
|
||||||
|
int yyunput_size; // unput buffer size
|
||||||
|
int yysunput_size; // initial (static) unput buffer size
|
||||||
|
int yyunputindex; // unput buffer position
|
||||||
|
|
||||||
|
// actions
|
||||||
|
unsigned char yymoreflg; // concatenate matched strings
|
||||||
|
unsigned char yyrejectflg; // yyreject called from an action
|
||||||
|
unsigned char yyreturnflg; // return from an action
|
||||||
|
public:
|
||||||
|
yyparser YYFAR* yyparserptr; // pointer to the attached parser
|
||||||
|
|
||||||
|
// buffer flags
|
||||||
|
unsigned char yytextgrow; // whether text buffer is allowed to grow
|
||||||
|
unsigned char yyunputgrow; // whether unput buffer is allowed to grow
|
||||||
|
|
||||||
|
// streams
|
||||||
|
FILE YYFAR* yyin; // input text stream
|
||||||
|
FILE YYFAR* yyout; // output text stream
|
||||||
|
FILE YYFAR* yyerr; // error stream
|
||||||
|
|
||||||
|
// matched string
|
||||||
|
char YYFAR* yytext; // text buffer
|
||||||
|
int yyleng; // matched string length
|
||||||
|
int yylineno; // current line number
|
||||||
|
|
||||||
|
// Operations
|
||||||
|
protected:
|
||||||
|
// helper functions
|
||||||
|
int yyback(const yymatch_t YYNEARFAR* p, int action) const;
|
||||||
|
public:
|
||||||
|
// instance functions
|
||||||
|
int yycreate(yyparser YYFAR* parserptr = NULL);
|
||||||
|
void yydestroy();
|
||||||
|
|
||||||
|
// general functions
|
||||||
|
void yycleanup();
|
||||||
|
virtual int yylex() = 0;
|
||||||
|
void yyreset();
|
||||||
|
int yysettextsize(int size);
|
||||||
|
int yysetunputsize(int size);
|
||||||
|
|
||||||
|
// service functions
|
||||||
|
virtual int yyinput();
|
||||||
|
virtual void yyoutput(int ch);
|
||||||
|
virtual void yyunput(int ch);
|
||||||
|
virtual int yywrap();
|
||||||
|
virtual int yygetchar();
|
||||||
|
virtual void yytextoverflow();
|
||||||
|
virtual void yyunputoverflow();
|
||||||
|
virtual int yyaction(int action) = 0;
|
||||||
|
|
||||||
|
// action functions
|
||||||
|
void yyecho();
|
||||||
|
void yyless(int length);
|
||||||
|
void yybegin(int state) { yystart = state; }
|
||||||
|
void yymore() { yymoreflg = 1; }
|
||||||
|
void yynewline(int newline) { newline ? yyeol = 1 : (yyeol = 0); }
|
||||||
|
void yyreject() { yyrejectflg = 1; }
|
||||||
|
int yyunputcount() const { return yyunputindex; }
|
||||||
|
|
||||||
|
// compatibility
|
||||||
|
int yyclex() { return yylex(); }
|
||||||
|
void yylexcleanup() { yycleanup(); }
|
||||||
|
void yylexinit() { /* do nothing */ }
|
||||||
|
#define BEGIN yystart =
|
||||||
|
#define ECHO yyecho()
|
||||||
|
#define REJECT yyreject()
|
||||||
|
#define YYSTATE yystart
|
||||||
|
#define YY_START yystart
|
||||||
|
|
||||||
|
// Tables
|
||||||
|
protected:
|
||||||
|
const yymatch_t YYNEARFAR* yymatch;
|
||||||
|
const yystate_t YYNEARFAR* yystate;
|
||||||
|
const yybackup_t YYNEARFAR* yybackup;
|
||||||
|
|
||||||
|
// Debugging
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
public:
|
||||||
|
int yydebug; // whether debug information should be output
|
||||||
|
int yydebugflush; // whether debug output should be flushed
|
||||||
|
FILE YYFAR* yydebugout; // debug output file
|
||||||
|
protected:
|
||||||
|
void yydebugoutput(int ch) const;
|
||||||
|
void yydmatch(int expr) const;
|
||||||
|
void yydebugoutput(const char* string) const;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
class YYFAR yyflexer : public yylexer {
|
||||||
|
public:
|
||||||
|
yyflexer() { /* do nothing */ }
|
||||||
|
|
||||||
|
// Operations
|
||||||
|
public:
|
||||||
|
virtual int yylex();
|
||||||
|
|
||||||
|
// Tables
|
||||||
|
protected:
|
||||||
|
const yytransition_t YYNEARFAR* yytransition;
|
||||||
|
int yytransitionmax;
|
||||||
|
};
|
||||||
|
|
||||||
|
class YYFAR yyclexer : public yylexer {
|
||||||
|
public:
|
||||||
|
yyclexer() { /* do nothing */ }
|
||||||
|
|
||||||
|
// Operations
|
||||||
|
public:
|
||||||
|
virtual int yylex();
|
||||||
|
|
||||||
|
// Tables
|
||||||
|
protected:
|
||||||
|
const yyctransition_t YYNEARFAR* yyctransition;
|
||||||
|
};
|
||||||
|
|
||||||
|
// helper functions
|
||||||
|
#ifndef yyassert
|
||||||
|
#define yyassert(expr) assert(expr)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// debugging variables
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
extern "C" int YYNEAR YYDCDECL yydebug;
|
||||||
|
extern "C" int YYNEAR YYDCDECL yydebugflush;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// user defines
|
||||||
|
#if defined(YYBUDEFS) || defined(YYUDEFS)
|
||||||
|
#include <yybudefs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// defines
|
||||||
|
#include <yybdefs.h>
|
||||||
|
|
||||||
|
#endif
|
375
Utils/Parser Generator/INCLUDE/cyacc.h
Normal file
375
Utils/Parser Generator/INCLUDE/cyacc.h
Normal file
|
@ -0,0 +1,375 @@
|
||||||
|
#ifndef CYACC_H
|
||||||
|
#define CYACC_H
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
cyacc.h
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
// defines
|
||||||
|
#include <yytdefs.h>
|
||||||
|
|
||||||
|
// user defines
|
||||||
|
#if defined(YYTUDEFS) || defined(YYUDEFS)
|
||||||
|
#include <yytudefs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define YY_AYACC
|
||||||
|
|
||||||
|
// modifiers
|
||||||
|
#ifndef YYCDECL
|
||||||
|
#define YYCDECL
|
||||||
|
#endif
|
||||||
|
#ifndef YYDCDECL
|
||||||
|
#define YYDCDECL
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEAR
|
||||||
|
#define YYNEAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYFAR
|
||||||
|
#define YYFAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEARFAR
|
||||||
|
#define YYNEARFAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYBASED_CODE
|
||||||
|
#define YYBASED_CODE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// forward references
|
||||||
|
class YYFAR yylexer;
|
||||||
|
|
||||||
|
typedef short yystack_t;
|
||||||
|
|
||||||
|
// yyparse return values
|
||||||
|
#define YYEXIT_SUCCESS 0
|
||||||
|
#define YYEXIT_FAILURE 1
|
||||||
|
|
||||||
|
// common tokens
|
||||||
|
#define YYTK_ALL (-1) // match all tokens
|
||||||
|
#define YYTK_END 0 // $end token
|
||||||
|
#define YYTK_ERROR 256 // error token
|
||||||
|
|
||||||
|
#ifndef YYCSTATEGOTO_T
|
||||||
|
#define YYCSTATEGOTO_T
|
||||||
|
typedef short yycstategoto_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYCNONTERMGOTO_T
|
||||||
|
#define YYCNONTERMGOTO_T
|
||||||
|
typedef struct yycnontermgoto {
|
||||||
|
short nonterm; // nonterminal
|
||||||
|
short next; // next state
|
||||||
|
} yycnontermgoto_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYSTATEGOTO_T
|
||||||
|
#define YYSTATEGOTO_T
|
||||||
|
typedef struct yystategoto {
|
||||||
|
short base; // base
|
||||||
|
short def; // default state
|
||||||
|
} yystategoto_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYNONTERMGOTO_T
|
||||||
|
#define YYNONTERMGOTO_T
|
||||||
|
typedef struct yynontermgoto {
|
||||||
|
short check; // check
|
||||||
|
short next; // next state
|
||||||
|
} yynontermgoto_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// action types
|
||||||
|
#define YYAT_SHIFT 0 // shift action
|
||||||
|
#define YYAT_REDUCE 1 // reduce action
|
||||||
|
#define YYAT_ERROR 2 // error
|
||||||
|
#define YYAT_ACCEPT 3 // accept
|
||||||
|
#define YYAT_DEFAULT 4 // default state
|
||||||
|
|
||||||
|
#ifndef YYCSTATEACTION_T
|
||||||
|
#define YYCSTATEACTION_T
|
||||||
|
typedef short yycstateaction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYCTOKENACTION_T
|
||||||
|
#define YYCTOKENACTION_T
|
||||||
|
typedef struct yyctokenaction {
|
||||||
|
int token; // lookahead token
|
||||||
|
unsigned char type; // action to perform
|
||||||
|
short sr; // state to shift/production to reduce
|
||||||
|
} yyctokenaction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYSTATEACTION_T
|
||||||
|
#define YYSTATEACTION_T
|
||||||
|
typedef struct yystateaction {
|
||||||
|
short base; // base
|
||||||
|
unsigned char lookahead; // lookahead needed
|
||||||
|
unsigned char type; // action to perform
|
||||||
|
short sr; // shift/reduce
|
||||||
|
} yystateaction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYTOKENACTION_T
|
||||||
|
#define YYTOKENACTION_T
|
||||||
|
typedef struct yytokenaction {
|
||||||
|
short check; // check
|
||||||
|
unsigned char type; // action type
|
||||||
|
short sr; // shift/reduce
|
||||||
|
} yytokenaction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// nonterminals
|
||||||
|
#define YYNT_ALL (-1) // match all nonterminals
|
||||||
|
|
||||||
|
// states
|
||||||
|
#define YYST_ERROR (-1) // goto error
|
||||||
|
|
||||||
|
#ifndef YYREDUCTION_T
|
||||||
|
#define YYREDUCTION_T
|
||||||
|
typedef struct yyreduction {
|
||||||
|
short nonterm; // the rhs symbol
|
||||||
|
short length; // number of symbols on lhs
|
||||||
|
short action; // the user action
|
||||||
|
} yyreduction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef short yydestructor_t;
|
||||||
|
|
||||||
|
typedef short yytokendest_t;
|
||||||
|
|
||||||
|
#ifndef YYCTOKENDEST_T
|
||||||
|
#define YYCTOKENDEST_T
|
||||||
|
typedef struct yyctokendest {
|
||||||
|
int token; /* token */
|
||||||
|
short action; /* the user action */
|
||||||
|
} yyctokendest_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// debugging
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
#ifndef YYSYMBOL_T
|
||||||
|
#define YYSYMBOL_T
|
||||||
|
typedef struct yysymbol {
|
||||||
|
const char* name; // symbol name
|
||||||
|
int token; // symbol token
|
||||||
|
} yysymbol_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class YYFAR yyparser {
|
||||||
|
public:
|
||||||
|
yyparser();
|
||||||
|
virtual ~yyparser();
|
||||||
|
|
||||||
|
// Attributes
|
||||||
|
protected:
|
||||||
|
// stack
|
||||||
|
yystack_t YYFAR* yystackptr; // (state) stack
|
||||||
|
yystack_t YYFAR* yysstackptr; // static (state) stack
|
||||||
|
void YYFAR* yyattributestackptr; // attribute stack
|
||||||
|
void YYFAR* yysattributestackptr; // static attribute stack
|
||||||
|
int yystack_size; // number of elements in stack
|
||||||
|
int yysstack_size; // initial number of elements in stack
|
||||||
|
|
||||||
|
int yytop; // the current top of the stack
|
||||||
|
size_t yyattribute_size; // size of attribute
|
||||||
|
|
||||||
|
void YYFAR* yyvalptr; // attribute for $$
|
||||||
|
|
||||||
|
// lookahead token
|
||||||
|
unsigned char yylookahead; // whether current lookahead token is valid
|
||||||
|
int yychar; // current lookahead token
|
||||||
|
|
||||||
|
// error recovery
|
||||||
|
unsigned char yywipeflg; // whether to "wipe" stack on abort
|
||||||
|
unsigned char yypopflg; // popping symbols during error recovery
|
||||||
|
int yyskip; // error recovery token shift counter
|
||||||
|
|
||||||
|
// actions
|
||||||
|
unsigned char yyexitflg; // whether yymexit called
|
||||||
|
unsigned char yyretireflg; // whether yymretire called
|
||||||
|
unsigned char yyerrorflg; // whether yymforceerror called
|
||||||
|
int yyexitcode; // yymexit exit code
|
||||||
|
int yyretirecode; // yymretire exit code
|
||||||
|
int yyerrorpop; // how many error transitions to pop
|
||||||
|
public:
|
||||||
|
yylexer YYFAR* yylexerptr; // pointer to the attached lexical analyser
|
||||||
|
|
||||||
|
unsigned char yystackgrow; // whether stack can grow
|
||||||
|
void YYFAR* yylvalptr; // current token attribute
|
||||||
|
FILE YYFAR* yyerr; // error output file
|
||||||
|
int yyerrorcount; // how many syntax errors have occurred
|
||||||
|
|
||||||
|
// Operations
|
||||||
|
protected:
|
||||||
|
virtual void yyaction(int action) = 0;
|
||||||
|
|
||||||
|
// utility functions
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
void yypop(int num);
|
||||||
|
void yysetskip(int skip);
|
||||||
|
#else
|
||||||
|
void yypop(int num) { yytop -= num; }
|
||||||
|
void yysetskip(int skip) { yyskip = skip; }
|
||||||
|
#endif
|
||||||
|
int yypush(yystack_t state);
|
||||||
|
yystack_t yypeek() const { return yystackptr[yytop]; }
|
||||||
|
|
||||||
|
public:
|
||||||
|
// instance functions
|
||||||
|
int yycreate(yylexer YYFAR* lexerptr = NULL);
|
||||||
|
void yydestroy();
|
||||||
|
|
||||||
|
// general functions
|
||||||
|
void yydestructpop(int num);
|
||||||
|
int yyparse();
|
||||||
|
void yycleanup();
|
||||||
|
int yysetstacksize(int size);
|
||||||
|
int yysetup();
|
||||||
|
void yywipe();
|
||||||
|
virtual int yywork() = 0;
|
||||||
|
virtual void yydestructclearin() = 0;
|
||||||
|
|
||||||
|
// service functions
|
||||||
|
virtual void yystackoverflow();
|
||||||
|
virtual void yyerror(const char YYFAR* text);
|
||||||
|
virtual void yysyntaxerror();
|
||||||
|
virtual void yydiscard(int token);
|
||||||
|
virtual int yygettoken();
|
||||||
|
|
||||||
|
// action functions
|
||||||
|
void yysetin(int token);
|
||||||
|
int yyunclearin();
|
||||||
|
void yyabort() { yyexit(1); }
|
||||||
|
void yyaccept() { yyexit(0); }
|
||||||
|
#ifndef YY_COMPATIBLE
|
||||||
|
void yyclearin() { yylookahead = 0; }
|
||||||
|
void yyerrok() { yysetskip(0); }
|
||||||
|
#else
|
||||||
|
void _yyclearin() { yylookahead = 0; }
|
||||||
|
void _yyerrok() { yysetskip(0); }
|
||||||
|
#endif
|
||||||
|
void yyexit(int exitcode) { yyexitflg = 1; yyexitcode = exitcode; }
|
||||||
|
void yyforceerror() { yythrowerror(0); }
|
||||||
|
int yypopping() const { return yypopflg; }
|
||||||
|
int yyrecovering() const { return yyskip > 0; }
|
||||||
|
void yyretire(int retirecode) { yyretireflg = 1; yyretirecode = retirecode; }
|
||||||
|
void yythrowerror(int pop) { yyerrorflg = 1; yyerrorpop = pop; }
|
||||||
|
|
||||||
|
// compatibility
|
||||||
|
int yycparse() { return yyparse(); }
|
||||||
|
int yycwork() { return yywork(); }
|
||||||
|
void yyparsecleanup() { yycleanup(); }
|
||||||
|
void yyparseinit() { /* do nothing */ }
|
||||||
|
#ifdef YY_COMPATIBLE
|
||||||
|
#define yyclearin _yyclearin()
|
||||||
|
#define yyerrok _yyerrok()
|
||||||
|
#endif
|
||||||
|
#define YYABORT yyexit(1)
|
||||||
|
#define YYACCEPT yyexit(0)
|
||||||
|
#define YYERROR yyforceerror()
|
||||||
|
#define YYRECOVERING yyrecovering()
|
||||||
|
|
||||||
|
// Tables
|
||||||
|
protected:
|
||||||
|
const yyreduction_t YYNEARFAR* yyreduction;
|
||||||
|
const yydestructor_t YYNEARFAR* yydestructorptr;
|
||||||
|
|
||||||
|
// Debugging
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
public:
|
||||||
|
int yydebug; // whether debug information should be output
|
||||||
|
int yydebugstack; // whether stack debug information should be output
|
||||||
|
int yydebugflush; // whether debug output should be flushed
|
||||||
|
FILE YYFAR* yydebugout; // debug output file
|
||||||
|
protected:
|
||||||
|
const yysymbol_t YYNEARFAR* yysymbol;
|
||||||
|
const char* const YYNEARFAR* yyrule;
|
||||||
|
|
||||||
|
// debugging functions
|
||||||
|
protected:
|
||||||
|
const char* yytokenstring(int token) const;
|
||||||
|
void yydgettoken(int token) const;
|
||||||
|
void yydshift(int token) const;
|
||||||
|
void yydreduce(int rule) const;
|
||||||
|
void yydsyntaxerror() const;
|
||||||
|
void yydaccept() const;
|
||||||
|
void yydabort() const;
|
||||||
|
void yyddiscard(int token) const;
|
||||||
|
void yydexit(int exitcode) const;
|
||||||
|
void yydthrowerror(int errorpop) const;
|
||||||
|
void yydretire(int retirecode) const;
|
||||||
|
void yydattemptrecovery() const;
|
||||||
|
void yydebugoutput(const char *string) const;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
class YYFAR yyfparser : public yyparser {
|
||||||
|
public:
|
||||||
|
yyfparser() { /* do nothing */ }
|
||||||
|
|
||||||
|
// Operations
|
||||||
|
public:
|
||||||
|
virtual int yywork();
|
||||||
|
virtual void yydestructclearin();
|
||||||
|
|
||||||
|
// Tables
|
||||||
|
protected:
|
||||||
|
const yystateaction_t YYNEARFAR* yystateaction;
|
||||||
|
const yytokenaction_t YYNEARFAR* yytokenaction;
|
||||||
|
int yytokenaction_size;
|
||||||
|
const yystategoto_t YYNEARFAR* yystategoto;
|
||||||
|
const yynontermgoto_t YYNEARFAR* yynontermgoto;
|
||||||
|
int yynontermgoto_size;
|
||||||
|
const yytokendest_t YYNEARFAR* yytokendestptr;
|
||||||
|
int yytokendest_size;
|
||||||
|
int yytokendestbase;
|
||||||
|
};
|
||||||
|
|
||||||
|
class YYFAR yycparser : public yyparser {
|
||||||
|
public:
|
||||||
|
yycparser() { /* do nothing */ }
|
||||||
|
|
||||||
|
// Operations
|
||||||
|
public:
|
||||||
|
virtual int yywork();
|
||||||
|
virtual void yydestructclearin();
|
||||||
|
|
||||||
|
// Tables
|
||||||
|
protected:
|
||||||
|
const yycstateaction_t YYNEARFAR* yycstateaction;
|
||||||
|
const yyctokenaction_t YYNEARFAR* yyctokenaction;
|
||||||
|
const yycstategoto_t YYNEARFAR* yycstategoto;
|
||||||
|
const yycnontermgoto_t YYNEARFAR* yycnontermgoto;
|
||||||
|
const yyctokendest_t YYNEARFAR* yyctokendestptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
// utility functions
|
||||||
|
#ifndef yyassert
|
||||||
|
#define yyassert(expr) assert(expr)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// debugging variables
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
extern "C" int YYNEAR YYDCDECL yydebug;
|
||||||
|
extern "C" int YYNEAR YYDCDECL yydebugstack;
|
||||||
|
extern "C" int YYNEAR YYDCDECL yydebugflush;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// user defines
|
||||||
|
#if defined(YYBUDEFS) || defined(YYUDEFS)
|
||||||
|
#include <yybudefs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// defines
|
||||||
|
#include <yybdefs.h>
|
||||||
|
|
||||||
|
#endif
|
259
Utils/Parser Generator/INCLUDE/lex.h
Normal file
259
Utils/Parser Generator/INCLUDE/lex.h
Normal file
|
@ -0,0 +1,259 @@
|
||||||
|
#ifndef LEX_H
|
||||||
|
#define LEX_H
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
lex.h
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
/* defines */
|
||||||
|
#include <yytdefs.h>
|
||||||
|
|
||||||
|
/* user defines */
|
||||||
|
#if defined(YYTUDEFS) || defined(YYUDEFS)
|
||||||
|
#include <yytudefs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define YY_ALEX
|
||||||
|
|
||||||
|
/* modifiers */
|
||||||
|
#ifndef YYCDECL
|
||||||
|
#define YYCDECL
|
||||||
|
#endif
|
||||||
|
#ifndef YYDCDECL
|
||||||
|
#define YYDCDECL
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEAR
|
||||||
|
#define YYNEAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYFAR
|
||||||
|
#define YYFAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEARFAR
|
||||||
|
#define YYNEARFAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYBASED_CODE
|
||||||
|
#define YYBASED_CODE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* function prototypes */
|
||||||
|
#ifndef YYPROTOTYPE
|
||||||
|
#if defined(__STDC__) || defined(__cplusplus)
|
||||||
|
#define YYPROTOTYPE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* qualifiers */
|
||||||
|
#ifndef YYCONST
|
||||||
|
#if defined(__STDC__) || defined(__cplusplus)
|
||||||
|
#define YYCONST const
|
||||||
|
#else
|
||||||
|
#define YYCONST
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* testing */
|
||||||
|
#ifdef YYNOPROTOTYPE
|
||||||
|
#undef YYPROTOTYPE
|
||||||
|
#endif
|
||||||
|
#ifdef YYNOCONST
|
||||||
|
#undef YYCONST
|
||||||
|
#define YYCONST
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* yylex return values */
|
||||||
|
#define YYEOF 0 /* end of file */
|
||||||
|
|
||||||
|
#ifndef YYSTATE_T
|
||||||
|
#define YYSTATE_T
|
||||||
|
typedef struct yystate {
|
||||||
|
short def; /* default state */
|
||||||
|
short base; /* base */
|
||||||
|
short match; /* action associated with state */
|
||||||
|
} yystate_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYTRANSITION_T
|
||||||
|
#define YYTRANSITION_T
|
||||||
|
typedef struct yytransition {
|
||||||
|
short next; /* next state on transition */
|
||||||
|
short check; /* check */
|
||||||
|
} yytransition_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYCTRANSITION_T
|
||||||
|
#define YYCTRANSITION_T
|
||||||
|
typedef struct yyctransition {
|
||||||
|
unsigned char first; /* first character in range */
|
||||||
|
unsigned char last; /* last character in range */
|
||||||
|
short next; /* next state on transition */
|
||||||
|
} yyctransition_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef short yymatch_t;
|
||||||
|
typedef unsigned char yybackup_t;
|
||||||
|
|
||||||
|
/* general functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yyclex(void);
|
||||||
|
int YYCDECL yylex(void);
|
||||||
|
void YYCDECL yylexcleanup(void);
|
||||||
|
void YYCDECL yylexinit(void);
|
||||||
|
void YYCDECL yyreset(void);
|
||||||
|
int YYCDECL yysettextsize(int size);
|
||||||
|
int YYCDECL yysetunputsize(int size);
|
||||||
|
#else
|
||||||
|
int YYCDECL yyclex();
|
||||||
|
int YYCDECL yylex();
|
||||||
|
void YYCDECL yylexcleanup();
|
||||||
|
void YYCDECL yylexinit();
|
||||||
|
void YYCDECL yyreset();
|
||||||
|
int YYCDECL yysettextsize();
|
||||||
|
int YYCDECL yysetunputsize();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* service functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yygetchar(void);
|
||||||
|
int YYCDECL yyinput(void);
|
||||||
|
void YYCDECL yyoutput(int ch);
|
||||||
|
void YYCDECL yytextoverflow(void);
|
||||||
|
void YYCDECL yyunput(int ch);
|
||||||
|
void YYCDECL yyunputoverflow(void);
|
||||||
|
int YYCDECL yywrap(void);
|
||||||
|
#else
|
||||||
|
int YYCDECL yygetchar();
|
||||||
|
int YYCDECL yyinput();
|
||||||
|
void YYCDECL yyoutput();
|
||||||
|
void YYCDECL yytextoverflow();
|
||||||
|
void YYCDECL yyunput();
|
||||||
|
void YYCDECL yyunputoverflow();
|
||||||
|
int YYCDECL yywrap();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* action functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yyecho(void);
|
||||||
|
void YYCDECL yyless(int length);
|
||||||
|
#else
|
||||||
|
void YYCDECL yyecho();
|
||||||
|
void YYCDECL yyless();
|
||||||
|
#endif
|
||||||
|
#define yybegin(state) (yystart = (state))
|
||||||
|
#define yymore() (yymoreflg = 1)
|
||||||
|
#define yynewline(newline) ((newline) ? yyeol = 1 : (yyeol = 0))
|
||||||
|
#define yyreject() (yyrejectflg = 1)
|
||||||
|
#define yyunputcount() yyunputindex
|
||||||
|
|
||||||
|
/* compatibility */
|
||||||
|
#define BEGIN yystart =
|
||||||
|
#define ECHO yyecho()
|
||||||
|
#define REJECT yyreject()
|
||||||
|
#define YYSTATE yystart
|
||||||
|
#define YY_START yystart
|
||||||
|
|
||||||
|
/* helper functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yyback(YYCONST yymatch_t YYNEARFAR *p, int action);
|
||||||
|
#else
|
||||||
|
int YYCDECL yyback();
|
||||||
|
#endif
|
||||||
|
#ifndef yyassert
|
||||||
|
#define yyassert(expr) assert(expr)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* variables */
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yymoreflg;
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yyrejectflg;
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yyreturnflg;
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yytextgrow;
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yyunputgrow;
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yyeol;
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yyoldeol;
|
||||||
|
extern int YYNEAR YYDCDECL yystart;
|
||||||
|
|
||||||
|
extern FILE YYFAR *YYNEAR YYDCDECL yyin;
|
||||||
|
extern FILE YYFAR *YYNEAR YYDCDECL yyout;
|
||||||
|
extern FILE YYFAR *YYNEAR YYDCDECL yylexerr;
|
||||||
|
|
||||||
|
extern int YYNEAR YYDCDECL yyleng;
|
||||||
|
extern int YYNEAR YYDCDECL yylineno;
|
||||||
|
extern int YYNEAR YYDCDECL yyunputindex;
|
||||||
|
|
||||||
|
/* debugging functions */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yydebugoutput(int ch);
|
||||||
|
void YYCDECL yydmatch(int expr);
|
||||||
|
void YYCDECL yylexdebugoutput(YYCONST char *string);
|
||||||
|
#else
|
||||||
|
void YYCDECL yydebugoutput();
|
||||||
|
void YYCDECL yydmatch();
|
||||||
|
void YYCDECL yylexdebugoutput();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* debugging variables */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
extern int YYNEAR YYDCDECL yydebug;
|
||||||
|
extern int YYNEAR YYDCDECL yydebugflush;
|
||||||
|
extern int YYNEAR YYDCDECL yylexdebug;
|
||||||
|
extern int YYNEAR YYDCDECL yylexdebugflush;
|
||||||
|
extern FILE YYFAR *YYNEAR YYDCDECL yylexdebugout;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* externally defined */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yylexaction(int action);
|
||||||
|
#else
|
||||||
|
int YYCDECL yylexaction();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern char YYFAR *YYNEAR YYDCDECL yytext;
|
||||||
|
extern char YYFAR *YYNEAR YYDCDECL yystext;
|
||||||
|
extern int YYNEAR YYDCDECL yytext_size;
|
||||||
|
extern int YYNEAR YYDCDECL yystext_size;
|
||||||
|
|
||||||
|
extern int YYFAR *YYNEAR YYDCDECL yystatebuf;
|
||||||
|
extern int YYFAR *YYNEAR YYDCDECL yysstatebuf;
|
||||||
|
|
||||||
|
/* unput buffer */
|
||||||
|
extern int YYFAR *YYNEAR YYDCDECL yyunputbufptr;
|
||||||
|
extern int YYFAR *YYNEAR YYDCDECL yysunputbufptr;
|
||||||
|
extern int YYNEAR YYDCDECL yyunput_size;
|
||||||
|
extern int YYNEAR YYDCDECL yysunput_size;
|
||||||
|
|
||||||
|
/* fast lexical analyser */
|
||||||
|
extern YYCONST yytransition_t YYNEARFAR YYDCDECL yytransition[];
|
||||||
|
extern int YYNEAR YYDCDECL yytransitionmax;
|
||||||
|
|
||||||
|
/* compact lexical analyser */
|
||||||
|
extern YYCONST yyctransition_t YYNEARFAR YYDCDECL yyctransition[];
|
||||||
|
|
||||||
|
extern YYCONST yymatch_t YYNEARFAR YYDCDECL yymatch[];
|
||||||
|
extern YYCONST yystate_t YYNEARFAR YYDCDECL yystate[];
|
||||||
|
extern YYCONST yybackup_t YYNEARFAR YYDCDECL yybackup[];
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* user defines */
|
||||||
|
#if defined(YYBUDEFS) || defined(YYUDEFS)
|
||||||
|
#include <yybudefs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* defines */
|
||||||
|
#include <yybdefs.h>
|
||||||
|
|
||||||
|
#endif
|
88
Utils/Parser Generator/INCLUDE/milconv.h
Normal file
88
Utils/Parser Generator/INCLUDE/milconv.h
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
#ifndef MILCONV_H
|
||||||
|
#define MILCONV_H
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
milconv.h
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
/* variables */
|
||||||
|
#define yymoreflg (yy)->yymmoreflg
|
||||||
|
#define yyrejectflg (yy)->yymrejectflg
|
||||||
|
#define yyreturnflg (yy)->yymreturnflg
|
||||||
|
#define yytextgrow (yy)->yymtextgrow
|
||||||
|
#define yyunputgrow (yy)->yymunputgrow
|
||||||
|
#define yyeol (yy)->yymeol
|
||||||
|
#define yyoldeol (yy)->yymoldeol
|
||||||
|
#define yystart (yy)->yymstart
|
||||||
|
#define yyin (yy)->yymin
|
||||||
|
#define yyout (yy)->yymout
|
||||||
|
#define yylexerr (yy)->yymerr
|
||||||
|
#define yyleng (yy)->yymleng
|
||||||
|
#define yylineno (yy)->yymlineno
|
||||||
|
#define yyunputindex (yy)->yymunputindex
|
||||||
|
#define yytext (yy)->yymtext
|
||||||
|
#define yystext (yy)->yymstext
|
||||||
|
#define yytext_size (yy)->yymtext_size
|
||||||
|
#define yystext_size (yy)->yymstext_size
|
||||||
|
#define yystatebuf (yy)->yymstatebuf
|
||||||
|
#define yysstatebuf (yy)->yymsstatebuf
|
||||||
|
#define yyunputbufptr (yy)->yymunputbufptr
|
||||||
|
#define yysunputbufptr (yy)->yymsunputbufptr
|
||||||
|
#define yyunput_size (yy)->yymunputbufptr
|
||||||
|
#define yysunput_size (yy)->yymsunput_size
|
||||||
|
#define yylexdebug (yy)->yymdebug
|
||||||
|
#define yylexdebugflush (yy)->yymdebugflush
|
||||||
|
#define yylexdebugout (yy)->yymdebugout
|
||||||
|
|
||||||
|
/* general functions */
|
||||||
|
#define yylexinit() yymlexinit(yy)
|
||||||
|
#define yylex() yymlex(yy)
|
||||||
|
#define yyclex() yymclex(yy)
|
||||||
|
#define yyreset() yymreset(yy)
|
||||||
|
#define yylexcleanup() yymlexcleanup(yy)
|
||||||
|
#define yysettextsize(size) yymsettextsize(yy, (size))
|
||||||
|
#define yysetunputsize(size) yymsetunputsize(yy, (size))
|
||||||
|
|
||||||
|
/* service functions */
|
||||||
|
#define yyinput() (*yy->yyminput)(yy)
|
||||||
|
#define yyoutput(ch) (*yy->yymoutput)(yy, (ch))
|
||||||
|
#define yyunput(ch) (*yy->yymunput)(yy, (ch))
|
||||||
|
#define yywrap() (*yy->yymwrap)(yy)
|
||||||
|
#define yygetchar() (*yy->yymgetchar)(yy)
|
||||||
|
#define yytextoverflow() (*yy->yymtextoverflow)(yy)
|
||||||
|
#define yyunputoverflow() (*yy->yymunputoverflow)(yy)
|
||||||
|
|
||||||
|
/* action functions */
|
||||||
|
#define yybegin(state) yymbegin(yy, (state))
|
||||||
|
#define yyecho() yymecho(yy)
|
||||||
|
#define yyless(length) yymless(yy, (length))
|
||||||
|
#define yymore() yymmore(yy)
|
||||||
|
#define yynewline(newline) yymnewline(yy, (newline))
|
||||||
|
#define yyreject() yymreject(yy)
|
||||||
|
#define yyunputcount() yymunputcount(yy)
|
||||||
|
|
||||||
|
/* compatibility */
|
||||||
|
#define ECHO yyecho()
|
||||||
|
#define REJECT yyreject()
|
||||||
|
#define BEGIN (yy)->yymstart =
|
||||||
|
#define YYSTATE (yy)->yymstart
|
||||||
|
#define YY_START (yy)->yymstart
|
||||||
|
|
||||||
|
#ifndef input
|
||||||
|
#define input() (*yy->yyminput)(yy)
|
||||||
|
#define YY_INPUT
|
||||||
|
#endif
|
||||||
|
#ifndef output
|
||||||
|
#define output(ch) (*yy->yymoutput)(yy, (ch))
|
||||||
|
#define YY_OUTPUT
|
||||||
|
#endif
|
||||||
|
#ifdef unput
|
||||||
|
#define unput(ch) (*yy->yymunput)(yy, (ch))
|
||||||
|
#define YY_UNPUT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
90
Utils/Parser Generator/INCLUDE/miyconv.h
Normal file
90
Utils/Parser Generator/INCLUDE/miyconv.h
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
#ifndef MIYCONV_H
|
||||||
|
#define MIYCONV_H
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
miyconv.h
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
/* variables */
|
||||||
|
#define yylookahead (yy)->yymlookahead
|
||||||
|
#define yystackgrow (yy)->yymstackgrow
|
||||||
|
#define yyexitflg (yy)->yymexitflg
|
||||||
|
#define yyretireflg (yy)->yymretireflg
|
||||||
|
#define yyerrorflg (yy)->yymerrorflg
|
||||||
|
#define yypopflg (yy)->yympopflg
|
||||||
|
#define yywipeflg (yy)->yymwipeflg
|
||||||
|
#define yytop (yy)->yymtop
|
||||||
|
#define yychar (yy)->yymchar
|
||||||
|
#define yyskip (yy)->yymskip
|
||||||
|
#define yyerrorcount (yy)->yymerrorcount
|
||||||
|
#define yyexitcode (yy)->yymexitcode
|
||||||
|
#define yyretirecode (yy)->yymretirecode
|
||||||
|
#define yyerrorpop (yy)->yymerrorpop
|
||||||
|
#define yyparseerr (yy)->yymerr
|
||||||
|
#define yystackptr (yy)->yymstackptr
|
||||||
|
#define yysstackptr (yy)->yymsstackptr
|
||||||
|
#define yystack_size (yy)->yymstack_size
|
||||||
|
#define yysstack_size (yy)->yymsstack_size
|
||||||
|
#define yyattribute_size (yy)->yymattribute_size
|
||||||
|
#define yyvalptr (yy)->yymvalptr
|
||||||
|
#define yylvalptr (yy)->yymlvalptr
|
||||||
|
#define yyattributestackptr (yy)->yymattributestackptr
|
||||||
|
#define yysattributestackptr (yy)->yymsattributestackptr
|
||||||
|
#define yyparsedebug (yy)->yymdebug
|
||||||
|
#define yyparsedebugstack (yy)->yymdebugstack
|
||||||
|
#define yyparsedebugflush (yy)->yymdebugflush
|
||||||
|
#define yyparsedebugout (yy)->yymdebugout
|
||||||
|
|
||||||
|
/* general functions */
|
||||||
|
#define yycparse() yymcparse(yy)
|
||||||
|
#define yycwipe() yymcwipe(yy)
|
||||||
|
#define yycwork() yymcwork(yy)
|
||||||
|
#define yydestructpop(num) yymdestructpop(yy, (pop))
|
||||||
|
#define yyparse() yymparse(yy)
|
||||||
|
#define yyparsecleanup() yymparsecleanup(yy)
|
||||||
|
#define yyparseinit() yymparseinit(yy)
|
||||||
|
#define yysetstacksize(size) yymsetstacksize(yy, (size))
|
||||||
|
#define yysetup() yymsetup(yy)
|
||||||
|
#define yywipe() yymwipe(yy)
|
||||||
|
#define yywork() yymwork(yy)
|
||||||
|
|
||||||
|
/* service functions */
|
||||||
|
#define yygettoken() (*yy->yymgettoken)(yy)
|
||||||
|
#define yystackoverflow() (*yy->yymstackoverflow)(yy)
|
||||||
|
#define yyerror(text) (*yy->yymerror)(yy, text)
|
||||||
|
#define yysyntaxerror() (*yy->yymsyntaxerror)(yy)
|
||||||
|
#define yydiscard() (*yy->yymdiscard)(yy)
|
||||||
|
|
||||||
|
/* action functions */
|
||||||
|
#define yycdestructclearin() yymcdestructclearin(yy)
|
||||||
|
#define yydestructclearin() yymdestructclearin(yy)
|
||||||
|
#define yysetin(token) yymsetin(yy, (token)
|
||||||
|
#define yyunclearin() yymunclearin(yy)
|
||||||
|
#define yyabort() yymabort(yy)
|
||||||
|
#define yyaccept() yymaccept(yy)
|
||||||
|
#define yyclearin() yymclearin(yy)
|
||||||
|
#define yydestructclearin() yymdestructclearin(yy)
|
||||||
|
#define yyerrok() yymerrok(yy)
|
||||||
|
#define yyexit(exitcode) yymexit(yy, (exitcode))
|
||||||
|
#define yyforceerror() yymforceerror(yy)
|
||||||
|
#define yypopping() yympopping(yy)
|
||||||
|
#define yyrecovering() yymrecovering(yy)
|
||||||
|
#define yyretire(retirecode) yymretire(yy, (retirecode))
|
||||||
|
#define yythrowerror(pop) yymthrowerror(yy, (pop))
|
||||||
|
|
||||||
|
#ifdef YY_COMPATIBLE
|
||||||
|
#undef yyerrok
|
||||||
|
#define yyerrok yymerrok(yy)
|
||||||
|
#undef yyclearin
|
||||||
|
#define yyclearin yymclearin(yy)
|
||||||
|
#endif
|
||||||
|
#define YYACCEPT yymaccept(yy)
|
||||||
|
#define YYABORT yymabort(yy)
|
||||||
|
#define YYERROR yymforceerror(yy)
|
||||||
|
#define YYRECOVERING yymrecovering(yy)
|
||||||
|
|
||||||
|
#endif
|
88
Utils/Parser Generator/INCLUDE/mlconv.h
Normal file
88
Utils/Parser Generator/INCLUDE/mlconv.h
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
#ifndef MLCONV_H
|
||||||
|
#define MLCONV_H
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
mlconv.h
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
/* variables */
|
||||||
|
#define yymoreflg (YYLEXNAME).yymmoreflg
|
||||||
|
#define yyrejectflg (YYLEXNAME).yymrejectflg
|
||||||
|
#define yyreturnflg (YYLEXNAME).yymreturnflg
|
||||||
|
#define yytextgrow (YYLEXNAME).yymtextgrow
|
||||||
|
#define yyunputgrow (YYLEXNAME).yymunputgrow
|
||||||
|
#define yyeol (YYLEXNAME).yymeol
|
||||||
|
#define yyoldeol (YYLEXNAME).yymoldeol
|
||||||
|
#define yystart (YYLEXNAME).yymstart
|
||||||
|
#define yyin (YYLEXNAME).yymin
|
||||||
|
#define yyout (YYLEXNAME).yymout
|
||||||
|
#define yylexerr (YYLEXNAME).yymerr
|
||||||
|
#define yyleng (YYLEXNAME).yymleng
|
||||||
|
#define yylineno (YYLEXNAME).yymlineno
|
||||||
|
#define yyunputindex (YYLEXNAME).yymunputindex
|
||||||
|
#define yytext (YYLEXNAME).yymtext
|
||||||
|
#define yystext (YYLEXNAME).yymstext
|
||||||
|
#define yytext_size (YYLEXNAME).yymtext_size
|
||||||
|
#define yystext_size (YYLEXNAME).yymstext_size
|
||||||
|
#define yystatebuf (YYLEXNAME).yymstatebuf
|
||||||
|
#define yysstatebuf (YYLEXNAME).yymsstatebuf
|
||||||
|
#define yyunputbufptr (YYLEXNAME).yymunputbufptr
|
||||||
|
#define yysunputbufptr (YYLEXNAME).yymsunputbufptr
|
||||||
|
#define yyunput_size (YYLEXNAME).yymunputbufptr
|
||||||
|
#define yysunput_size (YYLEXNAME).yymsunput_size
|
||||||
|
#define yylexdebug (YYLEXNAME).yymdebug
|
||||||
|
#define yylexdebugflush (YYLEXNAME).yymdebugflush
|
||||||
|
#define yylexdebugout (YYLEXNAME).yymdebugout
|
||||||
|
|
||||||
|
/* general functions */
|
||||||
|
#define yylexinit() yymlexinit(&(YYLEXNAME))
|
||||||
|
#define yylex() yymlex(&(YYLEXNAME))
|
||||||
|
#define yyclex() yymclex(&(YYLEXNAME))
|
||||||
|
#define yyreset() yymreset(&(YYLEXNAME))
|
||||||
|
#define yylexcleanup() yymlexcleanup(&(YYLEXNAME))
|
||||||
|
#define yysettextsize(size) yymsettextsize(&(YYLEXNAME), (size))
|
||||||
|
#define yysetunputsize(size) yymsetunputsize(&(YYLEXNAME), (size))
|
||||||
|
|
||||||
|
/* service functions */
|
||||||
|
#define yyinput() (*(YYLEXNAME).yyminput)(&(YYLEXNAME))
|
||||||
|
#define yyoutput(ch) (*(YYLEXNAME).yymoutput)(&(YYLEXNAME), (ch))
|
||||||
|
#define yyunput(ch) (*(YYLEXNAME).yymunput)(&(YYLEXNAME), (ch))
|
||||||
|
#define yywrap() (*(YYLEXNAME).yymwrap)(&(YYLEXNAME))
|
||||||
|
#define yygetchar() (*(YYLEXNAME).yymgetchar)(&(YYLEXNAME))
|
||||||
|
#define yytextoverflow() (*(YYLEXNAME).yymtextoverflow)(&(YYLEXNAME))
|
||||||
|
#define yyunputoverflow() (*(YYLEXNAME).yymunputoverflow)(&(YYLEXNAME))
|
||||||
|
|
||||||
|
/* action functions */
|
||||||
|
#define yybegin(state) yymbegin(&(YYLEXNAME), (state))
|
||||||
|
#define yyecho() yymecho(&(YYLEXNAME))
|
||||||
|
#define yyless(length) yymless(&(YYLEXNAME), (length))
|
||||||
|
#define yymore() yymmore(&(YYLEXNAME))
|
||||||
|
#define yynewline(newline) yymnewline(&(YYLEXNAME), (newline))
|
||||||
|
#define yyreject() yymreject(&(YYLEXNAME))
|
||||||
|
#define yyunputcount() yymunputcount(&(YYLEXNAME))
|
||||||
|
|
||||||
|
/* compatibility */
|
||||||
|
#define ECHO yyecho()
|
||||||
|
#define REJECT yyreject()
|
||||||
|
#define BEGIN (YYLEXNAME).yymstart =
|
||||||
|
#define YYSTATE (YYLEXNAME).yymstart
|
||||||
|
#define YY_START (YYLEXNAME).yymstart
|
||||||
|
|
||||||
|
#ifndef input
|
||||||
|
#define input() (*(YYLEXNAME)->yyminput)(&(YYLEXNAME))
|
||||||
|
#define YY_INPUT
|
||||||
|
#endif
|
||||||
|
#ifndef output
|
||||||
|
#define output(ch) (*(YYLEXNAME)->yymoutput)(&(YYLEXNAME), (ch))
|
||||||
|
#define YY_OUTPUT
|
||||||
|
#endif
|
||||||
|
#ifdef unput
|
||||||
|
#define unput(ch) (*(YYLEXNAME)->yymunput)(&(YYLEXNAME), (ch))
|
||||||
|
#define YY_UNPUT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
287
Utils/Parser Generator/INCLUDE/mlex.h
Normal file
287
Utils/Parser Generator/INCLUDE/mlex.h
Normal file
|
@ -0,0 +1,287 @@
|
||||||
|
#ifndef MLEX_H
|
||||||
|
#define MLEX_H
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
mlex.h
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
/* defines */
|
||||||
|
#include <yytdefs.h>
|
||||||
|
|
||||||
|
/* user defines */
|
||||||
|
#if defined(YYTUDEFS) || defined(YYUDEFS)
|
||||||
|
#include <yytudefs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define YY_ALEX
|
||||||
|
|
||||||
|
/* modifiers */
|
||||||
|
#ifndef YYCDECL
|
||||||
|
#define YYCDECL
|
||||||
|
#endif
|
||||||
|
#ifndef YYDCDECL
|
||||||
|
#define YYDCDECL
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEAR
|
||||||
|
#define YYNEAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYFAR
|
||||||
|
#define YYFAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEARFAR
|
||||||
|
#define YYNEARFAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYBASED_CODE
|
||||||
|
#define YYBASED_CODE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* function prototypes */
|
||||||
|
#ifndef YYPROTOTYPE
|
||||||
|
#if defined(__STDC__) || defined(__cplusplus)
|
||||||
|
#define YYPROTOTYPE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* qualifiers */
|
||||||
|
#ifndef YYCONST
|
||||||
|
#if defined(__STDC__) || defined(__cplusplus)
|
||||||
|
#define YYCONST const
|
||||||
|
#else
|
||||||
|
#define YYCONST
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* testing */
|
||||||
|
#ifdef YYNOPROTOTYPE
|
||||||
|
#undef YYPROTOTYPE
|
||||||
|
#endif
|
||||||
|
#ifdef YYNOCONST
|
||||||
|
#undef YYCONST
|
||||||
|
#define YYCONST
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* yylex return values */
|
||||||
|
#define YYEOF 0 /* end of file */
|
||||||
|
|
||||||
|
#ifndef YYSTATE_T
|
||||||
|
#define YYSTATE_T
|
||||||
|
typedef struct yystate {
|
||||||
|
short def; /* default state */
|
||||||
|
short base; /* base */
|
||||||
|
short match; /* action associated with state */
|
||||||
|
} yystate_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYTRANSITION_T
|
||||||
|
#define YYTRANSITION_T
|
||||||
|
typedef struct yytransition {
|
||||||
|
short next; /* next state on transition */
|
||||||
|
short check; /* check */
|
||||||
|
} yytransition_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYCTRANSITION_T
|
||||||
|
#define YYCTRANSITION_T
|
||||||
|
typedef struct yyctransition {
|
||||||
|
unsigned char first; /* first character in range */
|
||||||
|
unsigned char last; /* last character in range */
|
||||||
|
short next; /* next state on transition */
|
||||||
|
} yyctransition_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef short yymatch_t;
|
||||||
|
typedef unsigned char yybackup_t;
|
||||||
|
|
||||||
|
typedef struct yymlex {
|
||||||
|
/* flags */
|
||||||
|
unsigned char yymmoreflg; /* concatenate matched strings */
|
||||||
|
unsigned char yymrejectflg; /* yyreject called from an action */
|
||||||
|
unsigned char yymreturnflg; /* return from an action */
|
||||||
|
unsigned char yymtextgrow; /* whether text buffer is allowed to grow */
|
||||||
|
unsigned char yymunputgrow; /* whether unput buffer is allowed to grow */
|
||||||
|
unsigned char yymeol; /* whether an end-of-line '\n' has been seen */
|
||||||
|
unsigned char yymoldeol; /* previous end-of-line value */
|
||||||
|
int yymstart; /* current start state */
|
||||||
|
|
||||||
|
/* streams */
|
||||||
|
FILE YYFAR *yymin; /* input text stream */
|
||||||
|
FILE YYFAR *yymout; /* output text stream */
|
||||||
|
FILE YYFAR *yymerr; /* error stream */
|
||||||
|
|
||||||
|
int yymleng; /* matched string length */
|
||||||
|
int yymlineno; /* current line number */
|
||||||
|
int yymunputindex; /* unput buffer position */
|
||||||
|
|
||||||
|
char YYFAR *yymtext; /* text buffer */
|
||||||
|
char YYFAR *yymstext; /* initial (static) text buffer */
|
||||||
|
int yymtext_size; /* text buffer size */
|
||||||
|
int yymstext_size; /* initial (static) text buffer size */
|
||||||
|
|
||||||
|
int YYFAR *yymstatebuf; /* state buffer */
|
||||||
|
int YYFAR *yymsstatebuf; /* initial (static) state buffer */
|
||||||
|
|
||||||
|
/* unput buffer */
|
||||||
|
int YYFAR *yymunputbufptr; /* unput buffer */
|
||||||
|
int YYFAR *yymsunputbufptr; /* initial (static) unput buffer */
|
||||||
|
int yymunput_size; /* unput buffer size */
|
||||||
|
int yymsunput_size; /* initial (static) unput buffer size */
|
||||||
|
|
||||||
|
/* functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int (YYCDECL *yyminput)(struct yymlex YYFAR *yy);
|
||||||
|
void (YYCDECL *yymoutput)(struct yymlex YYFAR *yy, int ch);
|
||||||
|
void (YYCDECL *yymunput)(struct yymlex YYFAR *yy, int ch);
|
||||||
|
int (YYCDECL *yymwrap)(struct yymlex YYFAR *yy);
|
||||||
|
int (YYCDECL *yymgetchar)(struct yymlex YYFAR *yy);
|
||||||
|
void (YYCDECL *yymtextoverflow)(struct yymlex YYFAR *yy);
|
||||||
|
void (YYCDECL *yymunputoverflow)(struct yymlex YYFAR *yy);
|
||||||
|
int (YYCDECL *yymlexaction)(struct yymlex YYFAR *yy, int action);
|
||||||
|
#else
|
||||||
|
int (YYCDECL *yyminput)();
|
||||||
|
void (YYCDECL *yymoutput)();
|
||||||
|
void (YYCDECL *yymunput)();
|
||||||
|
int (YYCDECL *yymwrap)();
|
||||||
|
int (YYCDECL *yymgetchar)();
|
||||||
|
void (YYCDECL *yymtextoverflow)();
|
||||||
|
void (YYCDECL *yymunputoverflow)();
|
||||||
|
int (YYCDECL *yymlexaction)();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* tables */
|
||||||
|
/* fast lexical analyser */
|
||||||
|
YYCONST yytransition_t YYNEARFAR *yymtransition;
|
||||||
|
int yymtransitionmax;
|
||||||
|
/* compact lexical analyser */
|
||||||
|
YYCONST yyctransition_t YYNEARFAR *yymctransition;
|
||||||
|
/* common */
|
||||||
|
YYCONST yymatch_t YYNEARFAR *yymmatch;
|
||||||
|
YYCONST yystate_t YYNEARFAR *yymstate;
|
||||||
|
YYCONST yybackup_t YYNEARFAR *yymbackup;
|
||||||
|
|
||||||
|
void YYFAR *yymdata; /* user data */
|
||||||
|
|
||||||
|
/* debugging */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
int yymdebug;
|
||||||
|
int yymdebugflush;
|
||||||
|
FILE YYFAR *yymdebugout;
|
||||||
|
#endif
|
||||||
|
} yymlex_t;
|
||||||
|
|
||||||
|
/* instance functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymcreatelex(yymlex_t YYFAR *yy, YYCONST yymlex_t YYFAR *src);
|
||||||
|
void YYCDECL yymdestroylex(yymlex_t YYFAR *yy);
|
||||||
|
#else
|
||||||
|
int YYCDECL yymcreatelex();
|
||||||
|
void YYCDECL yymdestroylex();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* general functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymclex(yymlex_t YYFAR *yy);
|
||||||
|
int YYCDECL yymlex(yymlex_t YYFAR *yy);
|
||||||
|
void YYCDECL yymlexcleanup(yymlex_t YYFAR *yy);
|
||||||
|
void YYCDECL yymlexinit(yymlex_t YYFAR *yy);
|
||||||
|
void YYCDECL yymreset(yymlex_t YYFAR *yy);
|
||||||
|
int YYCDECL yymsettextsize(yymlex_t YYFAR *yy, int size);
|
||||||
|
int YYCDECL yymsetunputsize(yymlex_t YYFAR *yy, int size);
|
||||||
|
#else
|
||||||
|
int YYCDECL yymclex();
|
||||||
|
int YYCDECL yymlex();
|
||||||
|
void YYCDECL yymlexcleanup();
|
||||||
|
void YYCDECL yymlexinit();
|
||||||
|
void YYCDECL yymreset();
|
||||||
|
int YYCDECL yymsettextsize();
|
||||||
|
int YYCDECL yymsetunputsize();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* service functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymgetchar(yymlex_t YYFAR *yy);
|
||||||
|
int YYCDECL yyminput(yymlex_t YYFAR *yy);
|
||||||
|
void YYCDECL yymoutput(yymlex_t YYFAR *yy, int ch);
|
||||||
|
void YYCDECL yymtextoverflow(yymlex_t YYFAR *yy);
|
||||||
|
void YYCDECL yymunput(yymlex_t YYFAR *yy, int ch);
|
||||||
|
void YYCDECL yymunputoverflow(yymlex_t YYFAR *yy);
|
||||||
|
int YYCDECL yymwrap(yymlex_t YYFAR *yy);
|
||||||
|
#else
|
||||||
|
int YYCDECL yymgetchar();
|
||||||
|
int YYCDECL yyminput();
|
||||||
|
void YYCDECL yymoutput();
|
||||||
|
void YYCDECL yymtextoverflow();
|
||||||
|
void YYCDECL yymunput();
|
||||||
|
void YYCDECL yymunputoverflow();
|
||||||
|
int YYCDECL yymwrap();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* action functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymecho(yymlex_t YYFAR *yy);
|
||||||
|
void YYCDECL yymless(yymlex_t YYFAR *yy, int length);
|
||||||
|
#else
|
||||||
|
void YYCDECL yymecho();
|
||||||
|
void YYCDECL yymless();
|
||||||
|
#endif
|
||||||
|
#define yymbegin(yy, state) ((yy)->yymstart = (state))
|
||||||
|
#define yymmore(yy) ((yy)->yymmoreflg = 1)
|
||||||
|
#define yymnewline(yy, newline) ((newline) ? (yy)->yymeol = 1 : ((yy)->yymeol = 0))
|
||||||
|
#define yymreject(yy) ((yy)->yymrejectflg = 1)
|
||||||
|
#define yymunputcount(yy) (yy)->yymunputindex
|
||||||
|
|
||||||
|
/* helper functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymback(YYCONST yymatch_t YYNEARFAR *p, int action);
|
||||||
|
#else
|
||||||
|
int YYCDECL yymback();
|
||||||
|
#endif
|
||||||
|
#ifndef yyassert
|
||||||
|
#define yyassert(expr) assert(expr)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* debugging functions */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymdebugoutput(yymlex_t YYFAR *yy, int ch);
|
||||||
|
void YYCDECL yymdmatch(yymlex_t YYFAR *yy, int expr);
|
||||||
|
void YYCDECL yymlexdebugoutput(yymlex_t YYFAR *yy, YYCONST char *string);
|
||||||
|
#else
|
||||||
|
void YYCDECL yymdebugoutput();
|
||||||
|
void YYCDECL yymdmatch();
|
||||||
|
void YYCDECL yymlexdebugoutput();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define yymisfastlexer(yy) ((yy)->yymtransition != NULL)
|
||||||
|
#define yymiscompactlexer(yy) ((yy)->yymctransition != NULL)
|
||||||
|
|
||||||
|
/* debugging variables */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
extern int YYNEAR YYDCDECL yydebug;
|
||||||
|
extern int YYNEAR YYDCDECL yydebugflush;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* user defines */
|
||||||
|
#if defined(YYBUDEFS) || defined(YYUDEFS)
|
||||||
|
#include <yybudefs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* defines */
|
||||||
|
#include <yybdefs.h>
|
||||||
|
|
||||||
|
#endif
|
436
Utils/Parser Generator/INCLUDE/myacc.h
Normal file
436
Utils/Parser Generator/INCLUDE/myacc.h
Normal file
|
@ -0,0 +1,436 @@
|
||||||
|
#ifndef MYACC_H
|
||||||
|
#define MYACC_H
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
myacc.h
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
/* defines */
|
||||||
|
#include <yytdefs.h>
|
||||||
|
|
||||||
|
/* user defines */
|
||||||
|
#if defined(YYTUDEFS) || defined(YYUDEFS)
|
||||||
|
#include <yytudefs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define YY_AYACC
|
||||||
|
|
||||||
|
/* modifiers */
|
||||||
|
#ifndef YYCDECL
|
||||||
|
#define YYCDECL
|
||||||
|
#endif
|
||||||
|
#ifndef YYDCDECL
|
||||||
|
#define YYDCDECL
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEAR
|
||||||
|
#define YYNEAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYFAR
|
||||||
|
#define YYFAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEARFAR
|
||||||
|
#define YYNEARFAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYBASED_CODE
|
||||||
|
#define YYBASED_CODE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* function prototypes */
|
||||||
|
#ifndef YYPROTOTYPE
|
||||||
|
#if defined(__STDC__) || defined(__cplusplus)
|
||||||
|
#define YYPROTOTYPE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* qualifiers */
|
||||||
|
#ifndef YYCONST
|
||||||
|
#if defined(__STDC__) || defined(__cplusplus)
|
||||||
|
#define YYCONST const
|
||||||
|
#else
|
||||||
|
#define YYCONST
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* testing */
|
||||||
|
#ifdef YYNOPROTOTYPE
|
||||||
|
#undef YYPROTOTYPE
|
||||||
|
#endif
|
||||||
|
#ifdef YYNOCONST
|
||||||
|
#undef YYCONST
|
||||||
|
#define YYCONST
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef short yystack_t;
|
||||||
|
|
||||||
|
/* yyparse return values */
|
||||||
|
#define YYEXIT_SUCCESS 0
|
||||||
|
#define YYEXIT_FAILURE 1
|
||||||
|
|
||||||
|
/* common tokens */
|
||||||
|
#define YYTK_ALL (-1) /* match all tokens */
|
||||||
|
#define YYTK_END 0 /* $end token */
|
||||||
|
#define YYTK_ERROR 256 /* error token */
|
||||||
|
|
||||||
|
#ifndef YYCSTATEGOTO_T
|
||||||
|
#define YYCSTATEGOTO_T
|
||||||
|
typedef short yycstategoto_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYCNONTERMGOTO_T
|
||||||
|
#define YYCNONTERMGOTO_T
|
||||||
|
typedef struct yycnontermgoto {
|
||||||
|
short nonterm; /* nonterminal */
|
||||||
|
short next; /* next state */
|
||||||
|
} yycnontermgoto_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYSTATEGOTO_T
|
||||||
|
#define YYSTATEGOTO_T
|
||||||
|
typedef struct yystategoto {
|
||||||
|
short base; /* base */
|
||||||
|
short def; /* default state */
|
||||||
|
} yystategoto_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYNONTERMGOTO_T
|
||||||
|
#define YYNONTERMGOTO_T
|
||||||
|
typedef struct yynontermgoto {
|
||||||
|
short check; /* check */
|
||||||
|
short next; /* next state */
|
||||||
|
} yynontermgoto_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* action types */
|
||||||
|
#define YYAT_SHIFT 0 /* shift action */
|
||||||
|
#define YYAT_REDUCE 1 /* reduce action */
|
||||||
|
#define YYAT_ERROR 2 /* error */
|
||||||
|
#define YYAT_ACCEPT 3 /* accept */
|
||||||
|
#define YYAT_DEFAULT 4 /* default state */
|
||||||
|
|
||||||
|
#ifndef YYCSTATEACTION_T
|
||||||
|
#define YYCSTATEACTION_T
|
||||||
|
typedef short yycstateaction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYCTOKENACTION_T
|
||||||
|
#define YYCTOKENACTION_T
|
||||||
|
typedef struct yyctokenaction {
|
||||||
|
int token; /* lookahead token */
|
||||||
|
unsigned char type; /* action to perform */
|
||||||
|
short sr; /* state to shift/production to reduce */
|
||||||
|
} yyctokenaction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYSTATEACTION_T
|
||||||
|
#define YYSTATEACTION_T
|
||||||
|
typedef struct yystateaction {
|
||||||
|
short base; /* base */
|
||||||
|
unsigned char lookahead; /* lookahead needed */
|
||||||
|
unsigned char type; /* action to perform */
|
||||||
|
short sr; /* shift/reduce */
|
||||||
|
} yystateaction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYTOKENACTION_T
|
||||||
|
#define YYTOKENACTION_T
|
||||||
|
typedef struct yytokenaction {
|
||||||
|
short check; /* check */
|
||||||
|
unsigned char type; /* action type */
|
||||||
|
short sr; /* shift/reduce */
|
||||||
|
} yytokenaction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* nonterminals */
|
||||||
|
#define YYST_ALL (-1) /* match all states */
|
||||||
|
|
||||||
|
/* states */
|
||||||
|
#define YYST_ERROR (-1) /* goto error */
|
||||||
|
|
||||||
|
#ifndef YYREDUCTION_T
|
||||||
|
#define YYREDUCTION_T
|
||||||
|
typedef struct yyreduction {
|
||||||
|
short nonterm; /* the rhs symbol */
|
||||||
|
short length; /* number of symbols on lhs */
|
||||||
|
short action; /* the user action */
|
||||||
|
} yyreduction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef short yydestructor_t;
|
||||||
|
|
||||||
|
typedef short yytokendest_t;
|
||||||
|
|
||||||
|
#ifndef YYCTOKENDEST_T
|
||||||
|
#define YYCTOKENDEST_T
|
||||||
|
typedef struct yyctokendest {
|
||||||
|
int token; /* token */
|
||||||
|
short action; /* the user action */
|
||||||
|
} yyctokendest_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* debugging */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
#ifndef YYSYMBOL_T
|
||||||
|
#define YYSYMBOL_T
|
||||||
|
typedef struct yysymbol {
|
||||||
|
YYCONST char *name; /* symbol name */
|
||||||
|
int token; /* symbol token */
|
||||||
|
} yysymbol_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct yymparse {
|
||||||
|
/* flags */
|
||||||
|
unsigned char yymlookahead; /* whether current lookahead token is valid */
|
||||||
|
unsigned char yymstackgrow; /* whether stack can grow */
|
||||||
|
unsigned char yymexitflg; /* whether yymexit called */
|
||||||
|
unsigned char yymretireflg; /* whether yymretire called */
|
||||||
|
unsigned char yymerrorflg; /* whether yymforceerror called */
|
||||||
|
unsigned char yympopflg; /* popping symbols during error recovery */
|
||||||
|
unsigned char yymwipeflg; /* whether to "wipe" stack on abort */
|
||||||
|
|
||||||
|
int yymtop; /* the current top of the stack */
|
||||||
|
int yymchar; /* current lookahead token */
|
||||||
|
int yymskip; /* error recovery token shift counter */
|
||||||
|
int yymerrorcount; /* how many syntax errors have occurred */
|
||||||
|
int yymexitcode; /* yymexit exit code */
|
||||||
|
int yymretirecode; /* yymretire exit code */
|
||||||
|
int yymerrorpop; /* how many error transitions to pop */
|
||||||
|
FILE YYFAR *yymerr; /* error output file */
|
||||||
|
|
||||||
|
/* stack */
|
||||||
|
yystack_t YYFAR *yymstackptr; /* (state) stack */
|
||||||
|
yystack_t YYFAR *yymsstackptr; /* static (state) stack */
|
||||||
|
int yymstack_size; /* number of elements in stack */
|
||||||
|
int yymsstack_size; /* initial number of elements in stack */
|
||||||
|
|
||||||
|
size_t yymattribute_size; /* size of attribute */
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYFAR *yymvalptr; /* attribute for $$ */
|
||||||
|
void YYFAR *yymlvalptr; /* current token attribute */
|
||||||
|
void YYFAR *yymattributestackptr; /* attribute stack */
|
||||||
|
void YYFAR *yymsattributestackptr; /* static attribute stack */
|
||||||
|
#else
|
||||||
|
char YYFAR *yymvalptr; /* attribute for $$ */
|
||||||
|
char YYFAR *yymlvalptr; /* current token attribute */
|
||||||
|
char YYFAR *yymattributestackptr; /* attribute stack */
|
||||||
|
char YYFAR *yymsattributestackptr; /* static attribute stack */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* service functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void (YYCDECL *yymstackoverflow)(struct yymparse YYFAR *yy);
|
||||||
|
void (YYCDECL *yymerror)(struct yymparse YYFAR *yy, YYCONST char YYFAR *text);
|
||||||
|
void (YYCDECL *yymsyntaxerror)(struct yymparse YYFAR *yy);
|
||||||
|
void (YYCDECL *yymdiscard)(struct yymparse YYFAR *yy, int token);
|
||||||
|
int (YYCDECL *yymgettoken)(struct yymparse YYFAR *yy);
|
||||||
|
void (YYCDECL *yymparseaction)(struct yymparse YYFAR *yy, int action);
|
||||||
|
#else
|
||||||
|
void (YYCDECL *yymstackoverflow)();
|
||||||
|
void (YYCDECL *yymerror)();
|
||||||
|
void (YYCDECL *yymsyntaxerror)();
|
||||||
|
void (YYCDECL *yymdiscard)();
|
||||||
|
int (YYCDECL *yymgettoken)();
|
||||||
|
void (YYCDECL *yymparseaction)();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* tables */
|
||||||
|
/* fast parser */
|
||||||
|
YYCONST yystateaction_t YYNEARFAR *yymstateaction;
|
||||||
|
YYCONST yytokenaction_t YYNEARFAR *yymtokenaction;
|
||||||
|
int yymtokenaction_size;
|
||||||
|
YYCONST yystategoto_t YYNEARFAR *yymstategoto;
|
||||||
|
YYCONST yynontermgoto_t YYNEARFAR *yymnontermgoto;
|
||||||
|
int yymnontermgoto_size;
|
||||||
|
YYCONST yytokendest_t YYNEARFAR *yymtokendestptr;
|
||||||
|
int yymtokendest_size;
|
||||||
|
int yymtokendestbase;
|
||||||
|
/* compact parser */
|
||||||
|
YYCONST yycstateaction_t YYNEARFAR *yymcstateaction;
|
||||||
|
YYCONST yyctokenaction_t YYNEARFAR *yymctokenaction;
|
||||||
|
YYCONST yycstategoto_t YYNEARFAR *yymcstategoto;
|
||||||
|
YYCONST yycnontermgoto_t YYNEARFAR *yymcnontermgoto;
|
||||||
|
YYCONST yyctokendest_t YYNEARFAR *yymctokendestptr;
|
||||||
|
/* common */
|
||||||
|
YYCONST yyreduction_t YYNEARFAR *yymreduction;
|
||||||
|
|
||||||
|
YYCONST yydestructor_t YYNEARFAR *yymdestructorptr;
|
||||||
|
|
||||||
|
void YYFAR *yymdata; /* user data */
|
||||||
|
|
||||||
|
/* debugging */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
int yymdebug;
|
||||||
|
int yymdebugstack;
|
||||||
|
int yymdebugflush;
|
||||||
|
FILE YYFAR *yymdebugout;
|
||||||
|
YYCONST yysymbol_t YYNEARFAR *yymsymbol;
|
||||||
|
YYCONST char *YYCONST YYNEARFAR *yymrule;
|
||||||
|
#endif
|
||||||
|
} yymparse_t;
|
||||||
|
|
||||||
|
/* instance functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymcreateparse(yymparse_t YYFAR *yy, YYCONST yymparse_t YYFAR *src);
|
||||||
|
void YYCDECL yymdestroyparse(yymparse_t YYFAR *yy);
|
||||||
|
#else
|
||||||
|
int YYCDECL yymcreateparse();
|
||||||
|
void YYCDECL yymdestroyparse();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* general functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymcparse(yymparse_t YYFAR *yy);
|
||||||
|
void YYCDECL yymcwipe(yymparse_t YYFAR *yy);
|
||||||
|
int YYCDECL yymcwork(yymparse_t YYFAR *yy);
|
||||||
|
void YYCDECL yymdestructpop(yymparse_t YYFAR *yy, int num);
|
||||||
|
int YYCDECL yymparse(yymparse_t YYFAR *yy);
|
||||||
|
void YYCDECL yymparsecleanup(yymparse_t YYFAR *yy);
|
||||||
|
void YYCDECL yymparseinit(yymparse_t YYFAR *yy);
|
||||||
|
int YYCDECL yymsetstacksize(yymparse_t YYFAR *yy, int size);
|
||||||
|
int YYCDECL yymsetup(yymparse_t YYFAR *yy);
|
||||||
|
void YYCDECL yymwipe(yymparse_t YYFAR *yy);
|
||||||
|
int YYCDECL yymwork(yymparse_t YYFAR *yy);
|
||||||
|
#else
|
||||||
|
int YYCDECL yymcparse();
|
||||||
|
void YYCDECL yymcwipe();
|
||||||
|
int YYCDECL yymcwork();
|
||||||
|
void YYCDECL yymdestructpop();
|
||||||
|
int YYCDECL yymparse();
|
||||||
|
void YYCDECL yymparsecleanup();
|
||||||
|
void YYCDECL yymparseinit();
|
||||||
|
int YYCDECL yymsetstacksize();
|
||||||
|
int YYCDECL yymsetup();
|
||||||
|
void YYCDECL yymwipe();
|
||||||
|
int YYCDECL yymwork();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* service functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymdiscard(yymparse_t YYFAR *yy, int token);
|
||||||
|
void YYCDECL yymerror(yymparse_t YYFAR *yy, YYCONST char YYFAR *text);
|
||||||
|
int YYCDECL yymgettoken(yymparse_t YYFAR *yy);
|
||||||
|
void YYCDECL yymstackoverflow(yymparse_t YYFAR *yy);
|
||||||
|
void YYCDECL yymsyntaxerror(yymparse_t YYFAR *yy);
|
||||||
|
#else
|
||||||
|
void YYCDECL yymdiscard();
|
||||||
|
void YYCDECL yymerror();
|
||||||
|
int YYCDECL yymgettoken();
|
||||||
|
void YYCDECL yymstackoverflow();
|
||||||
|
void YYCDECL yymsyntaxerror();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* action functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymcdestructclearin(yymparse_t YYFAR *yy);
|
||||||
|
void YYCDECL yymdestructclearin(yymparse_t YYFAR *yy);
|
||||||
|
void YYCDECL yymsetin(yymparse_t YYFAR *yy, int token);
|
||||||
|
int YYCDECL yymunclearin(yymparse_t YYFAR *yy);
|
||||||
|
#else
|
||||||
|
void YYCDECL yymcdestructclearin();
|
||||||
|
void YYCDECL yymdestructclearin();
|
||||||
|
void YYCDECL yymsetin();
|
||||||
|
int YYCDECL yymunclearin();
|
||||||
|
#endif
|
||||||
|
#define yymabort(yy) yymexit(1)
|
||||||
|
#define yymaccept(yy) yymexit(0)
|
||||||
|
#define yymclearin(yy) ((yy)->yymlookahead = 0)
|
||||||
|
#define yymerrok(yy) yymsetskip((yy), 0)
|
||||||
|
#define yymexit(yy, exitcode) ((yy)->yymexitflg = 1, (yy)->yymexitcode = (exitcode))
|
||||||
|
#define yymforceerror(yy) yymthrowerror(0)
|
||||||
|
#define yympopping(yy) (yy)->yympopflg
|
||||||
|
#define yymrecovering(yy) ((yy)->yymskip > 0)
|
||||||
|
#define yymretire(yy, retirecode) ((yy)->yymretireflg = 1, (yy)->yymretirecode = (retirecode))
|
||||||
|
#define yymthrowerror(yy, pop) ((yy)->yymerrorflg = 1, (yy)->yymerrorpop = (pop))
|
||||||
|
|
||||||
|
/* utility functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
void YYCDECL yympop(yymparse_t YYFAR *yy, int num);
|
||||||
|
void YYCDECL yymsetskip(yymparse_t YYFAR *yy, int skip);
|
||||||
|
#endif
|
||||||
|
int YYCDECL yympush(yymparse_t YYFAR *yy, yystack_t state);
|
||||||
|
#else
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
void YYCDECL yympop();
|
||||||
|
void YYCDECL yymsetskip();
|
||||||
|
#endif
|
||||||
|
int YYCDECL yympush();
|
||||||
|
#endif
|
||||||
|
#ifndef yyassert
|
||||||
|
#define yyassert(expr) assert(expr)
|
||||||
|
#endif
|
||||||
|
#define yympeek(yy) ((yy)->yymstackptr[(yy)->yymtop])
|
||||||
|
#ifndef YYDEBUG
|
||||||
|
#define yympop(yy, num) ((yy)->yymtop -= (num))
|
||||||
|
#define yymsetskip(yy, skip) ((yy)->yymskip = (skip))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* debugging functions */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
YYCONST char *YYCDECL yymtokenstring(yymparse_t YYFAR *yy, int token);
|
||||||
|
void YYCDECL yymdgettoken(yymparse_t YYFAR *yy, int token);
|
||||||
|
void YYCDECL yymdshift(yymparse_t YYFAR *yy, int token);
|
||||||
|
void YYCDECL yymdreduce(yymparse_t YYFAR *yy, int rule);
|
||||||
|
void YYCDECL yymdsyntaxerror(yymparse_t YYFAR *yy);
|
||||||
|
void YYCDECL yymdaccept(yymparse_t YYFAR *yy);
|
||||||
|
void YYCDECL yymdabort(yymparse_t YYFAR *yy);
|
||||||
|
void YYCDECL yymddiscard(yymparse_t YYFAR *yy, int token);
|
||||||
|
void YYCDECL yymdexit(yymparse_t YYFAR *yy, int exitcode);
|
||||||
|
void YYCDECL yymdthrowerror(yymparse_t YYFAR *yy, int errorpop);
|
||||||
|
void YYCDECL yymdretire(yymparse_t YYFAR *yy, int retirecode);
|
||||||
|
void YYCDECL yymdattemptrecovery(yymparse_t YYFAR *yy);
|
||||||
|
void YYCDECL yymparsedebugoutput(yymparse_t YYFAR *yy, YYCONST char *string);
|
||||||
|
#else
|
||||||
|
YYCONST char *YYCDECL yymtokenstring();
|
||||||
|
void YYCDECL yymdgettoken();
|
||||||
|
void YYCDECL yymdshift();
|
||||||
|
void YYCDECL yymdreduce();
|
||||||
|
void YYCDECL yymdsyntaxerror();
|
||||||
|
void YYCDECL yymdaccept();
|
||||||
|
void YYCDECL yymdabort();
|
||||||
|
void YYCDECL yymddiscard();
|
||||||
|
void YYCDECL yymdexit();
|
||||||
|
void YYCDECL yymdthrowerror();
|
||||||
|
void YYCDECL yymdretire();
|
||||||
|
void YYCDECL yymdattemptrecovery();
|
||||||
|
void YYCDECL yymparsedebugoutput();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define yymisfastparser(yy) ((yy)->yymstateaction != NULL)
|
||||||
|
#define yymiscompactparser(yy) ((yy)->yymcstateaction != NULL)
|
||||||
|
|
||||||
|
/* debugging variables */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
extern int YYNEAR YYDCDECL yydebug;
|
||||||
|
extern int YYNEAR YYDCDECL yydebugstack;
|
||||||
|
extern int YYNEAR YYDCDECL yydebugflush;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* user defines */
|
||||||
|
#if defined(YYBUDEFS) || defined(YYUDEFS)
|
||||||
|
#include <yybudefs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* defines */
|
||||||
|
#include <yybdefs.h>
|
||||||
|
|
||||||
|
#endif
|
90
Utils/Parser Generator/INCLUDE/myconv.h
Normal file
90
Utils/Parser Generator/INCLUDE/myconv.h
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
#ifndef MYCONV_H
|
||||||
|
#define MYCONV_H
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
myconv.h
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
/* variables */
|
||||||
|
#define yylookahead (YYPARSENAME).yymlookahead
|
||||||
|
#define yystackgrow (YYPARSENAME).yymstackgrow
|
||||||
|
#define yyexitflg (YYPARSENAME).yymexitflg
|
||||||
|
#define yyretireflg (YYPARSENAME).yymretireflg
|
||||||
|
#define yyerrorflg (YYPARSENAME).yymerrorflg
|
||||||
|
#define yypopflg (YYPARSENAME).yympopflg
|
||||||
|
#define yywipeflg (YYPARSENAME).yymwipeflg
|
||||||
|
#define yytop (YYPARSENAME).yymtop
|
||||||
|
#define yychar (YYPARSENAME).yymchar
|
||||||
|
#define yyskip (YYPARSENAME).yymskip
|
||||||
|
#define yyerrorcount (YYPARSENAME).yymerrorcount
|
||||||
|
#define yyexitcode (YYPARSENAME).yymexitcode
|
||||||
|
#define yyretirecode (YYPARSENAME).yymretirecode
|
||||||
|
#define yyerrorpop (YYPARSENAME).yymerrorpop
|
||||||
|
#define yyparseerr (YYPARSENAME).yymerr
|
||||||
|
#define yystackptr (YYPARSENAME).yymstackptr
|
||||||
|
#define yysstackptr (YYPARSENAME).yymsstackptr
|
||||||
|
#define yystack_size (YYPARSENAME).yymstack_size
|
||||||
|
#define yysstack_size (YYPARSENAME).yymsstack_size
|
||||||
|
#define yyattribute_size (YYPARSENAME).yymattribute_size
|
||||||
|
#define yyvalptr (YYPARSENAME).yymvalptr
|
||||||
|
#define yylvalptr (YYPARSENAME).yymlvalptr
|
||||||
|
#define yyattributestackptr (YYPARSENAME).yymattributestackptr
|
||||||
|
#define yysattributestackptr (YYPARSENAME).yymsattributestackptr
|
||||||
|
#define yyparsedebug (YYPARSENAME).yymdebug
|
||||||
|
#define yyparsedebugstack (YYPARSENAME)->yymdebugstack
|
||||||
|
#define yyparsedebugflush (YYPARSENAME).yymdebugflush
|
||||||
|
#define yyparsedebugout (YYPARSENAME).yymdebugout
|
||||||
|
|
||||||
|
/* general functions */
|
||||||
|
#define yycparse() yymcparse(&(YYPARSENAME))
|
||||||
|
#define yycwipe() yymcwipe(&(YYPARSENAME))
|
||||||
|
#define yycwork() yymcwork(&(YYPARSENAME))
|
||||||
|
#define yydestructpop(num) yymdestructpop(&(YYPARSENAME), (pop))
|
||||||
|
#define yyparse() yymparse(&(YYPARSENAME))
|
||||||
|
#define yyparsecleanup() yymparsecleanup(&(YYPARSENAME))
|
||||||
|
#define yyparseinit() yymparseinit(&(YYPARSENAME))
|
||||||
|
#define yysetstacksize(size) yymsetstacksize(&(YYPARSENAME), (size))
|
||||||
|
#define yysetup() yymsetup(&(YYPARSENAME))
|
||||||
|
#define yywipe() yymwipe(&(YYPARSENAME))
|
||||||
|
#define yywork() yymwork(&(YYPARSENAME))
|
||||||
|
|
||||||
|
/* service functions */
|
||||||
|
#define yygettoken() (*(YYPARSENAME).yymgettoken)(&(YYPARSENAME))
|
||||||
|
#define yystackoverflow() (*(YYPARSENAME).yymstackoverflow)(&(YYPARSENAME))
|
||||||
|
#define yyerror(text) (*(YYPARSENAME).yymerror)(&(YYPARSENAME), (text))
|
||||||
|
#define yysyntaxerror() (*(YYPARSENAME).yymsyntaxerror)(&(YYPARSENAME))
|
||||||
|
#define yydiscard() (*(YYPARSENAME).yymdiscard)(&(YYPARSENAME))
|
||||||
|
|
||||||
|
/* action functions */
|
||||||
|
#define yycdestructclearin() yymcdestructclearin(&(YYPARSENAME))
|
||||||
|
#define yydestructclearin() yymdestructclearin(&(YYPARSENAME))
|
||||||
|
#define yysetin(token) yymsetin(&(YYPARSENAME), (token)
|
||||||
|
#define yyunclearin() yymunclearin(&(YYPARSENAME))
|
||||||
|
#define yyabort() yymabort(&(YYPARSENAME))
|
||||||
|
#define yyaccept() yymaccept(&(YYPARSENAME))
|
||||||
|
#define yyclearin() yymclearin(&(YYPARSENAME))
|
||||||
|
#define yydestructclearin() yymdestructclearin(&(YYPARSENAME))
|
||||||
|
#define yyerrok() yymerrok(&(YYPARSENAME))
|
||||||
|
#define yyexit(exitcode) yymexit(&(YYPARSENAME), (exitcode))
|
||||||
|
#define yyforceerror() yymforceerror(&(YYPARSENAME))
|
||||||
|
#define yypopping() yympopping(&(YYPARSENAME))
|
||||||
|
#define yyrecovering() yymrecovering(&(YYPARSENAME))
|
||||||
|
#define yyretire(retirecode) yymretire(&(YYPARSENAME), (retirecode))
|
||||||
|
#define yythrowerror(pop) yymthrowerror(&YYPARSENAME), (pop))
|
||||||
|
|
||||||
|
#ifdef YY_COMPATIBLE
|
||||||
|
#undef yyerrok
|
||||||
|
#define yyerrok yymerrok(&(YYPARSENAME))
|
||||||
|
#undef yyclearin
|
||||||
|
#define yyclearin yymclearin(&(YYPARSENAME))
|
||||||
|
#endif
|
||||||
|
#define YYACCEPT yymaccept(&(YYPARSENAME))
|
||||||
|
#define YYABORT yymabort(&(YYPARSENAME))
|
||||||
|
#define YYERROR yymforceerror(&(YYPARSENAME))
|
||||||
|
#define YYRECOVERING yymrecovering(&(YYPARSENAME))
|
||||||
|
|
||||||
|
#endif
|
418
Utils/Parser Generator/INCLUDE/yacc.h
Normal file
418
Utils/Parser Generator/INCLUDE/yacc.h
Normal file
|
@ -0,0 +1,418 @@
|
||||||
|
#ifndef YACC_H
|
||||||
|
#define YACC_H
|
||||||
|
|
||||||
|
/************************************************************
|
||||||
|
yacc.h
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
/* defines */
|
||||||
|
#include <yytdefs.h>
|
||||||
|
|
||||||
|
/* user defines */
|
||||||
|
#if defined(YYTUDEFS) || defined(YYUDEFS)
|
||||||
|
#include <yytudefs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define YY_AYACC
|
||||||
|
|
||||||
|
/* modifiers */
|
||||||
|
#ifndef YYCDECL
|
||||||
|
#define YYCDECL
|
||||||
|
#endif
|
||||||
|
#ifndef YYDCDECL
|
||||||
|
#define YYDCDECL
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEAR
|
||||||
|
#define YYNEAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYFAR
|
||||||
|
#define YYFAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEARFAR
|
||||||
|
#define YYNEARFAR
|
||||||
|
#endif
|
||||||
|
#ifndef YYBASED_CODE
|
||||||
|
#define YYBASED_CODE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* function prototypes */
|
||||||
|
#ifndef YYPROTOTYPE
|
||||||
|
#if defined(__STDC__) || defined(__cplusplus)
|
||||||
|
#define YYPROTOTYPE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* qualifiers */
|
||||||
|
#ifndef YYCONST
|
||||||
|
#if defined(__STDC__) || defined(__cplusplus)
|
||||||
|
#define YYCONST const
|
||||||
|
#else
|
||||||
|
#define YYCONST
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* testing */
|
||||||
|
#ifdef YYNOPROTOTYPE
|
||||||
|
#undef YYPROTOTYPE
|
||||||
|
#endif
|
||||||
|
#ifdef YYNOCONST
|
||||||
|
#undef YYCONST
|
||||||
|
#define YYCONST
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef short yystack_t;
|
||||||
|
|
||||||
|
/* yyparse return values */
|
||||||
|
#define YYEXIT_SUCCESS 0
|
||||||
|
#define YYEXIT_FAILURE 1
|
||||||
|
|
||||||
|
/* common tokens */
|
||||||
|
#define YYTK_ALL (-1) /* match all tokens */
|
||||||
|
#define YYTK_END 0 /* $end token */
|
||||||
|
#define YYTK_ERROR 256 /* error token */
|
||||||
|
|
||||||
|
#ifndef YYCSTATEGOTO_T
|
||||||
|
#define YYCSTATEGOTO_T
|
||||||
|
typedef short yycstategoto_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYCNONTERMGOTO_T
|
||||||
|
#define YYCNONTERMGOTO_T
|
||||||
|
typedef struct yycnontermgoto {
|
||||||
|
short nonterm; /* nonterminal */
|
||||||
|
short next; /* next state */
|
||||||
|
} yycnontermgoto_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYSTATEGOTO_T
|
||||||
|
#define YYSTATEGOTO_T
|
||||||
|
typedef struct yystategoto {
|
||||||
|
short base; /* base */
|
||||||
|
short def; /* default state */
|
||||||
|
} yystategoto_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYNONTERMGOTO_T
|
||||||
|
#define YYNONTERMGOTO_T
|
||||||
|
typedef struct yynontermgoto {
|
||||||
|
short check; /* check */
|
||||||
|
short next; /* next state */
|
||||||
|
} yynontermgoto_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* action types */
|
||||||
|
#define YYAT_SHIFT 0 /* shift action */
|
||||||
|
#define YYAT_REDUCE 1 /* reduce action */
|
||||||
|
#define YYAT_ERROR 2 /* error */
|
||||||
|
#define YYAT_ACCEPT 3 /* accept */
|
||||||
|
#define YYAT_DEFAULT 4 /* default state */
|
||||||
|
|
||||||
|
#ifndef YYCSTATEACTION_T
|
||||||
|
#define YYCSTATEACTION_T
|
||||||
|
typedef short yycstateaction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYCTOKENACTION_T
|
||||||
|
#define YYCTOKENACTION_T
|
||||||
|
typedef struct yyctokenaction {
|
||||||
|
int token; /* lookahead token */
|
||||||
|
unsigned char type; /* action to perform */
|
||||||
|
short sr; /* state to shift/production to reduce */
|
||||||
|
} yyctokenaction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYSTATEACTION_T
|
||||||
|
#define YYSTATEACTION_T
|
||||||
|
typedef struct yystateaction {
|
||||||
|
short base; /* base */
|
||||||
|
unsigned char lookahead; /* lookahead needed */
|
||||||
|
unsigned char type; /* action to perform */
|
||||||
|
short sr; /* shift/reduce */
|
||||||
|
} yystateaction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef YYTOKENACTION_T
|
||||||
|
#define YYTOKENACTION_T
|
||||||
|
typedef struct yytokenaction {
|
||||||
|
short check; /* check */
|
||||||
|
unsigned char type; /* action type */
|
||||||
|
short sr; /* shift/reduce */
|
||||||
|
} yytokenaction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* nonterminals */
|
||||||
|
#define YYNT_ALL (-1) /* match all nonterminals */
|
||||||
|
|
||||||
|
/* states */
|
||||||
|
#define YYST_ERROR (-1) /* goto error */
|
||||||
|
|
||||||
|
#ifndef YYREDUCTION_T
|
||||||
|
#define YYREDUCTION_T
|
||||||
|
typedef struct yyreduction {
|
||||||
|
short nonterm; /* the rhs symbol */
|
||||||
|
short length; /* number of symbols on lhs */
|
||||||
|
short action; /* the user action */
|
||||||
|
} yyreduction_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef short yydestructor_t;
|
||||||
|
|
||||||
|
typedef short yytokendest_t;
|
||||||
|
|
||||||
|
#ifndef YYCTOKENDEST_T
|
||||||
|
#define YYCTOKENDEST_T
|
||||||
|
typedef struct yyctokendest {
|
||||||
|
int token; /* token */
|
||||||
|
short action; /* the user action */
|
||||||
|
} yyctokendest_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* debugging */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
#ifndef YYSYMBOL_T
|
||||||
|
#define YYSYMBOL_T
|
||||||
|
typedef struct yysymbol {
|
||||||
|
YYCONST char *name; /* symbol name */
|
||||||
|
int token; /* symbol token */
|
||||||
|
} yysymbol_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* general functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yycparse(void);
|
||||||
|
void YYCDECL yycwipe(void);
|
||||||
|
int YYCDECL yycwork(void);
|
||||||
|
void YYCDECL yydestructpop(int num);
|
||||||
|
int YYCDECL yyparse(void);
|
||||||
|
void YYCDECL yyparsecleanup(void);
|
||||||
|
void YYCDECL yyparseinit(void);
|
||||||
|
int YYCDECL yysetstacksize(int size);
|
||||||
|
int YYCDECL yysetup(void);
|
||||||
|
void YYCDECL yywipe(void);
|
||||||
|
int YYCDECL yywork(void);
|
||||||
|
#else
|
||||||
|
int YYCDECL yycparse();
|
||||||
|
void YYCDECL yycwipe();
|
||||||
|
int YYCDECL yycwork();
|
||||||
|
void YYCDECL yydestructpop();
|
||||||
|
int YYCDECL yyparse();
|
||||||
|
void YYCDECL yyparsecleanup();
|
||||||
|
void YYCDECL yyparseinit();
|
||||||
|
int YYCDECL yysetstacksize();
|
||||||
|
int YYCDECL yysetup();
|
||||||
|
void YYCDECL yywipe();
|
||||||
|
int YYCDECL yywork();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* service functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yydiscard(int token);
|
||||||
|
void YYCDECL yyerror(YYCONST char YYFAR *text);
|
||||||
|
int YYCDECL yygettoken(void);
|
||||||
|
void YYCDECL yystackoverflow(void);
|
||||||
|
void YYCDECL yysyntaxerror(void);
|
||||||
|
#else
|
||||||
|
void YYCDECL yydiscard();
|
||||||
|
void YYCDECL yyerror();
|
||||||
|
int YYCDECL yygettoken();
|
||||||
|
void YYCDECL yystackoverflow();
|
||||||
|
void YYCDECL yysyntaxerror();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* action functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yycdestructclearin(void);
|
||||||
|
void YYCDECL yydestructclearin(void);
|
||||||
|
void YYCDECL yysetin(int token);
|
||||||
|
int YYCDECL yyunclearin(void);
|
||||||
|
#else
|
||||||
|
void YYCDECL yycdestructclearin();
|
||||||
|
void YYCDECL yydestructclearin();
|
||||||
|
void YYCDECL yysetin();
|
||||||
|
int YYCDECL yyunclearin();
|
||||||
|
#endif
|
||||||
|
#define yyabort() yyexit(1)
|
||||||
|
#define yyaccept() yyexit(0)
|
||||||
|
#define yyclearin() (yylookahead = 0)
|
||||||
|
#define yyerrok() yysetskip(0)
|
||||||
|
#define yyexit(exitcode) (yyexitflg = 1, yyexitcode = (exitcode))
|
||||||
|
#define yyforceerror() yythrowerror(0)
|
||||||
|
#define yypopping() yypopflg
|
||||||
|
#define yyrecovering() (yyskip > 0)
|
||||||
|
#define yyretire(retirecode) (yyretireflg = 1, yyretirecode = (retirecode))
|
||||||
|
#define yythrowerror(pop) (yyerrorflg = 1, yyerrorpop = (pop))
|
||||||
|
|
||||||
|
/* compatibility */
|
||||||
|
#ifdef YY_COMPATIBLE
|
||||||
|
#undef yyclearin
|
||||||
|
#define yyclearin (yylookahead = 0)
|
||||||
|
#undef yyerrok
|
||||||
|
#define yyerrok yysetskip(0)
|
||||||
|
#endif
|
||||||
|
#define YYABORT yyexit(1)
|
||||||
|
#define YYACCEPT yyexit(0)
|
||||||
|
#define YYERROR yyforceerror()
|
||||||
|
#define YYRECOVERING yyrecovering()
|
||||||
|
|
||||||
|
/* helper functions */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
void YYCDECL yypop(int num);
|
||||||
|
void YYCDECL yysetskip(int skip);
|
||||||
|
#endif
|
||||||
|
int YYCDECL yypush(yystack_t state);
|
||||||
|
#else
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
void YYCDECL yypop();
|
||||||
|
void YYCDECL yysetskip();
|
||||||
|
#endif
|
||||||
|
int YYCDECL yypush();
|
||||||
|
#endif
|
||||||
|
#ifndef yyassert
|
||||||
|
#define yyassert(expr) assert(expr)
|
||||||
|
#endif
|
||||||
|
#define yypeek() (yystackptr[yytop])
|
||||||
|
#ifndef YYDEBUG
|
||||||
|
#define yypop(num) (yytop -= (num))
|
||||||
|
#define yysetskip(skip) (yyskip = (skip))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* variables */
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yylookahead;
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yystackgrow;
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yyexitflg;
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yyretireflg;
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yyerrorflg;
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yypopflg;
|
||||||
|
extern unsigned char YYNEAR YYDCDECL yywipeflg;
|
||||||
|
extern int YYNEAR YYDCDECL yytop; /* the current top of the stack */
|
||||||
|
extern int YYNEAR YYDCDECL yychar;
|
||||||
|
extern int YYNEAR YYDCDECL yyskip;
|
||||||
|
extern int YYNEAR YYDCDECL yyerrorcount;
|
||||||
|
extern FILE YYFAR *YYNEAR YYDCDECL yyparseerr;
|
||||||
|
extern int YYNEAR YYDCDECL yyexitcode;
|
||||||
|
extern int YYNEAR YYDCDECL yyretirecode;
|
||||||
|
extern int YYNEAR YYDCDECL yyerrorpop;
|
||||||
|
|
||||||
|
/* debugging functions */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
YYCONST char *YYCDECL yytokenstring(int token);
|
||||||
|
void YYCDECL yydgettoken(int token);
|
||||||
|
void YYCDECL yydshift(int token);
|
||||||
|
void YYCDECL yydreduce(int rule);
|
||||||
|
void YYCDECL yydsyntaxerror(void);
|
||||||
|
void YYCDECL yydaccept(void);
|
||||||
|
void YYCDECL yydabort(void);
|
||||||
|
void YYCDECL yyddiscard(int token);
|
||||||
|
void YYCDECL yydexit(int exitcode);
|
||||||
|
void YYCDECL yydthrowerror(int errorpop);
|
||||||
|
void YYCDECL yydretire(int retirecode);
|
||||||
|
void YYCDECL yydattemptrecovery(void);
|
||||||
|
void YYCDECL yyparsedebugoutput(YYCONST char *string);
|
||||||
|
#else
|
||||||
|
YYCONST char *YYCDECL yytokenstring();
|
||||||
|
void YYCDECL yydgettoken();
|
||||||
|
void YYCDECL yydshift();
|
||||||
|
void YYCDECL yydreduce();
|
||||||
|
void YYCDECL yydsyntaxerror();
|
||||||
|
void YYCDECL yydaccept();
|
||||||
|
void YYCDECL yydabort();
|
||||||
|
void YYCDECL yyddiscard();
|
||||||
|
void YYCDECL yydexit();
|
||||||
|
void YYCDECL yydthrowerror();
|
||||||
|
void YYCDECL yydretire();
|
||||||
|
void YYCDECL yydattemptrecovery();
|
||||||
|
void YYCDECL yyparsedebugoutput();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* debugging variables */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
extern int YYNEAR YYDCDECL yydebug;
|
||||||
|
extern int YYNEAR YYDCDECL yydebugstack;
|
||||||
|
extern int YYNEAR YYDCDECL yydebugflush;
|
||||||
|
extern int YYNEAR YYDCDECL yyparsedebug;
|
||||||
|
extern int YYNEAR YYDCDECL yyparsedebugstack;
|
||||||
|
extern int YYNEAR YYDCDECL yyparsedebugflush;
|
||||||
|
extern FILE YYFAR *YYNEAR YYDCDECL yyparsedebugout;
|
||||||
|
extern YYCONST yysymbol_t YYNEARFAR YYDCDECL yysymbol[];
|
||||||
|
extern YYCONST char *YYCONST YYNEARFAR YYDCDECL yyrule[];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* externally defined */
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yylex(void);
|
||||||
|
void YYCDECL yyparseaction(int action);
|
||||||
|
#else
|
||||||
|
int YYCDECL yylex();
|
||||||
|
void YYCDECL yyparseaction();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern yystack_t YYFAR *YYNEAR YYDCDECL yystackptr; /* (state) stack */
|
||||||
|
extern yystack_t YYFAR *YYNEAR YYDCDECL yysstackptr; /* static (state) stack */
|
||||||
|
extern int YYNEAR YYDCDECL yystack_size; /* number of elements in stack */
|
||||||
|
extern int YYNEAR YYDCDECL yysstack_size; /* initial number of elements in stack */
|
||||||
|
|
||||||
|
extern size_t YYNEAR YYDCDECL yyattribute_size; /* size of attribute */
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
extern void YYFAR *YYNEAR YYDCDECL yyvalptr; /* attribute for $$ */
|
||||||
|
extern void YYFAR *YYNEAR YYDCDECL yylvalptr; /* current token attribute */
|
||||||
|
extern void YYFAR *YYNEAR YYDCDECL yyattributestackptr; /* attribute stack */
|
||||||
|
extern void YYFAR *YYNEAR YYDCDECL yysattributestackptr; /* static attribute stack */
|
||||||
|
#else
|
||||||
|
extern char YYFAR *YYNEAR YYDCDECL yyvalptr; /* attribute for $$ */
|
||||||
|
extern char YYFAR *YYNEAR YYDCDECL yylvalptr; /* current token attribute */
|
||||||
|
extern char YYFAR *YYNEAR YYDCDECL yyattributestackptr; /* attribute stack */
|
||||||
|
extern char YYFAR *YYNEAR YYDCDECL yysattributestackptr; /* static attribute stack */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* compact parser */
|
||||||
|
extern YYCONST yycstateaction_t YYNEARFAR YYDCDECL yycstateaction[];
|
||||||
|
extern YYCONST yyctokenaction_t YYNEARFAR YYDCDECL yyctokenaction[];
|
||||||
|
extern YYCONST yycstategoto_t YYNEARFAR YYDCDECL yycstategoto[];
|
||||||
|
extern YYCONST yycnontermgoto_t YYNEARFAR YYDCDECL yycnontermgoto[];
|
||||||
|
extern YYCONST yyctokendest_t YYNEARFAR *YYNEAR YYDCDECL yyctokendestptr;
|
||||||
|
|
||||||
|
/* fast parser */
|
||||||
|
extern YYCONST yystateaction_t YYNEARFAR YYDCDECL yystateaction[];
|
||||||
|
extern YYCONST yytokenaction_t YYNEARFAR YYDCDECL yytokenaction[];
|
||||||
|
extern int YYNEAR YYDCDECL yytokenaction_size;
|
||||||
|
extern YYCONST yystategoto_t YYNEARFAR YYDCDECL yystategoto[];
|
||||||
|
extern YYCONST yynontermgoto_t YYNEARFAR YYDCDECL yynontermgoto[];
|
||||||
|
extern int YYNEAR YYDCDECL yynontermgoto_size;
|
||||||
|
extern YYCONST yytokendest_t YYNEARFAR *YYNEAR YYDCDECL yytokendestptr;
|
||||||
|
extern int YYNEAR YYDCDECL yytokendest_size;
|
||||||
|
extern int YYNEAR YYDCDECL yytokendestbase;
|
||||||
|
|
||||||
|
extern YYCONST yyreduction_t YYNEARFAR YYDCDECL yyreduction[];
|
||||||
|
|
||||||
|
extern YYCONST yydestructor_t YYNEARFAR *YYNEAR YYDCDECL yydestructorptr;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* user defines */
|
||||||
|
#if defined(YYBUDEFS) || defined(YYUDEFS)
|
||||||
|
#include <yybudefs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* defines */
|
||||||
|
#include <yybdefs.h>
|
||||||
|
|
||||||
|
#endif
|
49
Utils/Parser Generator/INCLUDE/yybdefs.h
Normal file
49
Utils/Parser Generator/INCLUDE/yybdefs.h
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
/************************************************************
|
||||||
|
yybdefs.h
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Microsoft defines */
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
|
/* structure alignment */
|
||||||
|
#ifdef _WIN32
|
||||||
|
#pragma pack(pop)
|
||||||
|
#else
|
||||||
|
#pragma pack()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Borland defines */
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
|
||||||
|
#if !defined(RC_INVOKED)
|
||||||
|
|
||||||
|
#if (__BORLANDC__) >= 0x0530
|
||||||
|
/* restore default packing */
|
||||||
|
#pragma pack(pop)
|
||||||
|
#pragma nopackwarning
|
||||||
|
#else
|
||||||
|
#pragma option -a. /* restore default packing */
|
||||||
|
#endif /* (__BORLANDC__) >= 0x0530 */
|
||||||
|
|
||||||
|
#if defined(__STDC__)
|
||||||
|
#pragma warn .nak
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* !RC_INVOKED */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
};
|
||||||
|
#endif
|
148
Utils/Parser Generator/INCLUDE/yytdefs.h
Normal file
148
Utils/Parser Generator/INCLUDE/yytdefs.h
Normal file
|
@ -0,0 +1,148 @@
|
||||||
|
/************************************************************
|
||||||
|
yytdefs.h
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Microsoft defines */
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
|
/* version 6.0 compatibility */
|
||||||
|
#if (_MSC_VER <= 600)
|
||||||
|
#define __cdecl _cdecl
|
||||||
|
#define __far _far
|
||||||
|
#define __near _near
|
||||||
|
#define __segname _segname
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* structure alignment */
|
||||||
|
#ifdef _WIN32
|
||||||
|
/*
|
||||||
|
* Currently, all MS C compilers for Win32 platforms default to 8 byte
|
||||||
|
* alignment.
|
||||||
|
*/
|
||||||
|
#pragma pack(push,8)
|
||||||
|
#else
|
||||||
|
#pragma pack(2)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* stream initialisation */
|
||||||
|
#ifdef _DLL
|
||||||
|
#define YYNINITSTREAM
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 32/16-bit modifiers */
|
||||||
|
#ifndef YYCDECL
|
||||||
|
#define YYCDECL __cdecl
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 16-bit modifiers */
|
||||||
|
#ifndef _WIN32
|
||||||
|
#ifndef YYDCDECL
|
||||||
|
#define YYDCDECL __cdecl
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEAR
|
||||||
|
#define YYNEAR __near
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEARFAR
|
||||||
|
#if defined(M_I86TM) || defined(M_I86SM)
|
||||||
|
#define YYNEARFAR __near
|
||||||
|
#else
|
||||||
|
#define YYNEARFAR __far
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef YYBASED_CODE
|
||||||
|
#if defined(M_I86MM) || defined(M_I86LM) || defined(M_I86HM)
|
||||||
|
#define YYBASED_CODE __based(__segname("_CODE"))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* function prototypes */
|
||||||
|
#ifndef YYPROTOTYPE
|
||||||
|
#define YYPROTOTYPE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* qualifiers */
|
||||||
|
#ifndef YYCONST
|
||||||
|
#define YYCONST const
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Borland defines */
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
|
||||||
|
#if !defined(RC_INVOKED)
|
||||||
|
|
||||||
|
#if defined(__STDC__)
|
||||||
|
#pragma warn -nak
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (__BORLANDC__) >= 0x0530
|
||||||
|
#pragma pack(push, 1)
|
||||||
|
#pragma nopackwarning
|
||||||
|
#else
|
||||||
|
#pragma option -a-
|
||||||
|
#endif /* (__BORLANDC__) >= 0x0530 */
|
||||||
|
|
||||||
|
#pragma option -a-
|
||||||
|
|
||||||
|
#endif /* !RC_INVOKED */
|
||||||
|
|
||||||
|
/* stream initialisation */
|
||||||
|
#ifdef _RTLDLL
|
||||||
|
#if (__BORLANDC__) >= 0x0530
|
||||||
|
#define YYNINITSTREAM
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 32/16-bit modifiers */
|
||||||
|
#ifndef YYCDECL
|
||||||
|
#define YYCDECL __cdecl
|
||||||
|
#endif
|
||||||
|
#ifndef YYDCDECL
|
||||||
|
#define YYDCDECL __cdecl
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 16-bit modifiers */
|
||||||
|
#ifndef __WIN32__
|
||||||
|
#ifndef YYNEAR
|
||||||
|
#define YYNEAR __near
|
||||||
|
#endif
|
||||||
|
#ifndef YYFAR
|
||||||
|
#ifdef __DLL__
|
||||||
|
#define YYFAR __far
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef YYNEARFAR
|
||||||
|
#if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
|
||||||
|
#define YYNEARFAR __near
|
||||||
|
#else
|
||||||
|
#define YYNEARFAR __far
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* function prototypes */
|
||||||
|
#ifndef YYPROTOTYPE
|
||||||
|
#define YYPROTOTYPE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* qualifiers */
|
||||||
|
#ifndef YYCONST
|
||||||
|
#define YYCONST const
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
};
|
||||||
|
#endif
|
BIN
Utils/Parser Generator/LIB/MSDEV/yl.lib
Normal file
BIN
Utils/Parser Generator/LIB/MSDEV/yl.lib
Normal file
Binary file not shown.
BIN
Utils/Parser Generator/LIB/MSDEV/yld.lib
Normal file
BIN
Utils/Parser Generator/LIB/MSDEV/yld.lib
Normal file
Binary file not shown.
BIN
Utils/Parser Generator/LIB/MSDEV/ylmt.lib
Normal file
BIN
Utils/Parser Generator/LIB/MSDEV/ylmt.lib
Normal file
Binary file not shown.
BIN
Utils/Parser Generator/LIB/MSDEV/ylmtd.lib
Normal file
BIN
Utils/Parser Generator/LIB/MSDEV/ylmtd.lib
Normal file
Binary file not shown.
BIN
Utils/Parser Generator/LIB/MSDEV/ylmtdll.lib
Normal file
BIN
Utils/Parser Generator/LIB/MSDEV/ylmtdll.lib
Normal file
Binary file not shown.
BIN
Utils/Parser Generator/LIB/MSDEV/ylmtdlld.lib
Normal file
BIN
Utils/Parser Generator/LIB/MSDEV/ylmtdlld.lib
Normal file
Binary file not shown.
BIN
Utils/Parser Generator/Release.doc
Normal file
BIN
Utils/Parser Generator/Release.doc
Normal file
Binary file not shown.
18
Utils/Parser Generator/SOURCE/main.c
Normal file
18
Utils/Parser Generator/SOURCE/main.c
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/************************************************************
|
||||||
|
main.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "yacc.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int main(void)
|
||||||
|
#else
|
||||||
|
int main()
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
return yyparse();
|
||||||
|
}
|
21
Utils/Parser Generator/SOURCE/yycback.cpp
Normal file
21
Utils/Parser Generator/SOURCE/yycback.cpp
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
/************************************************************
|
||||||
|
yycback.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
int yylexer::yyback(const yymatch_t YYNEARFAR* p, int action) const
|
||||||
|
{
|
||||||
|
yyassert(p != NULL);
|
||||||
|
yyassert(action < 0);
|
||||||
|
while (*p != 0) {
|
||||||
|
if (*p++ == action) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
40
Utils/Parser Generator/SOURCE/yyccdeci.cpp
Normal file
40
Utils/Parser Generator/SOURCE/yyccdeci.cpp
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/************************************************************
|
||||||
|
yyccdeci.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
// the Visual C++ v1.52 compiler generates an error in NT if this isn't present!
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#if defined(M_I86HM) && defined(NDEBUG)
|
||||||
|
#pragma function(memcpy)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void yycparser::yydestructclearin()
|
||||||
|
{
|
||||||
|
if (yylookahead) {
|
||||||
|
// clean up any token attributes
|
||||||
|
if (yyctokendestptr != NULL) {
|
||||||
|
const yyctokendest_t YYNEARFAR* tokendestptr = yyctokendestptr;
|
||||||
|
while (tokendestptr->token != 0) {
|
||||||
|
if (tokendestptr->token == yychar) {
|
||||||
|
// user actions in here
|
||||||
|
memcpy(yyvalptr, yylvalptr, yyattribute_size);
|
||||||
|
|
||||||
|
yyaction(tokendestptr->action);
|
||||||
|
|
||||||
|
memcpy(yylvalptr, yyvalptr, yyattribute_size);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
tokendestptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yylookahead = 0;
|
||||||
|
}
|
||||||
|
}
|
217
Utils/Parser Generator/SOURCE/yycclex.cpp
Normal file
217
Utils/Parser Generator/SOURCE/yycclex.cpp
Normal file
|
@ -0,0 +1,217 @@
|
||||||
|
/************************************************************
|
||||||
|
yycclex.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
int yyclexer::yylex()
|
||||||
|
{
|
||||||
|
while (1) {
|
||||||
|
int state = 1 + yystart;
|
||||||
|
if (yyeol) {
|
||||||
|
state++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// yymore
|
||||||
|
if (yymoreflg) {
|
||||||
|
yymoreflg = 0; // clear flag
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yyleng = 0;
|
||||||
|
yyoldeol = yyeol;
|
||||||
|
}
|
||||||
|
int oldleng = yyleng;
|
||||||
|
|
||||||
|
// look for a string
|
||||||
|
do {
|
||||||
|
// get input character (lookahead character)
|
||||||
|
int ch = yyinput();
|
||||||
|
yyassert(ch >= 0 && ch <= UCHAR_MAX || ch == EOF);
|
||||||
|
if (ch == EOF) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check for possible overflow
|
||||||
|
if (yyleng == yytext_size) {
|
||||||
|
do {
|
||||||
|
if (yytextgrow) {
|
||||||
|
if (yytext_size != 0) {
|
||||||
|
int size = yytext_size * 2;
|
||||||
|
if (size / 2 == yytext_size) { // overflow check
|
||||||
|
if (yysettextsize(size)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (yysettextsize(100)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yytextoverflow();
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
while (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// look for a transition
|
||||||
|
int index = yystate[state].base;
|
||||||
|
while (1) {
|
||||||
|
if (yyctransition[index].next == 0) {
|
||||||
|
state = yystate[state].def;
|
||||||
|
if (state <= 0) {
|
||||||
|
if (state < 0) {
|
||||||
|
if (ch >= 0 && ch <= 0xff) {
|
||||||
|
state = -state;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
state = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ch >= yyctransition[index].first &&
|
||||||
|
ch <= yyctransition[index].last) {
|
||||||
|
state = yyctransition[index].next;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
int leng = yyleng; // slightly more efficient code
|
||||||
|
yytext[leng] = (char)ch;
|
||||||
|
yystatebuf[leng] = state;
|
||||||
|
leng++;
|
||||||
|
yyleng = leng;
|
||||||
|
}
|
||||||
|
while (state != 0 && (yystate[state].def != 0 || yystate[state].base != 0));
|
||||||
|
|
||||||
|
// now find a match
|
||||||
|
if (yyleng > oldleng) {
|
||||||
|
int rejectmatch = 0;
|
||||||
|
while (1) {
|
||||||
|
int match = yystate[yystatebuf[yyleng - 1]].match;
|
||||||
|
if (rejectmatch != 0) {
|
||||||
|
if (match < 0) {
|
||||||
|
int index = -match;
|
||||||
|
do {
|
||||||
|
match = yymatch[index++];
|
||||||
|
}
|
||||||
|
while (match > 0 && match <= rejectmatch);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (match == rejectmatch) {
|
||||||
|
match = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rejectmatch = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (match < 0) {
|
||||||
|
match = yymatch[-match];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (match > 0) {
|
||||||
|
// check for backup
|
||||||
|
if (yybackup[match]) {
|
||||||
|
while (yyleng > oldleng) {
|
||||||
|
int index = yystate[yystatebuf[yyleng - 1]].match;
|
||||||
|
if (index < 0) {
|
||||||
|
if (yyback(&yymatch[-index], -match)) {
|
||||||
|
break; // found an expression
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yyleng--;
|
||||||
|
yyunput((unsigned char)yytext[yyleng]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yytext[yyleng] = '\0';
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydmatch(match);
|
||||||
|
#endif
|
||||||
|
yyrejectflg = 0; // clear flag
|
||||||
|
int rejectleng = yyleng;
|
||||||
|
|
||||||
|
if (yyleng > 0) {
|
||||||
|
yyeol = (unsigned char)(yytext[yyleng - 1] == '\n');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yyeol = yyoldeol;
|
||||||
|
}
|
||||||
|
|
||||||
|
// perform user action
|
||||||
|
int token = yyaction(match);
|
||||||
|
|
||||||
|
if (yyreturnflg) {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
if (!yyrejectflg) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (rejectleng == yyleng) {
|
||||||
|
rejectmatch = match;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (yyleng > oldleng + 1) {
|
||||||
|
yyleng--;
|
||||||
|
yyunput((unsigned char)yytext[yyleng]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yyeol = (unsigned char)(yytext[0] == '\n');
|
||||||
|
yyoutput(yytext[0]); // non-matched character
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yyassert(yyleng == oldleng);
|
||||||
|
|
||||||
|
// handles <<EOF>> rules
|
||||||
|
int index = 0;
|
||||||
|
int match = yystate[state].match;
|
||||||
|
if (match < 0) {
|
||||||
|
index = -match;
|
||||||
|
match = yymatch[index++];
|
||||||
|
}
|
||||||
|
while (match > 0) {
|
||||||
|
yytext[yyleng] = '\0';
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydmatch(match);
|
||||||
|
#endif
|
||||||
|
yyrejectflg = 0; // clear flag
|
||||||
|
|
||||||
|
// perform user action
|
||||||
|
int token = yyaction(match);
|
||||||
|
|
||||||
|
if (yyreturnflg) {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
if (!yyrejectflg) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
match = yymatch[index++];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (yywrap()) {
|
||||||
|
yyoldeol = 1;
|
||||||
|
yyeol = 1;
|
||||||
|
yystart = 0;
|
||||||
|
return 0; // eof reached
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
285
Utils/Parser Generator/SOURCE/yyccwork.cpp
Normal file
285
Utils/Parser Generator/SOURCE/yyccwork.cpp
Normal file
|
@ -0,0 +1,285 @@
|
||||||
|
/************************************************************
|
||||||
|
yyccwork.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
// the Visual C++ v1.52 compiler generates an error in NT if this isn't present!
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#if defined(M_I86HM) && defined(NDEBUG)
|
||||||
|
#pragma function(memcpy)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int yycparser::yywork()
|
||||||
|
{
|
||||||
|
int errorpop = 0;
|
||||||
|
while (1) {
|
||||||
|
yystack_t state = yypeek(); // get top state
|
||||||
|
|
||||||
|
int index = yycstateaction[state];
|
||||||
|
while (1) {
|
||||||
|
if (yyctokenaction[index].token == YYTK_ALL) {
|
||||||
|
if (yyctokenaction[index].type == YYAT_DEFAULT) {
|
||||||
|
state = yyctokenaction[index].sr;
|
||||||
|
index = yycstateaction[state];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!yylookahead) {
|
||||||
|
yychar = yygettoken();
|
||||||
|
if (yychar < 0) {
|
||||||
|
yychar = 0;
|
||||||
|
}
|
||||||
|
yylookahead = 1;
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydgettoken(yychar);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if (yyctokenaction[index].token == yychar) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
unsigned char type = yyctokenaction[index].type;
|
||||||
|
short sr = yyctokenaction[index].sr;
|
||||||
|
|
||||||
|
// action
|
||||||
|
switch (type) {
|
||||||
|
case YYAT_SHIFT:
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydshift(yychar);
|
||||||
|
#endif
|
||||||
|
if (yyskip > 0) {
|
||||||
|
yysetskip(yyskip - 1);
|
||||||
|
}
|
||||||
|
if (!yypush(sr)) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydabort();
|
||||||
|
#endif
|
||||||
|
if (yywipeflg) {
|
||||||
|
yywipe(); // clean up
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
memcpy(&((char YYFAR*)yyattributestackptr)[yytop * yyattribute_size],
|
||||||
|
yylvalptr, yyattribute_size);
|
||||||
|
yylookahead = 0;
|
||||||
|
continue; // go to top of while loop
|
||||||
|
case YYAT_REDUCE:
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydreduce(sr);
|
||||||
|
#endif
|
||||||
|
yyretireflg = 0;
|
||||||
|
if (yyreduction[sr].action != -1) {
|
||||||
|
// user actions in here
|
||||||
|
if (yyreduction[sr].length > 0) {
|
||||||
|
memcpy(yyvalptr, &((char YYFAR*)yyattributestackptr)
|
||||||
|
[(yytop + 1 - yyreduction[sr].length) * yyattribute_size],
|
||||||
|
yyattribute_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
yyerrorflg = 0;
|
||||||
|
yyexitflg = 0;
|
||||||
|
yyaction(yyreduction[sr].action);
|
||||||
|
|
||||||
|
// check for special user requected actions
|
||||||
|
if (yyexitflg) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydexit(yyexitcode);
|
||||||
|
#endif
|
||||||
|
return yyexitcode;
|
||||||
|
}
|
||||||
|
if (yyerrorflg) {
|
||||||
|
errorpop = yyerrorpop;
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydthrowerror(yyerrorpop);
|
||||||
|
#endif
|
||||||
|
yyerrorcount++;
|
||||||
|
break; // go to error handler
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
yypop(yyreduction[sr].length);
|
||||||
|
{
|
||||||
|
yystack_t state = yypeek(); // get top state
|
||||||
|
|
||||||
|
int nonterm = yyreduction[sr].nonterm;
|
||||||
|
int index = yycstategoto[state];
|
||||||
|
while (1) {
|
||||||
|
if (yycnontermgoto[index].nonterm == -1) {
|
||||||
|
if (yycnontermgoto[index].next != -1) {
|
||||||
|
state = yycnontermgoto[index].next;
|
||||||
|
index = yycstategoto[state];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (yycnontermgoto[index].nonterm == nonterm) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
short next = yycnontermgoto[index].next;
|
||||||
|
yyassert(next != -1);
|
||||||
|
|
||||||
|
if (!yypush(next)) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydabort();
|
||||||
|
#endif
|
||||||
|
if (yywipeflg) {
|
||||||
|
yywipe(); // clean up
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (yyreduction[sr].action != -1) {
|
||||||
|
memcpy(&((char YYFAR*)yyattributestackptr)[yytop * yyattribute_size],
|
||||||
|
yyvalptr, yyattribute_size);
|
||||||
|
}
|
||||||
|
if (yyretireflg) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydretire(yyretirecode);
|
||||||
|
#endif
|
||||||
|
return yyretirecode;
|
||||||
|
}
|
||||||
|
continue; // go to top of while loop
|
||||||
|
case YYAT_ERROR:
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydsyntaxerror();
|
||||||
|
#endif
|
||||||
|
if (yyskip == 0) {
|
||||||
|
yyerrorcount++;
|
||||||
|
yysyntaxerror();
|
||||||
|
}
|
||||||
|
break; // go to error handler
|
||||||
|
default:
|
||||||
|
yyassert(type == YYAT_ACCEPT);
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydaccept();
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// error handler
|
||||||
|
if (yyskip < 3 || yyerrorpop > 0) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydattemptrecovery();
|
||||||
|
#endif
|
||||||
|
yypopflg = 0; // clear flag
|
||||||
|
while (yytop >= 0) {
|
||||||
|
state = yypeek(); // get top state
|
||||||
|
index = yycstateaction[state];
|
||||||
|
while (1) {
|
||||||
|
if (yyctokenaction[index].token == YYTK_ALL) {
|
||||||
|
if (yyctokenaction[index].type == YYAT_DEFAULT) {
|
||||||
|
state = yyctokenaction[index].sr;
|
||||||
|
index = yycstateaction[state];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (yyctokenaction[index].token == YYTK_ERROR) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
type = yyctokenaction[index].type;
|
||||||
|
sr = yyctokenaction[index].sr;
|
||||||
|
|
||||||
|
if (type == YYAT_SHIFT) {
|
||||||
|
if (errorpop <= 0) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydshift(YYTK_ERROR);
|
||||||
|
#endif
|
||||||
|
if (!yypush(sr)) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydabort();
|
||||||
|
#endif
|
||||||
|
if (yywipeflg) {
|
||||||
|
yywipe(); // clean up
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
yysetskip(3); // skip 3 erroneous characters
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
errorpop--;
|
||||||
|
}
|
||||||
|
|
||||||
|
yypopflg = 1;
|
||||||
|
|
||||||
|
// clean up any symbol attributes
|
||||||
|
if (yydestructorptr != NULL) {
|
||||||
|
state = yypeek();
|
||||||
|
int action = yydestructorptr[state];
|
||||||
|
if (action != -1) {
|
||||||
|
// user actions in here
|
||||||
|
memcpy(yyvalptr, &((char YYFAR*)yyattributestackptr)
|
||||||
|
[yytop * yyattribute_size], yyattribute_size);
|
||||||
|
|
||||||
|
yyaction(action);
|
||||||
|
|
||||||
|
memcpy(&((char YYFAR*)yyattributestackptr)
|
||||||
|
[yytop * yyattribute_size], yyvalptr, yyattribute_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yypop(1);
|
||||||
|
if (yytop < 0) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydabort();
|
||||||
|
#endif
|
||||||
|
if (yywipeflg) {
|
||||||
|
yywipe(); // clean up
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (yylookahead) {
|
||||||
|
if (yychar != 0) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yyddiscard(yychar);
|
||||||
|
#endif
|
||||||
|
yydiscard(yychar);
|
||||||
|
|
||||||
|
// clean up any token attributes
|
||||||
|
if (yyctokendestptr != NULL) {
|
||||||
|
const yyctokendest_t YYNEARFAR *tokendestptr = yyctokendestptr;
|
||||||
|
while (tokendestptr->token != 0) {
|
||||||
|
if (tokendestptr->token == yychar) {
|
||||||
|
// user actions in here
|
||||||
|
memcpy(yyvalptr, yylvalptr, yyattribute_size);
|
||||||
|
|
||||||
|
yyaction(tokendestptr->action);
|
||||||
|
|
||||||
|
memcpy(yylvalptr, yyvalptr, yyattribute_size);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
tokendestptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
yylookahead = 0; // skip erroneous character
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydabort();
|
||||||
|
#endif
|
||||||
|
if (yywipeflg) {
|
||||||
|
yywipe(); // clean up
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
39
Utils/Parser Generator/SOURCE/yycdeci.cpp
Normal file
39
Utils/Parser Generator/SOURCE/yycdeci.cpp
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
/************************************************************
|
||||||
|
yycdeci.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
// the Visual C++ v1.52 compiler generates an error in NT if this isn't present!
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#if defined(M_I86HM) && defined(NDEBUG)
|
||||||
|
#pragma function(memcpy)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void yyfparser::yydestructclearin()
|
||||||
|
{
|
||||||
|
if (yylookahead) {
|
||||||
|
// clean up any token attributes
|
||||||
|
if (yytokendestptr != NULL) {
|
||||||
|
int index = yytokendestbase + yychar;
|
||||||
|
if (index >= 0 && index < yytokendest_size) {
|
||||||
|
int action = yytokendestptr[index];
|
||||||
|
if (action != -1) {
|
||||||
|
// user actions in here
|
||||||
|
memcpy(yyvalptr, yylvalptr, yyattribute_size);
|
||||||
|
|
||||||
|
yyaction(action);
|
||||||
|
|
||||||
|
memcpy(yylvalptr, yyvalptr, yyattribute_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yylookahead = 0;
|
||||||
|
}
|
||||||
|
}
|
45
Utils/Parser Generator/SOURCE/yycdepop.cpp
Normal file
45
Utils/Parser Generator/SOURCE/yycdepop.cpp
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
/************************************************************
|
||||||
|
yycdepop.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
// the Visual C++ v1.52 compiler generates an error in NT if this isn't present!
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#if defined(M_I86HM) && defined(NDEBUG)
|
||||||
|
#pragma function(memcpy)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void yyparser::yydestructpop(int num)
|
||||||
|
{
|
||||||
|
yyassert(num >= 0);
|
||||||
|
yyassert(yytop - num >= -1);
|
||||||
|
|
||||||
|
if (yydestructorptr != NULL) {
|
||||||
|
while (num > 0) {
|
||||||
|
yystack_t state = yypeek();
|
||||||
|
int action = yydestructorptr[state];
|
||||||
|
if (action != -1) {
|
||||||
|
// user actions in here
|
||||||
|
memcpy(yyvalptr, &((char YYFAR*)yyattributestackptr)
|
||||||
|
[yytop * yyattribute_size], yyattribute_size);
|
||||||
|
|
||||||
|
yyaction(action);
|
||||||
|
|
||||||
|
memcpy(&((char YYFAR*)yyattributestackptr)
|
||||||
|
[yytop * yyattribute_size], yyvalptr, yyattribute_size);
|
||||||
|
}
|
||||||
|
yypop(1);
|
||||||
|
num--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yypop(num);
|
||||||
|
}
|
||||||
|
}
|
20
Utils/Parser Generator/SOURCE/yycdisc.cpp
Normal file
20
Utils/Parser Generator/SOURCE/yycdisc.cpp
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/************************************************************
|
||||||
|
yycdisc.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma argsused
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void yyparser::yydiscard(int token)
|
||||||
|
{
|
||||||
|
yyassert(token > 0);
|
||||||
|
// do nothing
|
||||||
|
}
|
67
Utils/Parser Generator/SOURCE/yycdoutp.cpp
Normal file
67
Utils/Parser Generator/SOURCE/yycdoutp.cpp
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
/************************************************************
|
||||||
|
yycdoutp.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
void yylexer::yydebugoutput(int ch) const
|
||||||
|
{
|
||||||
|
char string[32];
|
||||||
|
switch (ch) {
|
||||||
|
case EOF:
|
||||||
|
strcpy(string, "EOF");
|
||||||
|
break;
|
||||||
|
case '\n':
|
||||||
|
strcpy(string, "\\n");
|
||||||
|
break;
|
||||||
|
case '\t':
|
||||||
|
strcpy(string, "\\t");
|
||||||
|
break;
|
||||||
|
case '\v':
|
||||||
|
strcpy(string, "\\v");
|
||||||
|
break;
|
||||||
|
case '\b':
|
||||||
|
strcpy(string, "\\b");
|
||||||
|
break;
|
||||||
|
case '\r':
|
||||||
|
strcpy(string, "\\r");
|
||||||
|
break;
|
||||||
|
case '\f':
|
||||||
|
strcpy(string, "\\f");
|
||||||
|
break;
|
||||||
|
case '\a':
|
||||||
|
strcpy(string, "\\a");
|
||||||
|
break;
|
||||||
|
case '\\':
|
||||||
|
strcpy(string, "\\");
|
||||||
|
break;
|
||||||
|
case '\?':
|
||||||
|
strcpy(string, "\\\?");
|
||||||
|
break;
|
||||||
|
case '\'':
|
||||||
|
strcpy(string, "\\\'");
|
||||||
|
break;
|
||||||
|
case '\"':
|
||||||
|
strcpy(string, "\\\"");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (isascii(ch) && isgraph(ch)) {
|
||||||
|
string[0] = (char)ch;
|
||||||
|
string[1] = '\0';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sprintf(string, "\\%03o", (unsigned int)(unsigned char)ch);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
17
Utils/Parser Generator/SOURCE/yycecho.cpp
Normal file
17
Utils/Parser Generator/SOURCE/yycecho.cpp
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
/************************************************************
|
||||||
|
yycecho.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
void yylexer::yyecho()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < yyleng; i++) {
|
||||||
|
yyoutput(yytext[i]);
|
||||||
|
}
|
||||||
|
}
|
20
Utils/Parser Generator/SOURCE/yycerror.cpp
Normal file
20
Utils/Parser Generator/SOURCE/yycerror.cpp
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/************************************************************
|
||||||
|
yycerror.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
void yyparser::yyerror(const char YYFAR* text)
|
||||||
|
{
|
||||||
|
yyassert(text != NULL);
|
||||||
|
yyassert(yyerr != NULL);
|
||||||
|
while (*text != '\0') {
|
||||||
|
putc(*text++, yyerr);
|
||||||
|
}
|
||||||
|
putc('\n', yyerr);
|
||||||
|
}
|
214
Utils/Parser Generator/SOURCE/yycflex.cpp
Normal file
214
Utils/Parser Generator/SOURCE/yycflex.cpp
Normal file
|
@ -0,0 +1,214 @@
|
||||||
|
/************************************************************
|
||||||
|
yycflex.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
int yyflexer::yylex()
|
||||||
|
{
|
||||||
|
while (1) {
|
||||||
|
int state = 1 + yystart;
|
||||||
|
if (yyeol) {
|
||||||
|
state++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// yymore
|
||||||
|
if (yymoreflg) {
|
||||||
|
yymoreflg = 0; // clear flag
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yyleng = 0;
|
||||||
|
yyoldeol = yyeol;
|
||||||
|
}
|
||||||
|
int oldleng = yyleng;
|
||||||
|
|
||||||
|
// look for a string
|
||||||
|
do {
|
||||||
|
// get input character (look ahead character)
|
||||||
|
int ch = yyinput();
|
||||||
|
yyassert(ch >= 0 && ch <= UCHAR_MAX || ch == EOF);
|
||||||
|
if (ch == EOF) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check for possible overflow
|
||||||
|
if (yyleng == yytext_size) {
|
||||||
|
do {
|
||||||
|
if (yytextgrow) {
|
||||||
|
if (yytext_size != 0) {
|
||||||
|
int size = yytext_size * 2;
|
||||||
|
if (size / 2 == yytext_size) { // overflow check
|
||||||
|
if (yysettextsize(size)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (yysettextsize(100)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yytextoverflow();
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
while (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// look for a transition
|
||||||
|
do {
|
||||||
|
int index = yystate[state].base + ch;
|
||||||
|
if (index >= 0 && index < yytransitionmax) {
|
||||||
|
if (yytransition[index].check == state) {
|
||||||
|
state = yytransition[index].next;
|
||||||
|
break; // found a transition
|
||||||
|
}
|
||||||
|
}
|
||||||
|
state = yystate[state].def;
|
||||||
|
if (state < 0) {
|
||||||
|
if (ch >= 0 && ch <= 0xff) {
|
||||||
|
state = -state;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
state = 0;
|
||||||
|
}
|
||||||
|
break; // default transition
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (state != 0);
|
||||||
|
|
||||||
|
int leng = yyleng; // slightly more efficient
|
||||||
|
yytext[leng] = (char)ch;
|
||||||
|
yystatebuf[leng] = state;
|
||||||
|
leng++;
|
||||||
|
yyleng = leng;
|
||||||
|
}
|
||||||
|
while (state != 0 && (yystate[state].def != 0 || yystate[state].base != 0));
|
||||||
|
|
||||||
|
// now find a match
|
||||||
|
if (yyleng > oldleng) {
|
||||||
|
int rejectmatch = 0;
|
||||||
|
while (1) {
|
||||||
|
int match = yystate[yystatebuf[yyleng - 1]].match;
|
||||||
|
if (rejectmatch != 0) {
|
||||||
|
if (match < 0) {
|
||||||
|
int index = -match;
|
||||||
|
do {
|
||||||
|
match = yymatch[index++];
|
||||||
|
}
|
||||||
|
while (match > 0 && match <= rejectmatch);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (match == rejectmatch) {
|
||||||
|
match = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rejectmatch = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (match < 0) {
|
||||||
|
match = yymatch[-match];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (match > 0) {
|
||||||
|
// check for backup
|
||||||
|
if (yybackup[match]) {
|
||||||
|
while (yyleng > oldleng) {
|
||||||
|
int index = yystate[yystatebuf[yyleng - 1]].match;
|
||||||
|
if (index < 0) {
|
||||||
|
if (yyback(&yymatch[-index], -match)) {
|
||||||
|
break; // found an expression
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yyleng--;
|
||||||
|
yyunput((unsigned char)yytext[yyleng]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yytext[yyleng] = '\0';
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydmatch(match);
|
||||||
|
#endif
|
||||||
|
yyrejectflg = 0; // clear flag
|
||||||
|
int rejectleng = yyleng;
|
||||||
|
|
||||||
|
if (yyleng > 0) {
|
||||||
|
yyeol = (unsigned char)(yytext[yyleng - 1] == '\n');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yyeol = yyoldeol;
|
||||||
|
}
|
||||||
|
|
||||||
|
// perform user action
|
||||||
|
int token = yyaction(match);
|
||||||
|
|
||||||
|
if (yyreturnflg) {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
if (!yyrejectflg) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (rejectleng == yyleng) {
|
||||||
|
rejectmatch = match;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (yyleng > oldleng + 1) {
|
||||||
|
yyleng--;
|
||||||
|
yyunput((unsigned char)yytext[yyleng]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yyeol = (unsigned char)(yytext[0] == '\n');
|
||||||
|
yyoutput(yytext[0]); // non-matched character
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yyassert(yyleng == oldleng);
|
||||||
|
|
||||||
|
// handles <<EOF>> rules
|
||||||
|
int index = 0;
|
||||||
|
int match = yystate[state].match;
|
||||||
|
if (match < 0) {
|
||||||
|
index = -match;
|
||||||
|
match = yymatch[index++];
|
||||||
|
}
|
||||||
|
while (match > 0) {
|
||||||
|
yytext[yyleng] = '\0';
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydmatch(match);
|
||||||
|
#endif
|
||||||
|
yyrejectflg = 0; // clear flag
|
||||||
|
|
||||||
|
// perform user action
|
||||||
|
int token = yyaction(match);
|
||||||
|
|
||||||
|
if (yyreturnflg) {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
if (!yyrejectflg) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
match = yymatch[index++];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (yywrap()) {
|
||||||
|
yyoldeol = 1;
|
||||||
|
yyeol = 1;
|
||||||
|
yystart = 0;
|
||||||
|
return 0; // eof reached
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
16
Utils/Parser Generator/SOURCE/yycgetch.cpp
Normal file
16
Utils/Parser Generator/SOURCE/yycgetch.cpp
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/************************************************************
|
||||||
|
yycgetch.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
int yylexer::yygetchar()
|
||||||
|
{
|
||||||
|
yyassert(yyin != NULL);
|
||||||
|
return getc(yyin);
|
||||||
|
}
|
16
Utils/Parser Generator/SOURCE/yycgtok.cpp
Normal file
16
Utils/Parser Generator/SOURCE/yycgtok.cpp
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/************************************************************
|
||||||
|
yycgtok.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "cyacc.h"
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
int yyparser::yygettoken()
|
||||||
|
{
|
||||||
|
yyassert(yylexerptr != NULL);
|
||||||
|
return yylexerptr->yylex();
|
||||||
|
}
|
38
Utils/Parser Generator/SOURCE/yycinput.cpp
Normal file
38
Utils/Parser Generator/SOURCE/yycinput.cpp
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/************************************************************
|
||||||
|
yycinput.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
int yylexer::yyinput()
|
||||||
|
{
|
||||||
|
int ch;
|
||||||
|
if (yyunputindex > 0) {
|
||||||
|
ch = yyunputbufptr[--yyunputindex];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ch = yygetchar();
|
||||||
|
}
|
||||||
|
if (ch == '\n') {
|
||||||
|
yylineno++;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: input: \'", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
yydebugoutput(ch);
|
||||||
|
yydebugoutput("\'\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return ch;
|
||||||
|
}
|
35
Utils/Parser Generator/SOURCE/yyclcln.cpp
Normal file
35
Utils/Parser Generator/SOURCE/yyclcln.cpp
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/************************************************************
|
||||||
|
yyclcln.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
void yylexer::yycleanup()
|
||||||
|
{
|
||||||
|
if (yytext != yystext) {
|
||||||
|
free(yytext);
|
||||||
|
yytext = yystext;
|
||||||
|
}
|
||||||
|
if (yystatebuf != yysstatebuf) {
|
||||||
|
free(yystatebuf);
|
||||||
|
yystatebuf = yysstatebuf;
|
||||||
|
}
|
||||||
|
if (yyunputbufptr != yysunputbufptr) {
|
||||||
|
free(yyunputbufptr);
|
||||||
|
yyunputbufptr = yysunputbufptr;
|
||||||
|
}
|
||||||
|
yytext_size = yystext_size;
|
||||||
|
yyunput_size = yysunput_size;
|
||||||
|
|
||||||
|
if (yytext != NULL) {
|
||||||
|
*yytext = '\0';
|
||||||
|
}
|
||||||
|
yyleng = 0;
|
||||||
|
yyunputindex = 0;
|
||||||
|
}
|
50
Utils/Parser Generator/SOURCE/yyclcon.cpp
Normal file
50
Utils/Parser Generator/SOURCE/yyclcon.cpp
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
/************************************************************
|
||||||
|
yyclcon.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
yylexer::yylexer()
|
||||||
|
{
|
||||||
|
yystart = 0;
|
||||||
|
yyeol = 1;
|
||||||
|
yyoldeol = 1;
|
||||||
|
yystatebuf = NULL;
|
||||||
|
yysstatebuf = NULL;
|
||||||
|
yystext = NULL;
|
||||||
|
yytext_size = 0;
|
||||||
|
yystext_size = 0;
|
||||||
|
yyunputbufptr = NULL;
|
||||||
|
yysunputbufptr = NULL;
|
||||||
|
yyunput_size = 0;
|
||||||
|
yysunput_size = 0;
|
||||||
|
yyunputindex = 0;
|
||||||
|
yymoreflg = 0;
|
||||||
|
yyrejectflg = 0;
|
||||||
|
yyreturnflg = 0;
|
||||||
|
yyparserptr = NULL;
|
||||||
|
yytextgrow = 1;
|
||||||
|
yyunputgrow = 1;
|
||||||
|
yyin = stdin;
|
||||||
|
yyout = stdout;
|
||||||
|
yyerr = stderr;
|
||||||
|
yytext = NULL;
|
||||||
|
yyleng = 0;
|
||||||
|
yylineno = 1;
|
||||||
|
|
||||||
|
// debugging
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydebug = 0;
|
||||||
|
yydebugflush = 0;
|
||||||
|
yydebugout = stdout;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
yylexer::~yylexer()
|
||||||
|
{
|
||||||
|
yydestroy();
|
||||||
|
}
|
82
Utils/Parser Generator/SOURCE/yyclcrea.cpp
Normal file
82
Utils/Parser Generator/SOURCE/yyclcrea.cpp
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
/************************************************************
|
||||||
|
yyclcrea.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "clex.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int yylexer::yycreate(yyparser YYFAR* parserptr)
|
||||||
|
{
|
||||||
|
yyparserptr = parserptr;
|
||||||
|
|
||||||
|
size_t textcharsize;
|
||||||
|
size_t statebufcharsize;
|
||||||
|
size_t unputbufcharsize;
|
||||||
|
|
||||||
|
// get sizes first
|
||||||
|
textcharsize = yystext_size + 1; // include the '\0'
|
||||||
|
if (textcharsize <= (size_t)yystext_size) {
|
||||||
|
return 0; // integer overflow
|
||||||
|
}
|
||||||
|
if (yystext_size != 0) {
|
||||||
|
statebufcharsize = yystext_size * sizeof(int);
|
||||||
|
if ((int)(statebufcharsize / sizeof(int)) != yystext_size) {
|
||||||
|
return 0; // integer overflow
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
statebufcharsize = 0;
|
||||||
|
}
|
||||||
|
if (yysunput_size != 0) {
|
||||||
|
unputbufcharsize = yysunput_size * sizeof(int);
|
||||||
|
if ((int)(unputbufcharsize / sizeof(int)) != yysunput_size) {
|
||||||
|
return 0; // integer overflow
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
unputbufcharsize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// allocate the memory if necessary
|
||||||
|
yystext = (char YYFAR*)malloc(textcharsize);
|
||||||
|
if (yystext == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (statebufcharsize != 0) {
|
||||||
|
yysstatebuf = (int YYFAR*)malloc(statebufcharsize);
|
||||||
|
if (yysstatebuf == NULL) {
|
||||||
|
free(yystext);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yysstatebuf = NULL;
|
||||||
|
}
|
||||||
|
if (unputbufcharsize != 0) {
|
||||||
|
yysunputbufptr = (int YYFAR*)malloc(unputbufcharsize);
|
||||||
|
if (yysunputbufptr == NULL) {
|
||||||
|
free(yystext);
|
||||||
|
free(yysstatebuf);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yysunputbufptr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// assign any other variables
|
||||||
|
yytext_size = yystext_size;
|
||||||
|
yytext = yystext;
|
||||||
|
yystatebuf = yysstatebuf;
|
||||||
|
yyunput_size = yysunput_size;
|
||||||
|
yyunputbufptr = yysunputbufptr;
|
||||||
|
|
||||||
|
// makes sure we are ready to go
|
||||||
|
yyreset();
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
57
Utils/Parser Generator/SOURCE/yycldbug.cpp
Normal file
57
Utils/Parser Generator/SOURCE/yycldbug.cpp
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
/************************************************************
|
||||||
|
yycldbug.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#include <winbase.h>
|
||||||
|
#endif
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
|
||||||
|
void yylexer::yydmatch(int expr) const
|
||||||
|
{
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: match: \"", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
for (int i = 0; i < yyleng; i++) {
|
||||||
|
yydebugoutput(yytext[i]);
|
||||||
|
}
|
||||||
|
sprintf(string, "\", %d\n", (int)expr);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void yylexer::yydebugoutput(const char *string) const
|
||||||
|
{
|
||||||
|
yyassert(string != NULL);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (yydebugout != NULL) {
|
||||||
|
#else
|
||||||
|
yyassert(yydebugout != NULL);
|
||||||
|
#endif
|
||||||
|
while (*string != '\0') {
|
||||||
|
putc(*string++, yydebugout);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (::yydebugflush || yydebugflush) {
|
||||||
|
fflush(yydebugout);
|
||||||
|
}
|
||||||
|
#ifdef _WIN32
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
OutputDebugString(string);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
18
Utils/Parser Generator/SOURCE/yycldest.cpp
Normal file
18
Utils/Parser Generator/SOURCE/yycldest.cpp
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/************************************************************
|
||||||
|
yycldest.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "clex.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
void yylexer::yydestroy()
|
||||||
|
{
|
||||||
|
yycleanup();
|
||||||
|
free(yystext);
|
||||||
|
free(yysstatebuf);
|
||||||
|
free(yysunputbufptr);
|
||||||
|
}
|
23
Utils/Parser Generator/SOURCE/yycless.cpp
Normal file
23
Utils/Parser Generator/SOURCE/yycless.cpp
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/************************************************************
|
||||||
|
yycless.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
void yylexer::yyless(int length)
|
||||||
|
{
|
||||||
|
yyassert(length >= 0 && length <= yyleng);
|
||||||
|
while (yyleng > length) {
|
||||||
|
yyunput((unsigned char)yytext[--yyleng]);
|
||||||
|
}
|
||||||
|
if (yyleng > 0) {
|
||||||
|
yyeol = (unsigned char)(yytext[yyleng - 1] == '\n');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yyeol = yyoldeol;
|
||||||
|
}
|
||||||
|
}
|
34
Utils/Parser Generator/SOURCE/yycoutpt.cpp
Normal file
34
Utils/Parser Generator/SOURCE/yycoutpt.cpp
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
/************************************************************
|
||||||
|
yycoutpt.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
void yylexer::yyoutput(int ch)
|
||||||
|
{
|
||||||
|
// debugging
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: output: \'", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
yydebugoutput(ch);
|
||||||
|
yydebugoutput("\'\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
yyassert(yyout != NULL);
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
putc((char)ch, yyout);
|
||||||
|
#else
|
||||||
|
putc(ch, yyout);
|
||||||
|
#endif
|
||||||
|
}
|
18
Utils/Parser Generator/SOURCE/yycparse.cpp
Normal file
18
Utils/Parser Generator/SOURCE/yycparse.cpp
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/************************************************************
|
||||||
|
yycparse.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
int yyparser::yyparse()
|
||||||
|
{
|
||||||
|
int n = yysetup();
|
||||||
|
if (n != 0) {
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
return yywork();
|
||||||
|
}
|
25
Utils/Parser Generator/SOURCE/yycpcln.cpp
Normal file
25
Utils/Parser Generator/SOURCE/yycpcln.cpp
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/************************************************************
|
||||||
|
yycpcln.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
void yyparser::yycleanup()
|
||||||
|
{
|
||||||
|
if (yystackptr != yysstackptr) {
|
||||||
|
free(yystackptr);
|
||||||
|
yystackptr = yysstackptr;
|
||||||
|
}
|
||||||
|
if (yyattributestackptr != yysattributestackptr) {
|
||||||
|
free(yyattributestackptr);
|
||||||
|
yyattributestackptr = yysattributestackptr;
|
||||||
|
}
|
||||||
|
yystack_size = yysstack_size;
|
||||||
|
|
||||||
|
yytop = -1;
|
||||||
|
}
|
50
Utils/Parser Generator/SOURCE/yycpcon.cpp
Normal file
50
Utils/Parser Generator/SOURCE/yycpcon.cpp
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
/************************************************************
|
||||||
|
yycpcon.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
yyparser::yyparser()
|
||||||
|
{
|
||||||
|
yystackptr = NULL;
|
||||||
|
yysstackptr = NULL;
|
||||||
|
yyattributestackptr = NULL;
|
||||||
|
yysattributestackptr = NULL;
|
||||||
|
yystack_size = 0;
|
||||||
|
yysstack_size = 0;
|
||||||
|
yytop = -1;
|
||||||
|
yyattribute_size = 0;
|
||||||
|
yyvalptr = NULL;
|
||||||
|
yylookahead = 0;
|
||||||
|
yychar = -1;
|
||||||
|
yywipeflg = 1;
|
||||||
|
yypopflg = 0;
|
||||||
|
yyskip = 0;
|
||||||
|
yyexitflg = 0;
|
||||||
|
yyretireflg = 0;
|
||||||
|
yyerrorflg = 0;
|
||||||
|
yyexitcode = 0;
|
||||||
|
yyretirecode = 0;
|
||||||
|
yyerrorpop = 0;
|
||||||
|
yylexerptr = NULL;
|
||||||
|
yystackgrow = 1;
|
||||||
|
yylvalptr = NULL;
|
||||||
|
yyerr = stderr;
|
||||||
|
yyerrorcount = 0;
|
||||||
|
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydebug = 0;
|
||||||
|
yydebugstack = 0;
|
||||||
|
yydebugflush = 0;
|
||||||
|
yydebugout = stdout;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
yyparser::~yyparser()
|
||||||
|
{
|
||||||
|
yydestroy();
|
||||||
|
}
|
66
Utils/Parser Generator/SOURCE/yycpcrea.cpp
Normal file
66
Utils/Parser Generator/SOURCE/yycpcrea.cpp
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
/************************************************************
|
||||||
|
yycpcrea.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "cyacc.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int yyparser::yycreate(yylexer YYFAR* lexerptr)
|
||||||
|
{
|
||||||
|
yylexerptr = lexerptr;
|
||||||
|
|
||||||
|
// stack
|
||||||
|
if (yysstack_size != 0) {
|
||||||
|
size_t stackcharsize;
|
||||||
|
size_t attributestackcharsize;
|
||||||
|
|
||||||
|
stackcharsize = yysstack_size * sizeof(yystack_t);
|
||||||
|
if ((int)(stackcharsize / sizeof(yystack_t)) != yysstack_size) {
|
||||||
|
return 0; // integer overflow
|
||||||
|
}
|
||||||
|
attributestackcharsize = yysstack_size * yyattribute_size;
|
||||||
|
if ((int)(attributestackcharsize / yyattribute_size) != yysstack_size) {
|
||||||
|
return 0; // integer overflow
|
||||||
|
}
|
||||||
|
|
||||||
|
yysstackptr = (yystack_t YYFAR*)malloc(stackcharsize);
|
||||||
|
if (yysstackptr == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
yysattributestackptr = malloc(attributestackcharsize);
|
||||||
|
if (yysattributestackptr == NULL) {
|
||||||
|
free(yysstackptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yysstackptr = NULL;
|
||||||
|
yysattributestackptr = NULL;
|
||||||
|
}
|
||||||
|
yystack_size = yysstack_size;
|
||||||
|
yystackptr = yysstackptr;
|
||||||
|
yyattributestackptr = yysattributestackptr;
|
||||||
|
|
||||||
|
// yylval
|
||||||
|
yylvalptr = malloc(yyattribute_size);
|
||||||
|
if (yylvalptr == NULL) {
|
||||||
|
free(yysstackptr);
|
||||||
|
free(yysattributestackptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// yyval ($$)
|
||||||
|
yyvalptr = malloc(yyattribute_size);
|
||||||
|
if (yyvalptr == NULL) {
|
||||||
|
free(yysstackptr);
|
||||||
|
free(yysattributestackptr);
|
||||||
|
free(yylvalptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
189
Utils/Parser Generator/SOURCE/yycpdbug.cpp
Normal file
189
Utils/Parser Generator/SOURCE/yycpdbug.cpp
Normal file
|
@ -0,0 +1,189 @@
|
||||||
|
/************************************************************
|
||||||
|
yycpdbug.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#include <winbase.h>
|
||||||
|
#endif
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
|
||||||
|
const char* yyparser::yytokenstring(int token) const
|
||||||
|
{
|
||||||
|
yyassert(token >= 0);
|
||||||
|
|
||||||
|
const yysymbol_t YYNEARFAR* symbol = yysymbol;
|
||||||
|
while (symbol->name != NULL) {
|
||||||
|
if (symbol->token == token) {
|
||||||
|
return symbol->name;
|
||||||
|
}
|
||||||
|
symbol++;
|
||||||
|
}
|
||||||
|
return "illegal-token";
|
||||||
|
}
|
||||||
|
|
||||||
|
void yyparser::yydgettoken(int token) const
|
||||||
|
{
|
||||||
|
yyassert(token >= 0);
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
const char* tokenstring = yytokenstring(token);
|
||||||
|
yyassert(tokenstring != NULL);
|
||||||
|
|
||||||
|
sprintf(string, "%p: get token ", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
yydebugoutput(tokenstring);
|
||||||
|
sprintf(string, " (%d)\n", (int)token);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void yyparser::yydshift(int token) const
|
||||||
|
{
|
||||||
|
yyassert(token >= 0);
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
const char* tokenstring = yytokenstring(token);
|
||||||
|
yyassert(tokenstring != NULL);
|
||||||
|
|
||||||
|
sprintf(string, "%p: shift token ", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
yydebugoutput(tokenstring);
|
||||||
|
sprintf(string, " (%d)\n", (int)token);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void yyparser::yydreduce(int rule) const
|
||||||
|
{
|
||||||
|
yyassert(rule >= 0);
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: reduce rule ", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
yydebugoutput(yyrule[rule]);
|
||||||
|
sprintf(string, " (%d)\n", (int)rule);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void yyparser::yydsyntaxerror() const
|
||||||
|
{
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: syntax error\n", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void yyparser::yydaccept() const
|
||||||
|
{
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: accept\n", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void yyparser::yydabort() const
|
||||||
|
{
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: abort\n", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void yyparser::yyddiscard(int token) const
|
||||||
|
{
|
||||||
|
yyassert(token >= 0);
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
const char* tokenstring = yytokenstring(token);
|
||||||
|
yyassert(tokenstring != NULL);
|
||||||
|
|
||||||
|
sprintf(string, "%p: discard token ", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
yydebugoutput(tokenstring);
|
||||||
|
sprintf(string, " (%d)\n", (int)token);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void yyparser::yydexit(int exitcode) const
|
||||||
|
{
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: exit with code %d\n", (void*)this, (int)exitcode);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void yyparser::yydthrowerror(int errorpop) const
|
||||||
|
{
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: throw error and pop %d error handling state(s)\n",
|
||||||
|
(void*)this, (int)errorpop);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void yyparser::yydretire(int retirecode) const
|
||||||
|
{
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: retire with code %d\n", (void*)this, (int)retirecode);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void yyparser::yydattemptrecovery() const
|
||||||
|
{
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: attempting error recovery\n", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void yyparser::yydebugoutput(const char *string) const
|
||||||
|
{
|
||||||
|
yyassert(string != NULL);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (yydebugout != NULL) {
|
||||||
|
#else
|
||||||
|
yyassert(yydebugout != NULL);
|
||||||
|
#endif
|
||||||
|
while (*string != '\0') {
|
||||||
|
putc(*string++, yydebugout);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (::yydebugflush || yydebugflush) {
|
||||||
|
fflush(yydebugout);
|
||||||
|
}
|
||||||
|
#ifdef _WIN32
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
OutputDebugString(string);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
20
Utils/Parser Generator/SOURCE/yycpdest.cpp
Normal file
20
Utils/Parser Generator/SOURCE/yycpdest.cpp
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/************************************************************
|
||||||
|
yycpdest.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "cyacc.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
void yyparser::yydestroy()
|
||||||
|
{
|
||||||
|
yycleanup();
|
||||||
|
free(yysstackptr);
|
||||||
|
free(yysattributestackptr);
|
||||||
|
|
||||||
|
free(yylvalptr);
|
||||||
|
free(yyvalptr);
|
||||||
|
}
|
33
Utils/Parser Generator/SOURCE/yycpop.cpp
Normal file
33
Utils/Parser Generator/SOURCE/yycpop.cpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/************************************************************
|
||||||
|
yycpop.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
void yyparser::yypop(int num)
|
||||||
|
{
|
||||||
|
yyassert(num >= 0);
|
||||||
|
yytop -= num;
|
||||||
|
yyassert(yytop >= -1);
|
||||||
|
|
||||||
|
// debugging
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
if (num > 0) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: pop %d state(s)", (void*)this, (int)num);
|
||||||
|
yydebugoutput(string);
|
||||||
|
if (yytop >= 0) {
|
||||||
|
sprintf(string, " uncovering state %d", (int)yystackptr[yytop]);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
yydebugoutput("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
98
Utils/Parser Generator/SOURCE/yycpush.cpp
Normal file
98
Utils/Parser Generator/SOURCE/yycpush.cpp
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
/************************************************************
|
||||||
|
yycpush.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
int yyparser::yypush(yystack_t state)
|
||||||
|
{
|
||||||
|
yytop++; // increment first
|
||||||
|
if (yytop == yystack_size) {
|
||||||
|
do {
|
||||||
|
if (yystackgrow) {
|
||||||
|
if (yystack_size != 0) {
|
||||||
|
int size = yystack_size * 2;
|
||||||
|
if (size / 2 == yystack_size) { // overflow check
|
||||||
|
if (yysetstacksize(size)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (yysetstacksize(100)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yytop--;
|
||||||
|
|
||||||
|
// debugging
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: stack overflow\n", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
yystackoverflow();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
while (0);
|
||||||
|
}
|
||||||
|
yystackptr[yytop] = state;
|
||||||
|
|
||||||
|
// debugging
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: push state %d", (void*)this, (int)state);
|
||||||
|
yydebugoutput(string);
|
||||||
|
if (yytop > 0) {
|
||||||
|
sprintf(string, " covering state %d", (int)yystackptr[yytop - 1]);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
yydebugoutput("\n");
|
||||||
|
|
||||||
|
// output stack contents
|
||||||
|
if (::yydebugstack || yydebugstack) {
|
||||||
|
yydebugoutput("\nstack");
|
||||||
|
int n = sprintf(string, "\n +");
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < 10; i++) {
|
||||||
|
n += sprintf(&string[n], " %5d", (int) i);
|
||||||
|
}
|
||||||
|
yydebugoutput(string);
|
||||||
|
|
||||||
|
int rows = 1;
|
||||||
|
if (yytop >= 0) {
|
||||||
|
rows += yytop / 10;
|
||||||
|
}
|
||||||
|
for (i = 0; i < rows; i++) {
|
||||||
|
n = sprintf(string, "\n %5d", (int) (10 * i));
|
||||||
|
for (int j = 0; j < 10; j++) {
|
||||||
|
int index = 10 * i + j;
|
||||||
|
if (index <= yytop) {
|
||||||
|
n += sprintf(&string[n], " %5d", (int) yystackptr[index]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
n += sprintf(&string[n], " -");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
yydebugoutput("\n\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
21
Utils/Parser Generator/SOURCE/yycreset.cpp
Normal file
21
Utils/Parser Generator/SOURCE/yycreset.cpp
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
/************************************************************
|
||||||
|
yycreset.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
void yylexer::yyreset()
|
||||||
|
{
|
||||||
|
yyleng = 0;
|
||||||
|
yylineno = 1;
|
||||||
|
yyunputindex = 0;
|
||||||
|
yymoreflg = 0;
|
||||||
|
yyrejectflg = 0;
|
||||||
|
yyeol = 1;
|
||||||
|
yyoldeol = 1;
|
||||||
|
yystart = 0;
|
||||||
|
}
|
18
Utils/Parser Generator/SOURCE/yycsetin.cpp
Normal file
18
Utils/Parser Generator/SOURCE/yycsetin.cpp
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/************************************************************
|
||||||
|
yycsetin.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
void yyparser::yysetin(int token)
|
||||||
|
{
|
||||||
|
if (token < 0) {
|
||||||
|
token = 0;
|
||||||
|
}
|
||||||
|
yychar = token;
|
||||||
|
yylookahead = 1;
|
||||||
|
}
|
29
Utils/Parser Generator/SOURCE/yycsetup.cpp
Normal file
29
Utils/Parser Generator/SOURCE/yycsetup.cpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/************************************************************
|
||||||
|
yycsetup.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
int yyparser::yysetup()
|
||||||
|
{
|
||||||
|
// initialise variables
|
||||||
|
yytop = -1;
|
||||||
|
yylookahead = 0;
|
||||||
|
yyskip = 0;
|
||||||
|
yyerrorcount = 0;
|
||||||
|
yychar = -1;
|
||||||
|
yypopflg = 0;
|
||||||
|
|
||||||
|
// push initial state onto the stack
|
||||||
|
if (!yypush(0)) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydabort();
|
||||||
|
#endif
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
15
Utils/Parser Generator/SOURCE/yycsoflw.cpp
Normal file
15
Utils/Parser Generator/SOURCE/yycsoflw.cpp
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/************************************************************
|
||||||
|
yycsoflw.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
void yyparser::yystackoverflow()
|
||||||
|
{
|
||||||
|
yyerror("yacc stack overflow");
|
||||||
|
}
|
39
Utils/Parser Generator/SOURCE/yycsskip.cpp
Normal file
39
Utils/Parser Generator/SOURCE/yycsskip.cpp
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
/************************************************************
|
||||||
|
yycsskip.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
void yyparser::yysetskip(int skip)
|
||||||
|
{
|
||||||
|
yyassert(skip >= 0);
|
||||||
|
|
||||||
|
// debugging
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
if (skip > 0) {
|
||||||
|
if (yyskip == 0) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: entering error recovery\n", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (yyskip > 0) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: leaving error recovery\n", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
yyskip = skip;
|
||||||
|
}
|
||||||
|
#endif
|
85
Utils/Parser Generator/SOURCE/yycsssiz.cpp
Normal file
85
Utils/Parser Generator/SOURCE/yycsssiz.cpp
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
/************************************************************
|
||||||
|
yycsssiz.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
#ifndef min
|
||||||
|
#define min(x, y) ((x) <= (y) ? (x) : (y))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// the Visual C++ v1.52 compiler generates an error in NT if this isn't present!
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#if defined(M_I86HM) && defined(NDEBUG)
|
||||||
|
#pragma function(memcpy)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int yyparser::yysetstacksize(int size)
|
||||||
|
{
|
||||||
|
yyassert(size >= 0);
|
||||||
|
if (yystack_size != size) {
|
||||||
|
if (size <= yytop) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t stackcharsize = size * sizeof(yystack_t);
|
||||||
|
if ((int)(stackcharsize / sizeof(yystack_t)) != size) {
|
||||||
|
return 0; // integer overflow
|
||||||
|
}
|
||||||
|
size_t attributestackcharsize = size * yyattribute_size;
|
||||||
|
if ((int)(attributestackcharsize / yyattribute_size) != size) {
|
||||||
|
return 0; // integer overflow
|
||||||
|
}
|
||||||
|
|
||||||
|
// allocate
|
||||||
|
yystack_t YYFAR* stackptr;
|
||||||
|
void YYFAR* attributestackptr;
|
||||||
|
if (size <= yysstack_size) {
|
||||||
|
stackptr = yysstackptr;
|
||||||
|
attributestackptr = yysattributestackptr;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
stackptr = (yystack_t YYFAR*)malloc(stackcharsize);
|
||||||
|
if (stackptr == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
attributestackptr = malloc(attributestackcharsize);
|
||||||
|
if (attributestackptr == NULL) {
|
||||||
|
free(stackptr); // clean up
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy
|
||||||
|
if (stackptr != yystackptr) {
|
||||||
|
size_t charsize = yystack_size * sizeof(yystack_t);
|
||||||
|
memcpy(stackptr, yystackptr, min(stackcharsize, charsize));
|
||||||
|
}
|
||||||
|
if (attributestackptr != yyattributestackptr) {
|
||||||
|
size_t charsize = yystack_size * yyattribute_size;
|
||||||
|
memcpy(attributestackptr, yyattributestackptr, min(attributestackcharsize,
|
||||||
|
charsize));
|
||||||
|
}
|
||||||
|
|
||||||
|
// free
|
||||||
|
if (yystackptr != yysstackptr) {
|
||||||
|
free(yystackptr);
|
||||||
|
}
|
||||||
|
if (yyattributestackptr != yysattributestackptr) {
|
||||||
|
free(yyattributestackptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
// assign
|
||||||
|
yystackptr = stackptr;
|
||||||
|
yyattributestackptr = attributestackptr;
|
||||||
|
yystack_size = size;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
84
Utils/Parser Generator/SOURCE/yycstsiz.cpp
Normal file
84
Utils/Parser Generator/SOURCE/yycstsiz.cpp
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
/************************************************************
|
||||||
|
yycstsiz.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
#ifndef min
|
||||||
|
#define min(x, y) ((x) <= (y) ? (x) : (y))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// the Visual C++ v1.52 compiler generates an error in NT if this isn't present!
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#if defined(M_I86HM) && defined(NDEBUG)
|
||||||
|
#pragma function(memcpy)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int yylexer::yysettextsize(int size)
|
||||||
|
{
|
||||||
|
yyassert(size >= 0);
|
||||||
|
if (yytext_size != size) {
|
||||||
|
if (size < yyleng) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t textcharsize = size + 1; // include the '\0'
|
||||||
|
if (textcharsize <= (size_t) size) {
|
||||||
|
return 0; // integer overflow
|
||||||
|
}
|
||||||
|
size_t statebufcharsize = size * sizeof(int);
|
||||||
|
if ((int)(statebufcharsize / sizeof(int)) != size) {
|
||||||
|
return 0; // integer overflow
|
||||||
|
}
|
||||||
|
|
||||||
|
// allocate
|
||||||
|
char YYFAR* text;
|
||||||
|
int YYFAR* statebuf;
|
||||||
|
if (size <= yystext_size) {
|
||||||
|
text = yystext;
|
||||||
|
statebuf = yysstatebuf;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
text = (char YYFAR*)malloc(textcharsize);
|
||||||
|
if (text == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
statebuf = (int YYFAR*)malloc(statebufcharsize);
|
||||||
|
if (statebuf == NULL) {
|
||||||
|
free(text); // clean up
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy
|
||||||
|
if (text != yytext) {
|
||||||
|
size_t charsize = yytext_size + 1;
|
||||||
|
memcpy(text, yytext, min(textcharsize, charsize));
|
||||||
|
}
|
||||||
|
if (statebuf != yystatebuf) {
|
||||||
|
size_t charsize = yytext_size * sizeof(int);
|
||||||
|
memcpy(statebuf, yystatebuf, min(statebufcharsize, charsize));
|
||||||
|
}
|
||||||
|
|
||||||
|
// free
|
||||||
|
if (yytext != yystext) {
|
||||||
|
free(yytext);
|
||||||
|
}
|
||||||
|
if (yystatebuf != yysstatebuf) {
|
||||||
|
free(yystatebuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
// assign
|
||||||
|
yytext = text;
|
||||||
|
yystatebuf = statebuf;
|
||||||
|
yytext_size = size;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
65
Utils/Parser Generator/SOURCE/yycsusiz.cpp
Normal file
65
Utils/Parser Generator/SOURCE/yycsusiz.cpp
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
/************************************************************
|
||||||
|
yycsusiz.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
#ifndef min
|
||||||
|
#define min(x, y) ((x) <= (y) ? (x) : (y))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// the Visual C++ v1.52 compiler generates an error in NT if this isn't present!
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#if defined(M_I86HM) && defined(NDEBUG)
|
||||||
|
#pragma function(memcpy)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int yylexer::yysetunputsize(int size)
|
||||||
|
{
|
||||||
|
yyassert(size >= 0);
|
||||||
|
if (yyunput_size != size) {
|
||||||
|
if (size < yyunputindex) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t unputbufcharsize = size * sizeof(int);
|
||||||
|
if ((int)(unputbufcharsize / sizeof(int)) != size) {
|
||||||
|
return 0; // integer overflow
|
||||||
|
}
|
||||||
|
|
||||||
|
// allocate
|
||||||
|
int YYFAR* unputbufptr;
|
||||||
|
if (size <= yysunput_size) {
|
||||||
|
unputbufptr = yysunputbufptr;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
unputbufptr = (int YYFAR*)malloc(unputbufcharsize);
|
||||||
|
if (unputbufptr == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy
|
||||||
|
if (unputbufptr != yyunputbufptr) {
|
||||||
|
size_t charsize = yyunput_size * sizeof(int);
|
||||||
|
memcpy(unputbufptr, yyunputbufptr, min(unputbufcharsize, charsize));
|
||||||
|
}
|
||||||
|
|
||||||
|
// free
|
||||||
|
if (yyunputbufptr != yysunputbufptr) {
|
||||||
|
free(yyunputbufptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
// assign
|
||||||
|
yyunputbufptr = unputbufptr;
|
||||||
|
yyunput_size = size;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
14
Utils/Parser Generator/SOURCE/yycsyner.cpp
Normal file
14
Utils/Parser Generator/SOURCE/yycsyner.cpp
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
/************************************************************
|
||||||
|
yycsyner.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
void yyparser::yysyntaxerror(void)
|
||||||
|
{
|
||||||
|
yyerror("syntax error");
|
||||||
|
}
|
15
Utils/Parser Generator/SOURCE/yyctoflw.cpp
Normal file
15
Utils/Parser Generator/SOURCE/yyctoflw.cpp
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/************************************************************
|
||||||
|
yyctoflw.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
void yylexer::yytextoverflow()
|
||||||
|
{
|
||||||
|
yyassert(yyerr != NULL);
|
||||||
|
fprintf(yyerr, "lex text buffer overflow (%d)\n", (int)yytext_size);
|
||||||
|
}
|
18
Utils/Parser Generator/SOURCE/yycuncin.cpp
Normal file
18
Utils/Parser Generator/SOURCE/yycuncin.cpp
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/************************************************************
|
||||||
|
yycuncin.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
int yyparser::yyunclearin()
|
||||||
|
{
|
||||||
|
if (!yylookahead && yychar != -1) {
|
||||||
|
yylookahead = 1;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
62
Utils/Parser Generator/SOURCE/yycunput.cpp
Normal file
62
Utils/Parser Generator/SOURCE/yycunput.cpp
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
/************************************************************
|
||||||
|
yycunput.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
void yylexer::yyunput(int ch)
|
||||||
|
{
|
||||||
|
yyassert(ch >= 0 && ch <= UCHAR_MAX || ch == EOF);
|
||||||
|
yyassert(yyunputindex >= 0 && yyunputindex <= yyunput_size);
|
||||||
|
|
||||||
|
// check unput buffer size
|
||||||
|
if (yyunputindex == yyunput_size) {
|
||||||
|
do {
|
||||||
|
if (yyunputgrow) {
|
||||||
|
if (yyunput_size != 0) {
|
||||||
|
int size = yyunput_size * 2;
|
||||||
|
if (size / 2 == yyunput_size) { // overflow check
|
||||||
|
if (yysetunputsize(size)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (yysetunputsize(100)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yyunputoverflow();
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
while (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
yyunputbufptr[yyunputindex++] = ch;
|
||||||
|
|
||||||
|
// check line number
|
||||||
|
if (ch == '\n') {
|
||||||
|
yylineno--;
|
||||||
|
}
|
||||||
|
|
||||||
|
// debugging
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
if (::yydebug || yydebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: unput: \'", (void*)this);
|
||||||
|
yydebugoutput(string);
|
||||||
|
yydebugoutput(ch);
|
||||||
|
yydebugoutput("\'\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
15
Utils/Parser Generator/SOURCE/yycuoflw.cpp
Normal file
15
Utils/Parser Generator/SOURCE/yycuoflw.cpp
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/************************************************************
|
||||||
|
yycuoflw.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
void yylexer::yyunputoverflow()
|
||||||
|
{
|
||||||
|
yyassert(yyerr != NULL);
|
||||||
|
fprintf(yyerr, "lex unput buffer overflow (%d)\n", (int)yyunput_size);
|
||||||
|
}
|
16
Utils/Parser Generator/SOURCE/yycwipe.cpp
Normal file
16
Utils/Parser Generator/SOURCE/yycwipe.cpp
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/************************************************************
|
||||||
|
yycwipe.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
void yyparser::yywipe()
|
||||||
|
{
|
||||||
|
yydestructpop(yytop + 1);
|
||||||
|
yydestructclearin();
|
||||||
|
}
|
290
Utils/Parser Generator/SOURCE/yycwork.cpp
Normal file
290
Utils/Parser Generator/SOURCE/yycwork.cpp
Normal file
|
@ -0,0 +1,290 @@
|
||||||
|
/************************************************************
|
||||||
|
yycwork.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "cyacc.h"
|
||||||
|
|
||||||
|
// the Visual C++ v1.52 compiler generates an error in NT if this isn't present!
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#if defined(M_I86HM) && defined(NDEBUG)
|
||||||
|
#pragma function(memcpy)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int yyfparser::yywork()
|
||||||
|
{
|
||||||
|
int errorpop = 0;
|
||||||
|
while (1) {
|
||||||
|
unsigned char type;
|
||||||
|
short sr;
|
||||||
|
yystack_t state = yypeek(); // get top state
|
||||||
|
while (1) {
|
||||||
|
if (yystateaction[state].lookahead) {
|
||||||
|
int index;
|
||||||
|
if (!yylookahead) {
|
||||||
|
yychar = yygettoken();
|
||||||
|
if (yychar < 0) {
|
||||||
|
yychar = 0;
|
||||||
|
}
|
||||||
|
yylookahead = 1;
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydgettoken(yychar);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
index = yystateaction[state].base + yychar;
|
||||||
|
if (index >= 0 && index < yytokenaction_size) {
|
||||||
|
if (yytokenaction[index].check == state) {
|
||||||
|
type = yytokenaction[index].type;
|
||||||
|
sr = yytokenaction[index].sr;
|
||||||
|
break; // escape from loop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type = yystateaction[state].type;
|
||||||
|
sr = yystateaction[state].sr;
|
||||||
|
if (type != YYAT_DEFAULT) {
|
||||||
|
break; // escape from loop
|
||||||
|
}
|
||||||
|
state = sr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// action
|
||||||
|
switch (type) {
|
||||||
|
case YYAT_SHIFT:
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydshift(yychar);
|
||||||
|
#endif
|
||||||
|
if (yyskip > 0) {
|
||||||
|
yysetskip(yyskip - 1);
|
||||||
|
}
|
||||||
|
if (!yypush(sr)) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydabort();
|
||||||
|
#endif
|
||||||
|
if (yywipeflg) {
|
||||||
|
yywipe(); // clean up
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
memcpy(&((char YYFAR*)yyattributestackptr)[yytop * yyattribute_size],
|
||||||
|
yylvalptr, yyattribute_size);
|
||||||
|
yylookahead = 0;
|
||||||
|
continue; // go to top of while loop
|
||||||
|
case YYAT_REDUCE:
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydreduce(sr);
|
||||||
|
#endif
|
||||||
|
yyretireflg = 0;
|
||||||
|
if (yyreduction[sr].action != -1) {
|
||||||
|
// user actions in here
|
||||||
|
if (yyreduction[sr].length > 0) {
|
||||||
|
memcpy(yyvalptr, &((char YYFAR*)yyattributestackptr)
|
||||||
|
[(yytop + 1 - yyreduction[sr].length) * yyattribute_size],
|
||||||
|
yyattribute_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
yyerrorflg = 0;
|
||||||
|
yyexitflg = 0;
|
||||||
|
yyaction(yyreduction[sr].action);
|
||||||
|
|
||||||
|
// check for special user requected actions
|
||||||
|
if (yyexitflg) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydexit(yyexitcode);
|
||||||
|
#endif
|
||||||
|
return yyexitcode;
|
||||||
|
}
|
||||||
|
if (yyerrorflg) {
|
||||||
|
errorpop = yyerrorpop;
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydthrowerror(yyerrorpop);
|
||||||
|
#endif
|
||||||
|
yyerrorcount++;
|
||||||
|
break; // go to error handler
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
yypop(yyreduction[sr].length);
|
||||||
|
{
|
||||||
|
yystack_t state = yypeek(); // get top state
|
||||||
|
short next;
|
||||||
|
|
||||||
|
int nonterm = yyreduction[sr].nonterm;
|
||||||
|
while (1) {
|
||||||
|
int index = yystategoto[state].base + nonterm;
|
||||||
|
if (index >= 0 && index < yynontermgoto_size) {
|
||||||
|
if (yynontermgoto[index].check == state) {
|
||||||
|
next = yynontermgoto[index].next;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
next = yystategoto[state].def;
|
||||||
|
if (next == -1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
state = next;
|
||||||
|
}
|
||||||
|
yyassert(next != -1);
|
||||||
|
|
||||||
|
if (!yypush(next)) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydabort();
|
||||||
|
#endif
|
||||||
|
if (yywipeflg) {
|
||||||
|
yywipe(); // clean up
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (yyreduction[sr].action != -1) {
|
||||||
|
memcpy(&((char YYFAR*)yyattributestackptr)[yytop * yyattribute_size],
|
||||||
|
yyvalptr, yyattribute_size);
|
||||||
|
}
|
||||||
|
if (yyretireflg) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydretire(yyretirecode);
|
||||||
|
#endif
|
||||||
|
return yyretirecode;
|
||||||
|
}
|
||||||
|
continue; // go to top of while loop
|
||||||
|
case YYAT_ERROR:
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydsyntaxerror();
|
||||||
|
#endif
|
||||||
|
if (yyskip == 0) {
|
||||||
|
yyerrorcount++;
|
||||||
|
yysyntaxerror();
|
||||||
|
}
|
||||||
|
break; // go to error handler
|
||||||
|
default:
|
||||||
|
yyassert(type == YYAT_ACCEPT);
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydaccept();
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// error handler
|
||||||
|
if (yyskip < 3 || errorpop > 0) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydattemptrecovery();
|
||||||
|
#endif
|
||||||
|
yypopflg = 0; // clear flag
|
||||||
|
while (1) {
|
||||||
|
state = yypeek(); // get top state
|
||||||
|
while (1) {
|
||||||
|
if (yystateaction[state].lookahead) {
|
||||||
|
int index = yystateaction[state].base + YYTK_ERROR;
|
||||||
|
if (index >= 0 && index < yytokenaction_size) {
|
||||||
|
if (yytokenaction[index].check == state) {
|
||||||
|
type = yytokenaction[index].type;
|
||||||
|
sr = yytokenaction[index].sr;
|
||||||
|
break; // escape from loop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type = yystateaction[state].type;
|
||||||
|
sr = yystateaction[state].sr;
|
||||||
|
if (type != YYAT_DEFAULT) {
|
||||||
|
break; // escape from loop
|
||||||
|
}
|
||||||
|
state = sr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == YYAT_SHIFT) {
|
||||||
|
if (errorpop <= 0) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydshift(YYTK_ERROR);
|
||||||
|
#endif
|
||||||
|
if (!yypush(sr)) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydabort();
|
||||||
|
#endif
|
||||||
|
if (yywipeflg) {
|
||||||
|
yywipe(); // clean up
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
yysetskip(3); // skip 3 erroneous characters
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
errorpop--;
|
||||||
|
}
|
||||||
|
|
||||||
|
yypopflg = 1;
|
||||||
|
|
||||||
|
// clean up any symbol attributes
|
||||||
|
if (yydestructorptr != NULL) {
|
||||||
|
int action;
|
||||||
|
state = yypeek();
|
||||||
|
action = yydestructorptr[state];
|
||||||
|
if (action != -1) {
|
||||||
|
// user actions in here
|
||||||
|
memcpy(yyvalptr, &((char YYFAR*)yyattributestackptr)
|
||||||
|
[yytop * yyattribute_size], yyattribute_size);
|
||||||
|
|
||||||
|
yyaction(action);
|
||||||
|
|
||||||
|
memcpy(&((char YYFAR*)yyattributestackptr)
|
||||||
|
[yytop * yyattribute_size], yyvalptr, yyattribute_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yypop(1);
|
||||||
|
if (yytop < 0) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydabort();
|
||||||
|
#endif
|
||||||
|
if (yywipeflg) {
|
||||||
|
yywipe(); // clean up
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (yylookahead) {
|
||||||
|
if (yychar != 0) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yyddiscard(yychar);
|
||||||
|
#endif
|
||||||
|
yydiscard(yychar);
|
||||||
|
|
||||||
|
// clean up any token attributes
|
||||||
|
if (yytokendestptr != NULL) {
|
||||||
|
int index = yytokendestbase + yychar;
|
||||||
|
if (index >= 0 && index < yytokendest_size) {
|
||||||
|
int action = yytokendestptr[index];
|
||||||
|
if (action != -1) {
|
||||||
|
// user actions in here
|
||||||
|
memcpy(yyvalptr, yylvalptr, yyattribute_size);
|
||||||
|
|
||||||
|
yyaction(action);
|
||||||
|
|
||||||
|
memcpy(yylvalptr, yyvalptr, yyattribute_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
yylookahead = 0; // skip erroneous character
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yydabort();
|
||||||
|
#endif
|
||||||
|
if (yywipeflg) {
|
||||||
|
yywipe(); // clean up
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
14
Utils/Parser Generator/SOURCE/yycwrap.cpp
Normal file
14
Utils/Parser Generator/SOURCE/yycwrap.cpp
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
/************************************************************
|
||||||
|
yycwrap.cpp
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "clex.h"
|
||||||
|
|
||||||
|
int yylexer::yywrap(void)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
18
Utils/Parser Generator/SOURCE/yydebug.c
Normal file
18
Utils/Parser Generator/SOURCE/yydebug.c
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/************************************************************
|
||||||
|
yydebug.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "yacc.h"
|
||||||
|
#include "lex.h"
|
||||||
|
#include "myacc.h"
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
int YYNEAR YYDCDECL yydebug = 0;
|
||||||
|
int YYNEAR YYDCDECL yydebugstack = 0; /* parsers only */
|
||||||
|
int YYNEAR YYDCDECL yydebugflush = 0;
|
||||||
|
#endif
|
27
Utils/Parser Generator/SOURCE/yymback.c
Normal file
27
Utils/Parser Generator/SOURCE/yymback.c
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
/************************************************************
|
||||||
|
yymback.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymback(YYCONST yymatch_t YYNEARFAR *p, int action)
|
||||||
|
#else
|
||||||
|
int YYCDECL yymback(p, action)
|
||||||
|
YYCONST yymatch_t YYNEARFAR *p;
|
||||||
|
int action;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(p != NULL);
|
||||||
|
yyassert(action < 0);
|
||||||
|
while (*p != 0) {
|
||||||
|
if (*p++ == action) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
41
Utils/Parser Generator/SOURCE/yymcdeci.c
Normal file
41
Utils/Parser Generator/SOURCE/yymcdeci.c
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/************************************************************
|
||||||
|
yymcdeci.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "myacc.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymcdestructclearin(yymparse_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymcdestructclearin(yy)
|
||||||
|
yymparse_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(yymiscompactparser(yy)); /* make sure it's a compact parser */
|
||||||
|
|
||||||
|
if (yy->yymlookahead) {
|
||||||
|
/* clean up any token attributes */
|
||||||
|
if (yy->yymctokendestptr != NULL) {
|
||||||
|
YYCONST yyctokendest_t YYNEARFAR *tokendestptr = yy->yymctokendestptr;
|
||||||
|
while (tokendestptr->token != 0) {
|
||||||
|
if (tokendestptr->token == yy->yymchar) {
|
||||||
|
/* user actions in here */
|
||||||
|
memcpy(yy->yymvalptr, yy->yymlvalptr, yy->yymattribute_size);
|
||||||
|
|
||||||
|
(*yy->yymparseaction)(yy, tokendestptr->action);
|
||||||
|
|
||||||
|
memcpy(yy->yymlvalptr, yy->yymvalptr, yy->yymattribute_size);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
tokendestptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yy->yymlookahead = 0;
|
||||||
|
}
|
||||||
|
}
|
236
Utils/Parser Generator/SOURCE/yymclex.c
Normal file
236
Utils/Parser Generator/SOURCE/yymclex.c
Normal file
|
@ -0,0 +1,236 @@
|
||||||
|
/************************************************************
|
||||||
|
yymclex.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymclex(yymlex_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
int YYCDECL yymclex(yy)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(yymiscompactlexer(yy)); /* make sure it's a compact lexical analyser */
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
int oldleng;
|
||||||
|
int state = 1 + yy->yymstart;
|
||||||
|
if (yy->yymeol) {
|
||||||
|
state++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* yymore */
|
||||||
|
if (yy->yymmoreflg) {
|
||||||
|
yy->yymmoreflg = 0; /* clear flag */
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yy->yymleng = 0;
|
||||||
|
yy->yymoldeol = yy->yymeol;
|
||||||
|
}
|
||||||
|
oldleng = yy->yymleng;
|
||||||
|
|
||||||
|
/* look for a string */
|
||||||
|
do {
|
||||||
|
int index;
|
||||||
|
int ch; /* lookahead character */
|
||||||
|
|
||||||
|
/* get input character */
|
||||||
|
ch = (*yy->yyminput)(yy);
|
||||||
|
yyassert(ch >= 0 && ch <= UCHAR_MAX || ch == EOF);
|
||||||
|
if (ch == EOF) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* check for possible overflow */
|
||||||
|
if (yy->yymleng == yy->yymtext_size) {
|
||||||
|
do {
|
||||||
|
if (yy->yymtextgrow) {
|
||||||
|
if (yy->yymtext_size != 0) {
|
||||||
|
int size = yy->yymtext_size * 2;
|
||||||
|
if (size / 2 == yy->yymtext_size) { /* overflow check */
|
||||||
|
if (yymsettextsize(yy, size)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (yymsettextsize(yy, 100)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(*yy->yymtextoverflow)(yy);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
while (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* handles eof condition automatically */
|
||||||
|
index = yy->yymstate[state].base;
|
||||||
|
while (1) {
|
||||||
|
if (yy->yymctransition[index].next == 0) {
|
||||||
|
state = yy->yymstate[state].def;
|
||||||
|
if (state <= 0) {
|
||||||
|
if (state < 0) {
|
||||||
|
if (ch >= 0 && ch <= 0xff) {
|
||||||
|
state = -state;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
state = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ch >= yy->yymctransition[index].first &&
|
||||||
|
ch <= yy->yymctransition[index].last) {
|
||||||
|
state = yy->yymctransition[index].next;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
int leng = yy->yymleng; /* slightly more efficient */
|
||||||
|
yy->yymtext[leng] = (char) ch;
|
||||||
|
yy->yymstatebuf[leng] = state;
|
||||||
|
leng++;
|
||||||
|
yy->yymleng = leng;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (state != 0 && (yy->yymstate[state].def != 0 || yy->yymstate[state].base != 0));
|
||||||
|
|
||||||
|
/* now find a match */
|
||||||
|
if (yy->yymleng > oldleng) {
|
||||||
|
int rejectmatch = 0;
|
||||||
|
while (1) {
|
||||||
|
int match = yy->yymstate[yy->yymstatebuf[yy->yymleng - 1]].match;
|
||||||
|
if (rejectmatch != 0) {
|
||||||
|
if (match < 0) {
|
||||||
|
int index = -match;
|
||||||
|
do {
|
||||||
|
match = yy->yymmatch[index++];
|
||||||
|
}
|
||||||
|
while (match > 0 && match <= rejectmatch);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (match == rejectmatch) {
|
||||||
|
match = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rejectmatch = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (match < 0) {
|
||||||
|
match = yy->yymmatch[-match];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (match > 0) {
|
||||||
|
int rejectleng;
|
||||||
|
int token;
|
||||||
|
/* check for backup */
|
||||||
|
if (yy->yymbackup[match]) {
|
||||||
|
while (yy->yymleng > oldleng) {
|
||||||
|
int index = yy->yymstate[yy->yymstatebuf[yy->yymleng - 1]].match;
|
||||||
|
if (index < 0) {
|
||||||
|
if (yymback(&yy->yymmatch[-index], -match)) {
|
||||||
|
break; /* found an expression */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yy->yymleng--;
|
||||||
|
(*yy->yymunput)(yy, (unsigned char) yy->yymtext[yy->yymleng]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yy->yymtext[yy->yymleng] = '\0';
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdmatch(yy, match);
|
||||||
|
#endif
|
||||||
|
yy->yymrejectflg = 0;
|
||||||
|
rejectleng = yy->yymleng;
|
||||||
|
|
||||||
|
if (yy->yymleng > 0) {
|
||||||
|
yy->yymeol = (unsigned char) (yy->yymtext[yy->yymleng - 1] == '\n');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yy->yymeol = yy->yymoldeol;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* perform user action */
|
||||||
|
token = (*yy->yymlexaction)(yy, match);
|
||||||
|
|
||||||
|
if (yy->yymreturnflg) {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
if (!yy->yymrejectflg) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (rejectleng == yy->yymleng) {
|
||||||
|
rejectmatch = match;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (yy->yymleng > oldleng + 1) {
|
||||||
|
yy->yymleng--;
|
||||||
|
(*yy->yymunput)(yy, (unsigned char) yy->yymtext[yy->yymleng]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yy->yymeol = (unsigned char) (yy->yymtext[0] == '\n');
|
||||||
|
(*yy->yymoutput)(yy, yy->yymtext[0]); /* non-matched character */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
int index;
|
||||||
|
int match;
|
||||||
|
yyassert(yy->yymleng == oldleng);
|
||||||
|
|
||||||
|
/* handles <<EOF>> rules */
|
||||||
|
index = 0;
|
||||||
|
match = yy->yymstate[state].match;
|
||||||
|
if (match < 0) {
|
||||||
|
index = -match;
|
||||||
|
match = yy->yymmatch[index++];
|
||||||
|
}
|
||||||
|
while (match > 0) {
|
||||||
|
int token;
|
||||||
|
yy->yymtext[yy->yymleng] = '\0';
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdmatch(yy, match);
|
||||||
|
#endif
|
||||||
|
yy->yymrejectflg = 0; /* clear flag */
|
||||||
|
|
||||||
|
/* perform user action */
|
||||||
|
token = (*yy->yymlexaction)(yy, match);
|
||||||
|
|
||||||
|
if (yy->yymreturnflg) {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
if (!yy->yymrejectflg) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
match = yy->yymmatch[index++];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((*yy->yymwrap)(yy)) {
|
||||||
|
yy->yymoldeol = 1;
|
||||||
|
yy->yymeol = 1;
|
||||||
|
yy->yymstart = 0;
|
||||||
|
return 0; /* eof reached */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
27
Utils/Parser Generator/SOURCE/yymcpars.c
Normal file
27
Utils/Parser Generator/SOURCE/yymcpars.c
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
/************************************************************
|
||||||
|
yymcpars.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "myacc.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymcparse(yymparse_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
int YYCDECL yymcparse(yy)
|
||||||
|
yymparse_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(yymiscompactparser(yy)); /* make sure it's a compact parser */
|
||||||
|
|
||||||
|
n = yymsetup(yy);
|
||||||
|
if (n != 0) {
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
return yymcwork(yy);
|
||||||
|
}
|
24
Utils/Parser Generator/SOURCE/yymcwipe.c
Normal file
24
Utils/Parser Generator/SOURCE/yymcwipe.c
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
/************************************************************
|
||||||
|
yymcwipe.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "myacc.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymcwipe(yymparse_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymcwipe(yy)
|
||||||
|
yymparse_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(yymiscompactparser(yy)); /* make sure it's a compact parser */
|
||||||
|
|
||||||
|
yymdestructpop(yy, yy->yymtop + 1);
|
||||||
|
yymcdestructclearin(yy);
|
||||||
|
}
|
293
Utils/Parser Generator/SOURCE/yymcwork.c
Normal file
293
Utils/Parser Generator/SOURCE/yymcwork.c
Normal file
|
@ -0,0 +1,293 @@
|
||||||
|
/************************************************************
|
||||||
|
yymcwork.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "myacc.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymcwork(yymparse_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
int YYCDECL yymcwork(yy)
|
||||||
|
yymparse_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
int errorpop = 0;
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(yymiscompactparser(yy)); /* make sure it's a compact parser */
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
unsigned char type;
|
||||||
|
short sr;
|
||||||
|
yystack_t state = yympeek(yy); /* get top state */
|
||||||
|
|
||||||
|
int index = yy->yymcstateaction[state];
|
||||||
|
while (1) {
|
||||||
|
if (yy->yymctokenaction[index].token == YYTK_ALL) {
|
||||||
|
if (yy->yymctokenaction[index].type == YYAT_DEFAULT) {
|
||||||
|
state = yy->yymctokenaction[index].sr;
|
||||||
|
index = yy->yymcstateaction[state];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!yy->yymlookahead) {
|
||||||
|
yy->yymlookahead = 1;
|
||||||
|
yy->yymchar = (*yy->yymgettoken)(yy);
|
||||||
|
if (yy->yymchar < 0) {
|
||||||
|
yy->yymchar = 0;
|
||||||
|
}
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdgettoken(yy, yy->yymchar);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if (yy->yymctokenaction[index].token == yy->yymchar) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
type = yy->yymctokenaction[index].type;
|
||||||
|
sr = yy->yymctokenaction[index].sr;
|
||||||
|
|
||||||
|
/* action */
|
||||||
|
switch (type) {
|
||||||
|
case YYAT_SHIFT:
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdshift(yy, yy->yymchar);
|
||||||
|
#endif
|
||||||
|
if (yy->yymskip > 0) {
|
||||||
|
yymsetskip(yy, yy->yymskip - 1);
|
||||||
|
}
|
||||||
|
if (!yympush(yy, sr)) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdabort(yy);
|
||||||
|
#endif
|
||||||
|
if (yy->yymwipeflg) {
|
||||||
|
yymcwipe(yy); /* clean up */
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
memcpy(&((char YYFAR *) yy->yymattributestackptr)[yy->yymtop *
|
||||||
|
yy->yymattribute_size], yy->yymlvalptr, yy->yymattribute_size);
|
||||||
|
yy->yymlookahead = 0;
|
||||||
|
continue; /* go to top of while loop */
|
||||||
|
case YYAT_REDUCE:
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdreduce(yy, sr);
|
||||||
|
#endif
|
||||||
|
yy->yymretireflg = 0;
|
||||||
|
if (yy->yymreduction[sr].action != -1) {
|
||||||
|
/* user actions in here */
|
||||||
|
if (yy->yymreduction[sr].length > 0) {
|
||||||
|
memcpy(yy->yymvalptr, &((char YYFAR *) yy->yymattributestackptr)
|
||||||
|
[(yy->yymtop + 1 - yy->yymreduction[sr].length) *
|
||||||
|
yy->yymattribute_size], yy->yymattribute_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
yy->yymerrorflg = 0;
|
||||||
|
yy->yymexitflg = 0;
|
||||||
|
(*yy->yymparseaction)(yy, yy->yymreduction[sr].action);
|
||||||
|
|
||||||
|
/* check for special user requected actions */
|
||||||
|
if (yy->yymexitflg) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymexit(yy, yy->yymexitcode);
|
||||||
|
#endif
|
||||||
|
return yy->yymexitcode;
|
||||||
|
}
|
||||||
|
if (yy->yymerrorflg) {
|
||||||
|
errorpop = yy->yymerrorpop;
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdthrowerror(yy, yy->yymerrorpop);
|
||||||
|
#endif
|
||||||
|
yy->yymerrorcount++;
|
||||||
|
break; /* go to error handler */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
yympop(yy, yy->yymreduction[sr].length);
|
||||||
|
{
|
||||||
|
yystack_t state = yympeek(yy); /* get top state */
|
||||||
|
short next;
|
||||||
|
|
||||||
|
int nonterm = yy->yymreduction[sr].nonterm;
|
||||||
|
int index = yy->yymcstategoto[state];
|
||||||
|
while (1) {
|
||||||
|
if (yy->yymcnontermgoto[index].nonterm == -1) {
|
||||||
|
if (yy->yymcnontermgoto[index].next != -1) {
|
||||||
|
state = yy->yymcnontermgoto[index].next;
|
||||||
|
index = yy->yymcstategoto[state];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (yy->yymcnontermgoto[index].nonterm == nonterm) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
next = yy->yymcnontermgoto[index].next;
|
||||||
|
yyassert(next != -1);
|
||||||
|
|
||||||
|
if (!yympush(yy, next)) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdabort(yy);
|
||||||
|
#endif
|
||||||
|
if (yy->yymwipeflg) {
|
||||||
|
yymcwipe(yy); /* clean up */
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (yy->yymreduction[sr].action != -1) {
|
||||||
|
memcpy(&((char YYFAR *) yy->yymattributestackptr)
|
||||||
|
[yy->yymtop * yy->yymattribute_size],
|
||||||
|
yy->yymvalptr, yy->yymattribute_size);
|
||||||
|
}
|
||||||
|
if (yy->yymretireflg) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdretire(yy, yy->yymretirecode);
|
||||||
|
#endif
|
||||||
|
return yy->yymretirecode;
|
||||||
|
}
|
||||||
|
continue; /* go to top of while loop */
|
||||||
|
case YYAT_ERROR:
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdsyntaxerror(yy);
|
||||||
|
#endif
|
||||||
|
if (yy->yymskip == 0) {
|
||||||
|
yy->yymerrorcount++;
|
||||||
|
(*yy->yymsyntaxerror)(yy);
|
||||||
|
}
|
||||||
|
break; /* go to error handler */
|
||||||
|
default:
|
||||||
|
yyassert(type == YYAT_ACCEPT);
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdaccept(yy);
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* error handler */
|
||||||
|
if (yy->yymskip < 3 || errorpop > 0) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdattemptrecovery(yy);
|
||||||
|
#endif
|
||||||
|
yy->yympopflg = 0; /* clear flag */
|
||||||
|
while (1) {
|
||||||
|
state = yympeek(yy); /* get top state */
|
||||||
|
index = yy->yymcstateaction[state];
|
||||||
|
while (1) {
|
||||||
|
if (yy->yymctokenaction[index].token == YYTK_ALL) {
|
||||||
|
if (yy->yymctokenaction[index].type == YYAT_DEFAULT) {
|
||||||
|
state = yy->yymctokenaction[index].sr;
|
||||||
|
index = yy->yymcstateaction[state];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (yy->yymctokenaction[index].token == YYTK_ERROR) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
type = yy->yymctokenaction[index].type;
|
||||||
|
sr = yy->yymctokenaction[index].sr;
|
||||||
|
|
||||||
|
if (type == YYAT_SHIFT) {
|
||||||
|
if (errorpop <= 0) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdshift(yy, YYTK_ERROR);
|
||||||
|
#endif
|
||||||
|
if (!yympush(yy, sr)) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdabort(yy);
|
||||||
|
#endif
|
||||||
|
if (yy->yymwipeflg) {
|
||||||
|
yymcwipe(yy); /* clean up */
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
yymsetskip(yy, 3); /* skip 3 erroneous characters */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
errorpop--;
|
||||||
|
}
|
||||||
|
|
||||||
|
yy->yympopflg = 1;
|
||||||
|
|
||||||
|
/* clean up any symbol attributes */
|
||||||
|
if (yy->yymdestructorptr != NULL) {
|
||||||
|
int action;
|
||||||
|
state = yympeek(yy);
|
||||||
|
action = yy->yymdestructorptr[state];
|
||||||
|
if (action != -1) {
|
||||||
|
/* user actions in here */
|
||||||
|
memcpy(yy->yymvalptr, &((char YYFAR *) yy->yymattributestackptr)
|
||||||
|
[yy->yymtop * yy->yymattribute_size],
|
||||||
|
yy->yymattribute_size);
|
||||||
|
|
||||||
|
(*yy->yymparseaction)(yy, action);
|
||||||
|
|
||||||
|
memcpy(&((char YYFAR *) yy->yymattributestackptr)
|
||||||
|
[yy->yymtop * yy->yymattribute_size], yy->yymvalptr,
|
||||||
|
yy->yymattribute_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yympop(yy, 1);
|
||||||
|
if (yy->yymtop < 0) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdabort(yy);
|
||||||
|
#endif
|
||||||
|
if (yy->yymwipeflg) {
|
||||||
|
yymcwipe(yy); /* clean up */
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (yy->yymlookahead) {
|
||||||
|
if (yy->yymchar != 0) {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymddiscard(yy, yy->yymchar);
|
||||||
|
#endif
|
||||||
|
(*yy->yymdiscard)(yy, yy->yymchar);
|
||||||
|
|
||||||
|
/* clean up any token attributes */
|
||||||
|
if (yy->yymctokendestptr != NULL) {
|
||||||
|
YYCONST yyctokendest_t YYNEARFAR *tokendestptr = yy->yymctokendestptr;
|
||||||
|
while (tokendestptr->token != 0) {
|
||||||
|
if (tokendestptr->token == yy->yymchar) {
|
||||||
|
/* user actions in here */
|
||||||
|
memcpy(yy->yymvalptr, yy->yymlvalptr, yy->yymattribute_size);
|
||||||
|
|
||||||
|
(*yy->yymparseaction)(yy, tokendestptr->action);
|
||||||
|
|
||||||
|
memcpy(yy->yymlvalptr, yy->yymvalptr, yy->yymattribute_size);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
tokendestptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
yy->yymlookahead = 0; /* skip erroneous character */
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdabort(yy);
|
||||||
|
#endif
|
||||||
|
if (yy->yymwipeflg) {
|
||||||
|
yymcwipe(yy); /* clean up */
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
40
Utils/Parser Generator/SOURCE/yymdeci.c
Normal file
40
Utils/Parser Generator/SOURCE/yymdeci.c
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/************************************************************
|
||||||
|
yymdeci.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "myacc.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymdestructclearin(yymparse_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymdestructclearin(yy)
|
||||||
|
yymparse_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(yymisfastparser(yy)); /* make sure it's a fast parser */
|
||||||
|
|
||||||
|
if (yy->yymlookahead) {
|
||||||
|
/* clean up any token attributes */
|
||||||
|
if (yy->yymtokendestptr != NULL) {
|
||||||
|
int index = yy->yymtokendestbase + yy->yymchar;
|
||||||
|
if (index >= 0 && index < yy->yymtokendest_size) {
|
||||||
|
int action = yy->yymtokendestptr[index];
|
||||||
|
if (action != -1) {
|
||||||
|
/* user actions in here */
|
||||||
|
memcpy(yy->yymvalptr, yy->yymlvalptr, yy->yymattribute_size);
|
||||||
|
|
||||||
|
(*yy->yymparseaction)(yy, action);
|
||||||
|
|
||||||
|
memcpy(yy->yymlvalptr, yy->yymvalptr, yy->yymattribute_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yy->yymlookahead = 0;
|
||||||
|
}
|
||||||
|
}
|
46
Utils/Parser Generator/SOURCE/yymdepop.c
Normal file
46
Utils/Parser Generator/SOURCE/yymdepop.c
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
/************************************************************
|
||||||
|
yymdepop.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "myacc.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymdestructpop(yymparse_t YYFAR *yy, int num)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymdestructpop(yy, num)
|
||||||
|
yymparse_t YYFAR *yy;
|
||||||
|
int num;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(num >= 0);
|
||||||
|
yyassert(yy->yymtop - num >= -1);
|
||||||
|
|
||||||
|
if (yy->yymdestructorptr != NULL) {
|
||||||
|
while (num > 0) {
|
||||||
|
yystack_t state = yympeek(yy);
|
||||||
|
int action = yy->yymdestructorptr[state];
|
||||||
|
if (action != -1) {
|
||||||
|
/* user actions in here */
|
||||||
|
memcpy(yy->yymvalptr, &((char YYFAR *) yy->yymattributestackptr)
|
||||||
|
[yy->yymtop * yy->yymattribute_size], yy->yymattribute_size);
|
||||||
|
|
||||||
|
(*yy->yymparseaction)(yy, action);
|
||||||
|
|
||||||
|
memcpy(&((char YYFAR *) yy->yymattributestackptr)
|
||||||
|
[yy->yymtop * yy->yymattribute_size], yy->yymvalptr,
|
||||||
|
yy->yymattribute_size);
|
||||||
|
}
|
||||||
|
yympop(yy, 1);
|
||||||
|
num--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yympop(yy, num);
|
||||||
|
}
|
||||||
|
}
|
26
Utils/Parser Generator/SOURCE/yymdisc.c
Normal file
26
Utils/Parser Generator/SOURCE/yymdisc.c
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/************************************************************
|
||||||
|
yymdisc.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "myacc.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma argsused
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymdiscard(yymparse_t YYFAR *yy, int token)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymdiscard(yy, token)
|
||||||
|
yymparse_t YYFAR *yy;
|
||||||
|
int token;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(token > 0);
|
||||||
|
/* do nothing */
|
||||||
|
}
|
75
Utils/Parser Generator/SOURCE/yymdoutp.c
Normal file
75
Utils/Parser Generator/SOURCE/yymdoutp.c
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
/************************************************************
|
||||||
|
yymdoutp.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymdebugoutput(yymlex_t YYFAR *yy, int ch)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymdebugoutput(yy, ch)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
int ch;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
char string[32];
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
|
||||||
|
switch (ch) {
|
||||||
|
case EOF:
|
||||||
|
strcpy(string, "EOF");
|
||||||
|
break;
|
||||||
|
case '\n':
|
||||||
|
strcpy(string, "\\n");
|
||||||
|
break;
|
||||||
|
case '\t':
|
||||||
|
strcpy(string, "\\t");
|
||||||
|
break;
|
||||||
|
case '\v':
|
||||||
|
strcpy(string, "\\v");
|
||||||
|
break;
|
||||||
|
case '\b':
|
||||||
|
strcpy(string, "\\b");
|
||||||
|
break;
|
||||||
|
case '\r':
|
||||||
|
strcpy(string, "\\r");
|
||||||
|
break;
|
||||||
|
case '\f':
|
||||||
|
strcpy(string, "\\f");
|
||||||
|
break;
|
||||||
|
case '\a':
|
||||||
|
strcpy(string, "\\a");
|
||||||
|
break;
|
||||||
|
case '\\':
|
||||||
|
strcpy(string, "\\");
|
||||||
|
break;
|
||||||
|
case '\?':
|
||||||
|
strcpy(string, "\\\?");
|
||||||
|
break;
|
||||||
|
case '\'':
|
||||||
|
strcpy(string, "\\\'");
|
||||||
|
break;
|
||||||
|
case '\"':
|
||||||
|
strcpy(string, "\\\"");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (isascii(ch) && isgraph(ch)) {
|
||||||
|
string[0] = (char) ch;
|
||||||
|
string[1] = '\0';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sprintf(string, "\\%03o", (unsigned int) (unsigned char) ch);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
yymlexdebugoutput(yy, string);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
25
Utils/Parser Generator/SOURCE/yymecho.c
Normal file
25
Utils/Parser Generator/SOURCE/yymecho.c
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/************************************************************
|
||||||
|
yymecho.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymecho(yymlex_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymecho(yy)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
|
||||||
|
for (i = 0; i < yy->yymleng; i++) {
|
||||||
|
(*yy->yymoutput)(yy, yy->yymtext[i]);
|
||||||
|
}
|
||||||
|
}
|
27
Utils/Parser Generator/SOURCE/yymerror.c
Normal file
27
Utils/Parser Generator/SOURCE/yymerror.c
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
/************************************************************
|
||||||
|
yymerror.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "myacc.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymerror(yymparse_t YYFAR *yy, YYCONST char YYFAR *text)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymerror(yy, text)
|
||||||
|
yymparse_t YYFAR *yy;
|
||||||
|
YYCONST char YYFAR *text;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(text != NULL);
|
||||||
|
yyassert(yy->yymerr != NULL);
|
||||||
|
while (*text != '\0') {
|
||||||
|
putc(*text++, yy->yymerr);
|
||||||
|
}
|
||||||
|
putc('\n', yy->yymerr);
|
||||||
|
}
|
23
Utils/Parser Generator/SOURCE/yymgetch.c
Normal file
23
Utils/Parser Generator/SOURCE/yymgetch.c
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/************************************************************
|
||||||
|
yymgetch.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymgetchar(yymlex_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
int YYCDECL yymgetchar(yy)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(yy->yymin != NULL);
|
||||||
|
return getc(yy->yymin);
|
||||||
|
}
|
25
Utils/Parser Generator/SOURCE/yymgtok.c
Normal file
25
Utils/Parser Generator/SOURCE/yymgtok.c
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/************************************************************
|
||||||
|
yymgtok.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "myacc.h"
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymgettoken(yymparse_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
int YYCDECL yymgettoken(yy)
|
||||||
|
yymparse_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yymlex_t YYFAR *p;
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
|
||||||
|
p = (yymlex_t YYFAR *) yy->yymdata;
|
||||||
|
yyassert(p != NULL);
|
||||||
|
return yymlex(p);
|
||||||
|
}
|
46
Utils/Parser Generator/SOURCE/yyminput.c
Normal file
46
Utils/Parser Generator/SOURCE/yyminput.c
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
/************************************************************
|
||||||
|
yyminput.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yyminput(yymlex_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
int YYCDECL yyminput(yy)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
int ch;
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
|
||||||
|
if (yy->yymunputindex > 0) {
|
||||||
|
ch = yy->yymunputbufptr[--yy->yymunputindex];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ch = yy->yymgetchar(yy);
|
||||||
|
}
|
||||||
|
if (ch == '\n') {
|
||||||
|
yy->yymlineno++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* debugging */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
if (yydebug || yy->yymdebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: input: \'", (void *) yy);
|
||||||
|
yymlexdebugoutput(yy, string);
|
||||||
|
yymdebugoutput(yy, ch);
|
||||||
|
yymlexdebugoutput(yy, "\'\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return ch;
|
||||||
|
}
|
41
Utils/Parser Generator/SOURCE/yymlcln.c
Normal file
41
Utils/Parser Generator/SOURCE/yymlcln.c
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/************************************************************
|
||||||
|
yymlcln.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymlexcleanup(yymlex_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymlexcleanup(yy)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
if (yy->yymtext != yy->yymstext) {
|
||||||
|
free(yy->yymtext);
|
||||||
|
yy->yymtext = yy->yymstext;
|
||||||
|
}
|
||||||
|
if (yy->yymstatebuf != yy->yymsstatebuf) {
|
||||||
|
free(yy->yymstatebuf);
|
||||||
|
yy->yymstatebuf = yy->yymsstatebuf;
|
||||||
|
}
|
||||||
|
if (yy->yymunputbufptr != yy->yymsunputbufptr) {
|
||||||
|
free(yy->yymunputbufptr);
|
||||||
|
yy->yymunputbufptr = yy->yymsunputbufptr;
|
||||||
|
}
|
||||||
|
yy->yymtext_size = yy->yymstext_size;
|
||||||
|
yy->yymunput_size = yy->yymsunput_size;
|
||||||
|
|
||||||
|
if (yy->yymtext != NULL) {
|
||||||
|
*yy->yymtext = '\0';
|
||||||
|
}
|
||||||
|
yy->yymleng = 0;
|
||||||
|
yy->yymunputindex = 0;
|
||||||
|
}
|
90
Utils/Parser Generator/SOURCE/yymlcrea.c
Normal file
90
Utils/Parser Generator/SOURCE/yymlcrea.c
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
/************************************************************
|
||||||
|
yymlcrea.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "mlex.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymcreatelex(yymlex_t YYFAR *yy, YYCONST yymlex_t YYFAR *src)
|
||||||
|
#else
|
||||||
|
int YYCDECL yymcreatelex(yy, src)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
YYCONST yymlex_t YYFAR *src;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
size_t textcharsize;
|
||||||
|
size_t statebufcharsize;
|
||||||
|
size_t unputbufcharsize;
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(src != NULL);
|
||||||
|
|
||||||
|
*yy = *src;
|
||||||
|
|
||||||
|
/* get sizes first */
|
||||||
|
textcharsize = yy->yymstext_size + 1; /* include the '\0' */
|
||||||
|
if (textcharsize <= (size_t) yy->yymstext_size) {
|
||||||
|
return 0; /* integer overflow */
|
||||||
|
}
|
||||||
|
if (yy->yymstext_size != 0) {
|
||||||
|
statebufcharsize = yy->yymstext_size * sizeof(int);
|
||||||
|
if ((int) (statebufcharsize / sizeof(int)) != yy->yymstext_size) {
|
||||||
|
return 0; /* integer overflow */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
statebufcharsize = 0;
|
||||||
|
}
|
||||||
|
if (yy->yymsunput_size != 0) {
|
||||||
|
unputbufcharsize = yy->yymsunput_size * sizeof(int);
|
||||||
|
if ((int) (unputbufcharsize / sizeof(int)) != yy->yymsunput_size) {
|
||||||
|
return 0; /* integer overflow */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
unputbufcharsize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* allocate the memory if necessary */
|
||||||
|
yy->yymstext = (char YYFAR *) malloc(textcharsize);
|
||||||
|
if (yy->yymstext == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (statebufcharsize != 0) {
|
||||||
|
yy->yymsstatebuf = (int YYFAR *) malloc(statebufcharsize);
|
||||||
|
if (yy->yymsstatebuf == NULL) {
|
||||||
|
free(yy->yymstext);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yy->yymsstatebuf = NULL;
|
||||||
|
}
|
||||||
|
if (unputbufcharsize != 0) {
|
||||||
|
yy->yymsunputbufptr = (int YYFAR *) malloc(unputbufcharsize);
|
||||||
|
if (yy->yymsunputbufptr == NULL) {
|
||||||
|
free(yy->yymstext);
|
||||||
|
free(yy->yymsstatebuf);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yy->yymsunputbufptr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* assign any other variables */
|
||||||
|
yy->yymtext_size = yy->yymstext_size;
|
||||||
|
yy->yymtext = yy->yymstext;
|
||||||
|
yy->yymstatebuf = yy->yymsstatebuf;
|
||||||
|
yy->yymunput_size = yy->yymsunput_size;
|
||||||
|
yy->yymunputbufptr = yy->yymsunputbufptr;
|
||||||
|
|
||||||
|
/* make sure we are ready to go */
|
||||||
|
yymreset(yy);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
72
Utils/Parser Generator/SOURCE/yymldbug.c
Normal file
72
Utils/Parser Generator/SOURCE/yymldbug.c
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
/************************************************************
|
||||||
|
yymldbug.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#include <winbase.h>
|
||||||
|
#endif
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymdmatch(yymlex_t YYFAR *yy, int expr)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymdmatch(yy, expr)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
int expr;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
if (yydebug || yy->yymdebug) {
|
||||||
|
char string[128];
|
||||||
|
int i;
|
||||||
|
|
||||||
|
sprintf(string, "%p: match: \"", (void *) yy);
|
||||||
|
yymlexdebugoutput(yy, string);
|
||||||
|
for (i = 0; i < yy->yymleng; i++) {
|
||||||
|
yymdebugoutput(yy, yy->yymtext[i]);
|
||||||
|
}
|
||||||
|
sprintf(string, "\", %d\n", (int) expr);
|
||||||
|
yymlexdebugoutput(yy, string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymlexdebugoutput(yymlex_t YYFAR *yy, YYCONST char *string)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymlexdebugoutput(yy, string)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
YYCONST char *string;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(string != NULL);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (yy->yymdebugout != NULL) {
|
||||||
|
#else
|
||||||
|
yyassert(yy->yymdebugout != NULL);
|
||||||
|
#endif
|
||||||
|
while (*string != '\0') {
|
||||||
|
putc(*string++, yy->yymdebugout);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (yydebugflush || yy->yymdebugflush) {
|
||||||
|
fflush(yy->yymdebugout);
|
||||||
|
}
|
||||||
|
#ifdef _WIN32
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
OutputDebugString(string);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
25
Utils/Parser Generator/SOURCE/yymldest.c
Normal file
25
Utils/Parser Generator/SOURCE/yymldest.c
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/************************************************************
|
||||||
|
yymldest.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "mlex.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymdestroylex(yymlex_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymdestroylex(yy)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert( yy != NULL);
|
||||||
|
|
||||||
|
yymlexcleanup(yy);
|
||||||
|
free(yy->yymstext);
|
||||||
|
free(yy->yymsstatebuf);
|
||||||
|
free(yy->yymsunputbufptr);
|
||||||
|
}
|
30
Utils/Parser Generator/SOURCE/yymless.c
Normal file
30
Utils/Parser Generator/SOURCE/yymless.c
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
/************************************************************
|
||||||
|
yymless.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymless(yymlex_t YYFAR *yy, int length)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymless(yy, length)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
int length;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(length >= 0 && length <= yy->yymleng);
|
||||||
|
while (yy->yymleng > length) {
|
||||||
|
(*yy->yymunput)(yy, (unsigned char) yy->yymtext[--yy->yymleng]);
|
||||||
|
}
|
||||||
|
if (yy->yymleng > 0) {
|
||||||
|
yy->yymeol = (unsigned char) (yy->yymtext[yy->yymleng - 1] == '\n');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yy->yymeol = yy->yymoldeol;
|
||||||
|
}
|
||||||
|
}
|
231
Utils/Parser Generator/SOURCE/yymlex.c
Normal file
231
Utils/Parser Generator/SOURCE/yymlex.c
Normal file
|
@ -0,0 +1,231 @@
|
||||||
|
/************************************************************
|
||||||
|
yymlex.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymlex(yymlex_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
int YYCDECL yymlex(yy)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(yymisfastlexer(yy)); /* make sure it's a fast lexical analyser */
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
int oldleng;
|
||||||
|
int state = 1 + yy->yymstart;
|
||||||
|
if (yy->yymeol) {
|
||||||
|
state++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* yymore */
|
||||||
|
if (yy->yymmoreflg) {
|
||||||
|
yy->yymmoreflg = 0; /* clear flag */
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yy->yymleng = 0;
|
||||||
|
yy->yymoldeol = yy->yymeol;
|
||||||
|
}
|
||||||
|
oldleng = yy->yymleng;
|
||||||
|
|
||||||
|
/* look for a string */
|
||||||
|
do {
|
||||||
|
int ch; /* lookahead character */
|
||||||
|
|
||||||
|
/* get input character */
|
||||||
|
ch = (*yy->yyminput)(yy);
|
||||||
|
yyassert(ch >= 0 && ch <= UCHAR_MAX || ch == EOF);
|
||||||
|
if (ch == EOF) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* check for possible overflow */
|
||||||
|
if (yy->yymleng == yy->yymtext_size) {
|
||||||
|
do {
|
||||||
|
if (yy->yymtextgrow) {
|
||||||
|
if (yy->yymtext_size != 0) {
|
||||||
|
int size = yy->yymtext_size * 2;
|
||||||
|
if (size / 2 == yy->yymtext_size) { /* overflow check */
|
||||||
|
if (yymsettextsize(yy, size)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (yymsettextsize(yy, 100)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(*yy->yymtextoverflow)(yy);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
while (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* handles eof condition automatically */
|
||||||
|
while (state != 0) {
|
||||||
|
int index = yy->yymstate[state].base + ch;
|
||||||
|
if (index >= 0 && index < yy->yymtransitionmax) {
|
||||||
|
if (yy->yymtransition[index].check == state) {
|
||||||
|
state = yy->yymtransition[index].next;
|
||||||
|
break; /* found a transition */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
state = yy->yymstate[state].def;
|
||||||
|
if (state < 0) {
|
||||||
|
if (ch >= 0 && ch <= 0xff) {
|
||||||
|
state = -state;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
state = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
int leng = yy->yymleng; /* slightly more efficient */
|
||||||
|
yy->yymtext[leng] = (char) ch;
|
||||||
|
yy->yymstatebuf[leng] = state;
|
||||||
|
leng++;
|
||||||
|
yy->yymleng = leng;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (state != 0 && (yy->yymstate[state].def != 0 || yy->yymstate[state].base != 0));
|
||||||
|
|
||||||
|
/* now find a match */
|
||||||
|
if (yy->yymleng > oldleng) {
|
||||||
|
int rejectmatch = 0;
|
||||||
|
while (1) {
|
||||||
|
int match = yy->yymstate[yy->yymstatebuf[yy->yymleng - 1]].match;
|
||||||
|
if (rejectmatch != 0) {
|
||||||
|
if (match < 0) {
|
||||||
|
int index = -match;
|
||||||
|
do {
|
||||||
|
match = yy->yymmatch[index++];
|
||||||
|
}
|
||||||
|
while (match > 0 && match <= rejectmatch);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (match == rejectmatch) {
|
||||||
|
match = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rejectmatch = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (match < 0) {
|
||||||
|
match = yy->yymmatch[-match];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (match > 0) {
|
||||||
|
int rejectleng;
|
||||||
|
int token;
|
||||||
|
/* check for backup */
|
||||||
|
if (yy->yymbackup[match]) {
|
||||||
|
while (yy->yymleng > oldleng) {
|
||||||
|
int index = yy->yymstate[yy->yymstatebuf[yy->yymleng - 1]].match;
|
||||||
|
if (index < 0) {
|
||||||
|
if (yymback(&yy->yymmatch[-index], -match)) {
|
||||||
|
break; /* found an expression */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yy->yymleng--;
|
||||||
|
(*yy->yymunput)(yy, (unsigned char) yy->yymtext[yy->yymleng]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
yy->yymtext[yy->yymleng] = '\0';
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdmatch(yy, match);
|
||||||
|
#endif
|
||||||
|
yy->yymrejectflg = 0;
|
||||||
|
rejectleng = yy->yymleng;
|
||||||
|
|
||||||
|
if (yy->yymleng > 0) {
|
||||||
|
yy->yymeol = (unsigned char) (yy->yymtext[yy->yymleng - 1] == '\n');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yy->yymeol = yy->yymoldeol;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* perform user action */
|
||||||
|
token = (*yy->yymlexaction)(yy, match);
|
||||||
|
|
||||||
|
if (yy->yymreturnflg) {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
if (!yy->yymrejectflg) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (rejectleng == yy->yymleng) {
|
||||||
|
rejectmatch = match;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (yy->yymleng > oldleng + 1) {
|
||||||
|
yy->yymleng--;
|
||||||
|
(*yy->yymunput)(yy, (unsigned char) yy->yymtext[yy->yymleng]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yy->yymeol = (unsigned char) (yy->yymtext[0] == '\n');
|
||||||
|
(*yy->yymoutput)(yy, yy->yymtext[0]); /* non-matched character */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
int index;
|
||||||
|
int match;
|
||||||
|
yyassert(yy->yymleng == oldleng);
|
||||||
|
|
||||||
|
/* handles <<EOF>> rules */
|
||||||
|
index = 0;
|
||||||
|
match = yy->yymstate[state].match;
|
||||||
|
if (match < 0) {
|
||||||
|
index = -match;
|
||||||
|
match = yy->yymmatch[index++];
|
||||||
|
}
|
||||||
|
while (match > 0) {
|
||||||
|
int token;
|
||||||
|
yy->yymtext[yy->yymleng] = '\0';
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yymdmatch(yy, match);
|
||||||
|
#endif
|
||||||
|
yy->yymrejectflg = 0; /* clear flag */
|
||||||
|
|
||||||
|
/* perform user action */
|
||||||
|
token = (*yy->yymlexaction)(yy, match);
|
||||||
|
|
||||||
|
if (yy->yymreturnflg) {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
if (!yy->yymrejectflg) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
match = yy->yymmatch[index++];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((*yy->yymwrap)(yy)) {
|
||||||
|
yy->yymoldeol = 1;
|
||||||
|
yy->yymeol = 1;
|
||||||
|
yy->yymstart = 0;
|
||||||
|
return 0; /* eof reached */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
26
Utils/Parser Generator/SOURCE/yymlinit.c
Normal file
26
Utils/Parser Generator/SOURCE/yymlinit.c
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/************************************************************
|
||||||
|
yymlinit.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymlexinit(yymlex_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymlexinit(yy)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
|
||||||
|
yy->yymin = stdin;
|
||||||
|
yy->yymout = stdout;
|
||||||
|
yy->yymerr = stderr;
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
yy->yymdebugout = stdout;
|
||||||
|
#endif
|
||||||
|
}
|
42
Utils/Parser Generator/SOURCE/yymoutpt.c
Normal file
42
Utils/Parser Generator/SOURCE/yymoutpt.c
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/************************************************************
|
||||||
|
yymoutpt.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include "mlex.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymoutput(yymlex_t YYFAR *yy, int ch)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymoutput(yy, ch)
|
||||||
|
yymlex_t YYFAR *yy;
|
||||||
|
int ch;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
|
||||||
|
/* debugging */
|
||||||
|
#ifdef YYDEBUG
|
||||||
|
if (yydebug || yy->yymdebug) {
|
||||||
|
char string[128];
|
||||||
|
|
||||||
|
sprintf(string, "%p: output: \'", (void *) yy);
|
||||||
|
yymlexdebugoutput(yy, string);
|
||||||
|
yymdebugoutput(yy, ch);
|
||||||
|
yymlexdebugoutput(yy, "\'\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
yyassert(yy->yymout != NULL);
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
putc((char) ch, yy->yymout);
|
||||||
|
#else
|
||||||
|
putc(ch, yy->yymout);
|
||||||
|
#endif
|
||||||
|
}
|
28
Utils/Parser Generator/SOURCE/yymparse.c
Normal file
28
Utils/Parser Generator/SOURCE/yymparse.c
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/************************************************************
|
||||||
|
yymparse.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "myacc.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
int YYCDECL yymparse(yymparse_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
int YYCDECL yymparse(yy)
|
||||||
|
yymparse_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
yyassert(yy != NULL);
|
||||||
|
yyassert(yymisfastparser(yy)); /* make sure it's a fast parser */
|
||||||
|
|
||||||
|
n = yymsetup(yy);
|
||||||
|
if (n != 0) {
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
return yymwork(yy);
|
||||||
|
}
|
30
Utils/Parser Generator/SOURCE/yympcln.c
Normal file
30
Utils/Parser Generator/SOURCE/yympcln.c
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
/************************************************************
|
||||||
|
yympcln.c
|
||||||
|
This file can be freely modified for the generation of
|
||||||
|
custom code.
|
||||||
|
|
||||||
|
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||||
|
************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "myacc.h"
|
||||||
|
|
||||||
|
#ifdef YYPROTOTYPE
|
||||||
|
void YYCDECL yymparsecleanup(yymparse_t YYFAR *yy)
|
||||||
|
#else
|
||||||
|
void YYCDECL yymparsecleanup(yy)
|
||||||
|
yymparse_t YYFAR *yy;
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
if (yy->yymstackptr != yy->yymsstackptr) {
|
||||||
|
free(yy->yymstackptr);
|
||||||
|
yy->yymstackptr = yy->yymsstackptr;
|
||||||
|
}
|
||||||
|
if (yy->yymattributestackptr != yy->yymsattributestackptr) {
|
||||||
|
free(yy->yymattributestackptr);
|
||||||
|
yy->yymattributestackptr = yy->yymsattributestackptr;
|
||||||
|
}
|
||||||
|
yy->yymstack_size = yy->yymsstack_size;
|
||||||
|
|
||||||
|
yy->yymtop = -1;
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue