diff --git a/Grammars/Haskell/HaskellLang.resources b/Grammars/Haskell/HaskellLang.resources deleted file mode 100644 index c9c568365..000000000 Binary files a/Grammars/Haskell/HaskellLang.resources and /dev/null differ diff --git a/Grammars/Haskell/Haskell_lrparser_rules.cs b/Grammars/Haskell/Haskell_lrparser_rules.cs deleted file mode 100644 index 7318136e0..000000000 --- a/Grammars/Haskell/Haskell_lrparser_rules.cs +++ /dev/null @@ -1,1898 +0,0 @@ - -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.HaskellParser.Errors; -using PascalABCCompiler.ParserTools; -using GoldParser; - -namespace PascalABCCompiler.HaskellParser -{ -public partial class GPBParser_Haskell : GPBParser -{ - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//SymbolConstants -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public enum SymbolConstants : int -{ - SYMBOL_EOF = 0, // (EOF) - SYMBOL_ERROR = 1, // (Error) - SYMBOL_WHITESPACE = 2, // (Whitespace) - SYMBOL_COMMENTEND = 3, // (Comment End) - SYMBOL_COMMENTLINE = 4, // (Comment Line) - SYMBOL_COMMENTSTART = 5, // (Comment Start) - SYMBOL_TKAND = 6, // 'tkAnd' - SYMBOL_TKARROW = 7, // 'tkArrow' - SYMBOL_TKARROWGEN = 8, // 'tkArrowGen' - SYMBOL_TKASSIGN = 9, // 'tkAssign' - SYMBOL_TKBOOL = 10, // 'tkBool' - SYMBOL_TKBOTTOMMINUS = 11, // 'tkBottomMinus' - SYMBOL_TKCASE = 12, // 'tkCase' - SYMBOL_TKCHAR = 13, // 'tkChar' - SYMBOL_TKCOLON = 14, // 'tkColon' - SYMBOL_TKCOMMA = 15, // 'tkComma' - SYMBOL_TKDO = 16, // 'tkDo' - SYMBOL_TKDOT = 17, // 'tkDot' - SYMBOL_TKDOUBLE = 18, // 'tkDouble' - SYMBOL_TKELSE = 19, // 'tkElse' - SYMBOL_TKEQUAL = 20, // 'tkEqual' - SYMBOL_TKFIGURECLOSE = 21, // 'tkFigureClose' - SYMBOL_TKFIGUREOPEN = 22, // 'tkFigureOpen' - SYMBOL_TKIDENT = 23, // 'tkIdent' - SYMBOL_TKIF = 24, // 'tkIf' - SYMBOL_TKIMPORT = 25, // 'tkImport' - SYMBOL_TKIN = 26, // 'tkIn' - SYMBOL_TKINT = 27, // 'tkInt' - SYMBOL_TKLEFTSLASH = 28, // 'tkLeftSlash' - SYMBOL_TKLESS = 29, // 'tkLess' - SYMBOL_TKLESSEQ = 30, // 'tkLessEq' - SYMBOL_TKLET = 31, // 'tkLet' - SYMBOL_TKMAINIDENT = 32, // 'tkMainIdent' - SYMBOL_TKMAINIDENT1 = 33, // 'tkMainIdent1' - SYMBOL_TKMINUS = 34, // 'tkMinus' - SYMBOL_TKMODULE = 35, // 'tkModule' - SYMBOL_TKMORE = 36, // 'tkMore' - SYMBOL_TKMOREEQ = 37, // 'tkMoreEq' - SYMBOL_TKNOT = 38, // 'tkNot' - SYMBOL_TKNOTEQUAL = 39, // 'tkNotEqual' - SYMBOL_TKOF = 40, // 'tkOf' - SYMBOL_TKOR = 41, // 'tkOr' - SYMBOL_TKOTHERWISE = 42, // 'tkOtherwise' - SYMBOL_TKPLUS = 43, // 'tkPlus' - SYMBOL_TKQUOTE = 44, // 'tkQuote' - SYMBOL_TKREF = 45, // 'tkRef' - SYMBOL_TKRETURN = 46, // 'tkReturn' - SYMBOL_TKROUNDCLOSE = 47, // 'tkRoundClose' - SYMBOL_TKROUNDOPEN = 48, // 'tkRoundOpen' - SYMBOL_TKSEMICOLON = 49, // 'tkSemiColon' - SYMBOL_TKSLASH = 50, // 'tkSlash' - SYMBOL_TKSPLIT = 51, // 'tkSplit' - SYMBOL_TKSQUARECLOSE = 52, // 'tkSquareClose' - SYMBOL_TKSQUAREOPEN = 53, // 'tkSquareOpen' - SYMBOL_TKSTAR = 54, // 'tkStar' - SYMBOL_TKSTRING = 55, // 'tkString' - SYMBOL_TKTHEN = 56, // 'tkThen' - SYMBOL_TKWHERE = 57, // 'tkWhere' - SYMBOL_ADD_EXPR = 58, // - SYMBOL_ADDOP = 59, // - SYMBOL_BODY = 60, // - SYMBOL_BODY_FUNC = 61, // - SYMBOL_BODY_WHERE = 62, // - SYMBOL_CASE_VARIANT = 63, // - SYMBOL_CASE_VARIANTS = 64, // - SYMBOL_CONDITION = 65, // - SYMBOL_CONDITIONS = 66, // - SYMBOL_CONDITIONS_COMMA = 67, // - SYMBOL_CORTEG = 68, // - SYMBOL_DEF_VAR = 69, // - SYMBOL_DEF_VARS = 70, // - SYMBOL_EMPTY = 71, // - SYMBOL_EXPR = 72, // - SYMBOL_FUNC_CALL = 73, // - SYMBOL_FUNCS = 74, // - SYMBOL_FUNCS_VARIANTS = 75, // - SYMBOL_GENERATOR = 76, // - SYMBOL_GENERATORS = 77, // - SYMBOL_GUARD = 78, // - SYMBOL_GUARD_BODY = 79, // - SYMBOL_GUARD_BODY_LIST = 80, // - SYMBOL_IMPORT = 81, // - SYMBOL_IMPORTS = 82, // - SYMBOL_INFIX_EXPR = 83, // - SYMBOL_INIT = 84, // - SYMBOL_INITS = 85, // - SYMBOL_LAMBDA_FUNC = 86, // - SYMBOL_LIST = 87, // - SYMBOL_LIST_CONSTRUCTOR = 88, // - SYMBOL_LIST_ELEMENTS = 89, // - SYMBOL_LIST_PARAM = 90, // - SYMBOL_LIST_PARAM1 = 91, // - SYMBOL_MAIN_FUNC = 92, // - SYMBOL_MODULE = 93, // - SYMBOL_MULT_EXPR = 94, // - SYMBOL_MULTOP = 95, // - SYMBOL_NEGATE_EXPR = 96, // - SYMBOL_PARAM = 97, // - SYMBOL_PARAM_VALUE = 98, // - SYMBOL_PARAMS = 99, // - SYMBOL_PARAMS_VALUE = 100, // - SYMBOL_PARAMS_WHERE = 101, // - SYMBOL_PARAMS1 = 102, // - SYMBOL_REFERENCE = 103, // - SYMBOL_SIMPLE_EXPR = 104, // - SYMBOL_SIMPLE_TYPE_EXPR = 105, // - SYMBOL_STMT = 106, // - SYMBOL_STMTS = 107, // - SYMBOL_STMTS1 = 108, // - SYMBOL_VARIABLE = 109, // - SYMBOL_VARIABLE_EXPR = 110, // - SYMBOL_VARIANT = 111, // - SYMBOL_VARIANTS = 112, // - SYMBOL_WHERE_VAR = 113 // -}; - - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//RuleConstants -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public enum RuleConstants : int -{ - RULE_MODULE_TKMODULE_TKMAINIDENT_TKWHERE = 0, // ::= 'tkModule' 'tkMainIdent' 'tkWhere' - RULE_MODULE = 1, // ::= - RULE_MODULE_TKMODULE_TKIDENT_TKWHERE = 2, // ::= 'tkModule' 'tkIdent' 'tkWhere' - RULE_REFERENCE = 3, // ::= - RULE_REFERENCE_TKREF_TKSTRING = 4, // ::= 'tkRef' 'tkString' - RULE_IMPORTS = 5, // ::= - RULE_IMPORTS2 = 6, // ::= - RULE_IMPORTS3 = 7, // ::= - RULE_IMPORT_TKIMPORT_TKIDENT = 8, // ::= 'tkImport' 'tkIdent' - RULE_BODY = 9, // ::= - RULE_BODY2 = 10, // ::= - RULE_FUNCS = 11, // ::= - RULE_FUNCS_VARIANTS = 12, // ::= - RULE_VARIANTS = 13, // ::= - RULE_VARIANTS2 = 14, // ::= - RULE_VARIANT_TKIDENT = 15, // ::= 'tkIdent' - RULE_VARIANT_TKQUOTE_TKIDENT_TKQUOTE = 16, // ::= 'tkQuote' 'tkIdent' 'tkQuote' - RULE_LIST_PARAM1 = 17, // ::= - RULE_BODY_WHERE = 18, // ::= - RULE_WHERE_VAR = 19, // ::= - RULE_WHERE_VAR_TKWHERE = 20, // ::= 'tkWhere' - RULE_INITS = 21, // ::= - RULE_INITS_TKSEMICOLON = 22, // ::= 'tkSemiColon' - RULE_INIT_TKIDENT = 23, // ::= 'tkIdent' - RULE_PARAMS_WHERE = 24, // ::= - RULE_PARAMS_WHERE2 = 25, // ::= - RULE_PARAMS_WHERE3 = 26, // ::= - RULE_PARAMS = 27, // ::= - RULE_PARAMS2 = 28, // ::= - RULE_PARAMS3 = 29, // ::= - RULE_PARAM = 30, // ::= - RULE_LIST_PARAM_TKIDENT = 31, // ::= 'tkIdent' - RULE_LIST_PARAM = 32, // ::= - RULE_LIST_PARAM_TKSQUAREOPEN_TKSQUARECLOSE = 33, // ::= 'tkSquareOpen' 'tkSquareClose' - RULE_LIST_PARAM_TKBOTTOMMINUS = 34, // ::= 'tkBottomMinus' - RULE_LIST_PARAM_TKIDENT_TKCOLON = 35, // ::= 'tkIdent' 'tkColon' - RULE_LIST_PARAM_TKBOTTOMMINUS_TKCOLON = 36, // ::= 'tkBottomMinus' 'tkColon' - RULE_LIST_PARAM_TKROUNDOPEN_TKROUNDCLOSE = 37, // ::= 'tkRoundOpen' 'tkRoundClose' - RULE_GUARD = 38, // ::= - RULE_GUARD_TKSPLIT = 39, // ::= 'tkSplit' - RULE_GUARD_TKSPLIT_TKOTHERWISE = 40, // ::= 'tkSplit' 'tkOtherwise' - RULE_MAIN_FUNC_TKMAINIDENT1_TKASSIGN = 41, // ::= 'tkMainIdent1' 'tkAssign' - RULE_BODY_FUNC = 42, // ::= - RULE_STMTS = 43, // ::= - RULE_STMTS_TKSEMICOLON = 44, // ::= 'tkSemiColon' - RULE_STMTS1 = 45, // ::= - RULE_STMTS12 = 46, // ::= - RULE_EXPR_TKEQUAL = 47, // ::= 'tkEqual' - RULE_EXPR_TKNOTEQUAL = 48, // ::= 'tkNotEqual' - RULE_EXPR_TKMORE = 49, // ::= 'tkMore' - RULE_EXPR_TKLESS = 50, // ::= 'tkLess' - RULE_EXPR_TKMOREEQ = 51, // ::= 'tkMoreEq' - RULE_EXPR_TKLESSEQ = 52, // ::= 'tkLessEq' - RULE_EXPR = 53, // ::= - RULE_LIST_TKSQUAREOPEN_TKSQUARECLOSE = 54, // ::= 'tkSquareOpen' 'tkSquareClose' - RULE_LIST_TKSQUAREOPEN_TKDOT_TKDOT_TKSQUARECLOSE = 55, // ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' - RULE_LIST_TKSQUAREOPEN_TKDOT_TKDOT_TKSQUARECLOSE2 = 56, // ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' - RULE_LIST = 57, // ::= - RULE_LIST_TKCOLON = 58, // ::= 'tkColon' - RULE_LIST_CONSTRUCTOR_TKSQUAREOPEN_TKSPLIT_TKSQUARECLOSE = 59, // ::= 'tkSquareOpen' 'tkSplit' 'tkSquareClose' - RULE_GENERATORS = 60, // ::= - RULE_GENERATORS_TKCOMMA = 61, // ::= 'tkComma' - RULE_GENERATOR_TKARROWGEN = 62, // ::= 'tkArrowGen' - RULE_CONDITIONS_COMMA = 63, // ::= - RULE_CONDITIONS_COMMA_TKCOMMA = 64, // ::= 'tkComma' - RULE_CONDITIONS = 65, // ::= - RULE_CONDITIONS_TKCOMMA = 66, // ::= 'tkComma' - RULE_CONDITION = 67, // ::= - RULE_CORTEG_TKROUNDOPEN_TKCOMMA_TKROUNDCLOSE = 68, // ::= 'tkRoundOpen' 'tkComma' 'tkRoundClose' - RULE_LIST_ELEMENTS = 69, // ::= - RULE_LIST_ELEMENTS2 = 70, // ::= - RULE_LIST_ELEMENTS_TKCOMMA = 71, // ::= 'tkComma' - RULE_ADD_EXPR_TKAND = 72, // ::= 'tkAnd' - RULE_ADD_EXPR = 73, // ::= - RULE_ADD_EXPR2 = 74, // ::= - RULE_MULT_EXPR_TKOR = 75, // ::= 'tkOr' - RULE_MULT_EXPR = 76, // ::= - RULE_MULT_EXPR2 = 77, // ::= - RULE_NEGATE_EXPR_TKMINUS = 78, // ::= 'tkMinus' - RULE_NEGATE_EXPR_TKNOT = 79, // ::= 'tkNot' - RULE_NEGATE_EXPR = 80, // ::= - RULE_SIMPLE_EXPR = 81, // ::= - RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDCLOSE = 82, // ::= 'tkRoundOpen' 'tkRoundClose' - RULE_SIMPLE_EXPR2 = 83, // ::= - RULE_SIMPLE_EXPR3 = 84, // ::= - RULE_SIMPLE_EXPR_TKLET_TKIN = 85, // ::= 'tkLet' 'tkIn' - RULE_SIMPLE_EXPR4 = 86, // ::= - RULE_SIMPLE_EXPR5 = 87, // ::= - RULE_SIMPLE_EXPR6 = 88, // ::= - RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDOPEN_TKROUNDCLOSE_TKROUNDCLOSE = 89, // ::= 'tkRoundOpen' 'tkRoundOpen' 'tkRoundClose' 'tkRoundClose' - RULE_SIMPLE_TYPE_EXPR_TKINT = 90, // ::= 'tkInt' - RULE_SIMPLE_TYPE_EXPR_TKDOUBLE = 91, // ::= 'tkDouble' - RULE_SIMPLE_TYPE_EXPR_TKBOOL = 92, // ::= 'tkBool' - RULE_SIMPLE_TYPE_EXPR_TKCHAR = 93, // ::= 'tkChar' - RULE_SIMPLE_TYPE_EXPR_TKSTRING = 94, // ::= 'tkString' - RULE_VARIABLE_EXPR = 95, // ::= - RULE_DEF_VARS = 96, // ::= - RULE_DEF_VARS_TKSEMICOLON = 97, // ::= 'tkSemiColon' - RULE_DEF_VAR_TKIDENT = 98, // ::= 'tkIdent' - RULE_GUARD_BODY_LIST = 99, // ::= - RULE_GUARD_BODY_LIST2 = 100, // ::= - RULE_GUARD_BODY_TKASSIGN = 101, // ::= 'tkAssign' - RULE_VARIABLE_TKIDENT = 102, // ::= 'tkIdent' - RULE_VARIABLE_TKROUNDOPEN_TKIDENT_TKROUNDCLOSE = 103, // ::= 'tkRoundOpen' 'tkIdent' 'tkRoundClose' - RULE_VARIABLE_TKROUNDOPEN_TKROUNDCLOSE = 104, // ::= 'tkRoundOpen' 'tkRoundClose' - RULE_VARIABLE_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE = 105, // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE = 106, // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE2 = 107, // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - RULE_INFIX_EXPR_TKROUNDOPEN_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE_TKROUNDCLOSE = 108, // ::= 'tkRoundOpen' 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' 'tkRoundClose' - RULE_MULTOP_TKSTAR = 109, // ::= 'tkStar' - RULE_MULTOP_TKSLASH = 110, // ::= 'tkSlash' - RULE_ADDOP_TKPLUS = 111, // ::= 'tkPlus' - RULE_ADDOP_TKMINUS = 112, // ::= 'tkMinus' - RULE_STMT_TKIDENT_TKARROWGEN_TKIDENT = 113, // ::= 'tkIdent' 'tkArrowGen' 'tkIdent' - RULE_STMT_TKIF_TKTHEN_TKELSE = 114, // ::= 'tkIf' 'tkThen' 'tkElse' - RULE_STMT_TKCASE_TKROUNDOPEN_TKROUNDCLOSE_TKOF = 115, // ::= 'tkCase' 'tkRoundOpen' 'tkRoundClose' 'tkOf' - RULE_STMT_TKDO_TKFIGUREOPEN_TKSEMICOLON_TKFIGURECLOSE = 116, // ::= 'tkDo' 'tkFigureOpen' 'tkSemiColon' 'tkFigureClose' - RULE_STMT_TKDO = 117, // ::= 'tkDo' - RULE_STMT_TKRETURN = 118, // ::= 'tkReturn' - RULE_STMT = 119, // ::= - RULE_CASE_VARIANTS = 120, // ::= - RULE_CASE_VARIANTS_TKSPLIT = 121, // ::= 'tkSplit' - RULE_CASE_VARIANT_TKROUNDOPEN_TKROUNDCLOSE_TKARROW = 122, // ::= 'tkRoundOpen' 'tkRoundClose' 'tkArrow' - RULE_PARAMS1 = 123, // ::= - RULE_PARAMS1_TKCOMMA = 124, // ::= 'tkComma' - RULE_FUNC_CALL = 125, // ::= - RULE_PARAMS_VALUE = 126, // ::= - RULE_PARAMS_VALUE2 = 127, // ::= - RULE_PARAM_VALUE = 128, // ::= - RULE_LAMBDA_FUNC_TKLEFTSLASH_TKARROW = 129, // ::= 'tkLeftSlash' 'tkArrow' - RULE_EMPTY = 130 // ::= -}; - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -private Object CreateTerminalObject(int TokenSymbolIndex) -{ -switch (TokenSymbolIndex) -{ - case (int)SymbolConstants.SYMBOL_EOF : - //(EOF) - //TERMINAL:EOF - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ERROR : - //(Error) - //TERMINAL:Error - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_WHITESPACE : - //(Whitespace) - //TERMINAL:Whitespace - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_COMMENTEND : - //(Comment End) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment End' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_COMMENTLINE : - //(Comment Line) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment Line' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_COMMENTSTART : - //(Comment Start) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment Start' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_TKAND : - //'tkAnd' - - { - op_type_node _op_type_node=new op_type_node(Operators.LogicalAND); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKARROW : - //'tkArrow' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKARROWGEN : - //'tkArrowGen' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKASSIGN : - //'tkAssign' -{ - if (token_where == 2 || token_where == 1) - { - token_where = 0; - //if (let_where_funcs_main.Count > 1) - //for (int i = 0; i let_where_funcs.Count; i++) - //if (let_funcs.Count > 0) - //let_funcs.RemoveAt(let_funcs.Count - 1); - let_where_funcs_main.Add(let_where_funcs.Clone()); - let_where_funcs.Clear(); - } - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - case (int)SymbolConstants.SYMBOL_TKBOOL : - //'tkBool' -{ - ident _ident = null; - string s = LRParser.TokenText; - if (s == "True" || s == "true") - s = "true"; - else - s = "false"; - _ident =new ident(s); - _ident.source_context = parsertools.GetTokenSourceContext(); - return _ident; - } - case (int)SymbolConstants.SYMBOL_TKBOTTOMMINUS : - //'tkBottomMinus' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCASE : - //'tkCase' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCHAR : - //'tkChar' -return parsertools.create_char_const(this); - case (int)SymbolConstants.SYMBOL_TKCOLON : - //'tkColon' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCOMMA : - //'tkComma' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKDO : - //'tkDo' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKDOT : - //'tkDot' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKDOUBLE : - //'tkDouble' -return parsertools.create_double_const(this); - case (int)SymbolConstants.SYMBOL_TKELSE : - //'tkElse' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKEQUAL : - //'tkEqual' - - { - op_type_node _op_type_node=new op_type_node(Operators.Equal); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKFIGURECLOSE : - //'tkFigureClose' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKFIGUREOPEN : - //'tkFigureOpen' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKIDENT : - //'tkIdent' -return parsertools.create_ident(this); - case (int)SymbolConstants.SYMBOL_TKIF : - //'tkIf' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKIMPORT : - //'tkImport' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKIN : - //'tkIn' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKINT : - //'tkInt' -return parsertools.create_int_const(this); - case (int)SymbolConstants.SYMBOL_TKLEFTSLASH : - //'tkLeftSlash' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKLESS : - //'tkLess' - - { - op_type_node _op_type_node=new op_type_node(Operators.Less); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKLESSEQ : - //'tkLessEq' - - { - op_type_node _op_type_node=new op_type_node(Operators.LessEqual); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKLET : - //'tkLet' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKMAINIDENT : - //'tkMainIdent' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKMAINIDENT1 : - //'tkMainIdent1' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKMINUS : - //'tkMinus' - - { - op_type_node _op_type_node=new op_type_node(Operators.Minus); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKMODULE : - //'tkModule' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKMORE : - //'tkMore' - - { - op_type_node _op_type_node=new op_type_node(Operators.Greater); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKMOREEQ : - //'tkMoreEq' - - { - op_type_node _op_type_node=new op_type_node(Operators.GreaterEqual); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKNOT : - //'tkNot' - - { - op_type_node _op_type_node=new op_type_node(Operators.LogicalNOT); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKNOTEQUAL : - //'tkNotEqual' - - { - op_type_node _op_type_node=new op_type_node(Operators.NotEqual); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKOF : - //'tkOf' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKOR : - //'tkOr' - - { - op_type_node _op_type_node=new op_type_node(Operators.LogicalOR); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKOTHERWISE : - //'tkOtherwise' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKPLUS : - //'tkPlus' - - { - op_type_node _op_type_node=new op_type_node(Operators.Plus); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKQUOTE : - //'tkQuote' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKREF : - //'tkRef' -return parsertools.create_directive_name(this); - case (int)SymbolConstants.SYMBOL_TKRETURN : - //'tkReturn' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKROUNDCLOSE : - //'tkRoundClose' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKROUNDOPEN : - //'tkRoundOpen' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSEMICOLON : - //'tkSemiColon' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSLASH : - //'tkSlash' - - { - op_type_node _op_type_node=new op_type_node(Operators.IntegerDivision); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKSPLIT : - //'tkSplit' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSQUARECLOSE : - //'tkSquareClose' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSQUAREOPEN : - //'tkSquareOpen' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSTAR : - //'tkStar' - - { - op_type_node _op_type_node=new op_type_node(Operators.Multiplication); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKSTRING : - //'tkString' -return parsertools.create_string_const(this); - case (int)SymbolConstants.SYMBOL_TKTHEN : - //'tkThen' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKWHERE : - //'tkWhere' -{ - token_where = 1; - token_where_count++; - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - case (int)SymbolConstants.SYMBOL_ADD_EXPR : - // - //TERMINAL:add_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ADDOP : - // - //TERMINAL:addop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_BODY : - // - //TERMINAL:body - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_BODY_FUNC : - // - //TERMINAL:body_func - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_BODY_WHERE : - // - //TERMINAL:body_where - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CASE_VARIANT : - // - //TERMINAL:case_variant - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CASE_VARIANTS : - // - //TERMINAL:case_variants - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONDITION : - // - //TERMINAL:condition - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONDITIONS : - // - //TERMINAL:conditions - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONDITIONS_COMMA : - // - //TERMINAL:conditions_comma - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CORTEG : - // - //TERMINAL:corteg - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_DEF_VAR : - // - //TERMINAL:def_var - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_DEF_VARS : - // - //TERMINAL:def_vars - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EMPTY : - // - //TERMINAL:empty - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPR : - // - //TERMINAL:expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_CALL : - // - //TERMINAL:func_call - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNCS : - // - //TERMINAL:funcs - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNCS_VARIANTS : - // - //TERMINAL:funcs_variants - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GENERATOR : - // - //TERMINAL:generator - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GENERATORS : - // - //TERMINAL:generators - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GUARD : - // - //TERMINAL:guard - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GUARD_BODY : - // - //TERMINAL:guard_body - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GUARD_BODY_LIST : - // - //TERMINAL:guard_body_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IMPORT : - // - //TERMINAL:import - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IMPORTS : - // - //TERMINAL:imports - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INFIX_EXPR : - // - //TERMINAL:infix_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INIT : - // - //TERMINAL:init - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INITS : - // - //TERMINAL:inits - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LAMBDA_FUNC : - // - //TERMINAL:lambda_func - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST : - // - //TERMINAL:list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST_CONSTRUCTOR : - // - //TERMINAL:list_constructor - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST_ELEMENTS : - // - //TERMINAL:list_elements - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST_PARAM : - // - //TERMINAL:list_param - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST_PARAM1 : - // - //TERMINAL:list_param1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MAIN_FUNC : - // - //TERMINAL:main_func - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MODULE : - // - //TERMINAL:module - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MULT_EXPR : - // - //TERMINAL:mult_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MULTOP : - // - //TERMINAL:multop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NEGATE_EXPR : - // - //TERMINAL:negate_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAM : - // - //TERMINAL:param - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAM_VALUE : - // - //TERMINAL:param_value - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAMS : - // - //TERMINAL:params - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAMS_VALUE : - // - //TERMINAL:params_value - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAMS_WHERE : - // - //TERMINAL:params_where - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAMS1 : - // - //TERMINAL:params1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_REFERENCE : - // - //TERMINAL:reference - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_EXPR : - // - //TERMINAL:simple_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_TYPE_EXPR : - // - //TERMINAL:simple_type_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STMT : - // - //TERMINAL:stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STMTS : - // - //TERMINAL:stmts - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STMTS1 : - // - //TERMINAL:stmts1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIABLE : - // - //TERMINAL:variable - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIABLE_EXPR : - // - //TERMINAL:variable_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIANT : - // - //TERMINAL:variant - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIANTS : - // - //TERMINAL:variants - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_WHERE_VAR : - // - //TERMINAL:where_var - return null; - //ENDTERMINAL -} -throw new SymbolException("Unknown symbol"); -} - - - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateNonTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -public ArrayList param_value_list = new ArrayList(); -public ArrayList body_variant_list = new ArrayList(); -public ArrayList param_value_list_main = new ArrayList(); -public ArrayList body_variant_list_main = new ArrayList(); -public ArrayList guard_list = new ArrayList(); -public ArrayList guard_list_main = new ArrayList(); -public ArrayList where_list_var = new ArrayList(); -public ArrayList where_list_assign = new ArrayList(); -public ArrayList where_list_var_main = new ArrayList(); -public ArrayList where_list_assign_main = new ArrayList(); -public ArrayList func_name = new ArrayList(); -public ArrayList where_list_counts=new ArrayList(); -public ArrayList where_list_counts_main = new ArrayList(); -public int decls_counts = 0; -public bool where_flag = false; -public ArrayList list_param = new ArrayList(); -public ArrayList list_params = new ArrayList(); -public ArrayList list_params_temp = new ArrayList(); -public ArrayList list_params_main = new ArrayList(); -public ArrayList _function_lambda_definitions = new ArrayList(); -public ArrayList _function_lambda_definitions_after = new ArrayList(); -public int lambda_num = 0; -public ArrayList _functions = new ArrayList(); -public ArrayList list_method_calls = new ArrayList(); -public ArrayList list_method_calls_main = new ArrayList(); -public ArrayList list_return_funcs = new ArrayList(); -public ArrayList list_return_funcs_main = new ArrayList(); -public ArrayList list_params1 = new ArrayList(); -public ArrayList last_function_lambda_definitions = new ArrayList(); -public ArrayList last_list_method_calls = new ArrayList(); -public ArrayList last_list_method_calls_lambda = new ArrayList(); -public ArrayList let_fact_params = new ArrayList(); -public ArrayList let_funcs = new ArrayList(); -public ArrayList let_funcs_funcs = new ArrayList(); -public ArrayList let_func_last = new ArrayList(); -public ArrayList let_funcs1 = new ArrayList(); -public ArrayList let_flag = new ArrayList(); -public struct types_param_lampda -{ - public string name; - public ArrayList types; -} -public ArrayList list_method_calls_lambda = new ArrayList(); - -public Object CreateNonTerminalObject(int ReductionRuleIndex) -{ -switch (ReductionRuleIndex) -{ - case (int)RuleConstants.RULE_MODULE_TKMODULE_TKMAINIDENT_TKWHERE : - // ::= 'tkModule' 'tkMainIdent' 'tkWhere' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkModule tkMainIdent tkWhere "));}return null; - case (int)RuleConstants.RULE_MODULE : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_MODULE_TKMODULE_TKIDENT_TKWHERE : - // ::= 'tkModule' 'tkIdent' 'tkWhere' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkModule tkIdent tkWhere "));}return null; - case (int)RuleConstants.RULE_REFERENCE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_REFERENCE_TKREF_TKSTRING : - // ::= 'tkRef' 'tkString' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRef tkString"));}return null; - case (int)RuleConstants.RULE_IMPORTS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_IMPORTS2 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_IMPORTS3 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_IMPORT_TKIMPORT_TKIDENT : - // ::= 'tkImport' 'tkIdent' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkImport tkIdent"));}return null; - case (int)RuleConstants.RULE_BODY : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_BODY2 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_FUNCS : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_FUNCS_VARIANTS : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_VARIANTS : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_VARIANTS2 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_VARIANT_TKIDENT : - // ::= 'tkIdent' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkIdent "));}return null; - case (int)RuleConstants.RULE_VARIANT_TKQUOTE_TKIDENT_TKQUOTE : - // ::= 'tkQuote' 'tkIdent' 'tkQuote' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkQuote tkIdent tkQuote "));}return null; - case (int)RuleConstants.RULE_LIST_PARAM1 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_BODY_WHERE : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_WHERE_VAR : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_WHERE_VAR_TKWHERE : - // ::= 'tkWhere' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkWhere "));}return null; - case (int)RuleConstants.RULE_INITS : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_INITS_TKSEMICOLON : - // ::= 'tkSemiColon' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkSemiColon "));}return null; - case (int)RuleConstants.RULE_INIT_TKIDENT : - // ::= 'tkIdent' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkIdent "));}return null; - case (int)RuleConstants.RULE_PARAMS_WHERE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS_WHERE2 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_PARAMS_WHERE3 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_PARAMS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS2 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_PARAMS3 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_PARAM : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIST_PARAM_TKIDENT : - // ::= 'tkIdent' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkIdent "));}return null; - case (int)RuleConstants.RULE_LIST_PARAM : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_LIST_PARAM_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= 'tkSquareOpen' 'tkSquareClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkSquareOpen tkSquareClose"));}return null; - case (int)RuleConstants.RULE_LIST_PARAM_TKBOTTOMMINUS : - // ::= 'tkBottomMinus' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIST_PARAM_TKIDENT_TKCOLON : - // ::= 'tkIdent' 'tkColon' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkIdent tkColon "));}return null; - case (int)RuleConstants.RULE_LIST_PARAM_TKBOTTOMMINUS_TKCOLON : - // ::= 'tkBottomMinus' 'tkColon' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkBottomMinus tkColon "));}return null; - case (int)RuleConstants.RULE_LIST_PARAM_TKROUNDOPEN_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkRoundClose"));}return null; - case (int)RuleConstants.RULE_GUARD : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_GUARD_TKSPLIT : - // ::= 'tkSplit' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkSplit "));}return null; - case (int)RuleConstants.RULE_GUARD_TKSPLIT_TKOTHERWISE : - // ::= 'tkSplit' 'tkOtherwise' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkSplit tkOtherwise"));}return null; - case (int)RuleConstants.RULE_MAIN_FUNC_TKMAINIDENT1_TKASSIGN : - // ::= 'tkMainIdent1' 'tkAssign' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkMainIdent1 tkAssign "));}return null; - case (int)RuleConstants.RULE_BODY_FUNC : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_STMTS : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_STMTS_TKSEMICOLON : - // ::= 'tkSemiColon' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkSemiColon "));}return null; - case (int)RuleConstants.RULE_STMTS1 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_STMTS12 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_EXPR_TKEQUAL : - // ::= 'tkEqual' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkEqual "));}return null; - case (int)RuleConstants.RULE_EXPR_TKNOTEQUAL : - // ::= 'tkNotEqual' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkNotEqual "));}return null; - case (int)RuleConstants.RULE_EXPR_TKMORE : - // ::= 'tkMore' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkMore "));}return null; - case (int)RuleConstants.RULE_EXPR_TKLESS : - // ::= 'tkLess' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkLess "));}return null; - case (int)RuleConstants.RULE_EXPR_TKMOREEQ : - // ::= 'tkMoreEq' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkMoreEq "));}return null; - case (int)RuleConstants.RULE_EXPR_TKLESSEQ : - // ::= 'tkLessEq' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkLessEq "));}return null; - case (int)RuleConstants.RULE_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIST_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= 'tkSquareOpen' 'tkSquareClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkSquareOpen tkSquareClose"));}return null; - case (int)RuleConstants.RULE_LIST_TKSQUAREOPEN_TKDOT_TKDOT_TKSQUARECLOSE : - // ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkSquareOpen tkDot tkDot tkSquareClose"));}return null; - case (int)RuleConstants.RULE_LIST_TKSQUAREOPEN_TKDOT_TKDOT_TKSQUARECLOSE2 : - // ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkSquareOpen tkDot tkDot tkSquareClose"));}return null; - case (int)RuleConstants.RULE_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIST_TKCOLON : - // ::= 'tkColon' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkColon "));}return null; - case (int)RuleConstants.RULE_LIST_CONSTRUCTOR_TKSQUAREOPEN_TKSPLIT_TKSQUARECLOSE : - // ::= 'tkSquareOpen' 'tkSplit' 'tkSquareClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkSquareOpen tkSplit tkSquareClose"));}return null; - case (int)RuleConstants.RULE_GENERATORS : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_GENERATORS_TKCOMMA : - // ::= 'tkComma' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkComma "));}return null; - case (int)RuleConstants.RULE_GENERATOR_TKARROWGEN : - // ::= 'tkArrowGen' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkArrowGen "));}return null; - case (int)RuleConstants.RULE_CONDITIONS_COMMA : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONDITIONS_COMMA_TKCOMMA : - // ::= 'tkComma' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkComma "));}return null; - case (int)RuleConstants.RULE_CONDITIONS : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_CONDITIONS_TKCOMMA : - // ::= 'tkComma' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkComma "));}return null; - case (int)RuleConstants.RULE_CONDITION : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CORTEG_TKROUNDOPEN_TKCOMMA_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkComma' 'tkRoundClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkComma tkRoundClose"));}return null; - case (int)RuleConstants.RULE_LIST_ELEMENTS : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIST_ELEMENTS2 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_LIST_ELEMENTS_TKCOMMA : - // ::= 'tkComma' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkComma "));}return null; - case (int)RuleConstants.RULE_ADD_EXPR_TKAND : - // ::= 'tkAnd' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkAnd "));}return null; - case (int)RuleConstants.RULE_ADD_EXPR : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_ADD_EXPR2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_MULT_EXPR_TKOR : - // ::= 'tkOr' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkOr "));}return null; - case (int)RuleConstants.RULE_MULT_EXPR : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_MULT_EXPR2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NEGATE_EXPR_TKMINUS : - // ::= 'tkMinus' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkMinus "));}return null; - case (int)RuleConstants.RULE_NEGATE_EXPR_TKNOT : - // ::= 'tkNot' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkNot "));}return null; - case (int)RuleConstants.RULE_NEGATE_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkRoundClose"));}return null; - case (int)RuleConstants.RULE_SIMPLE_EXPR2 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_SIMPLE_EXPR3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_EXPR_TKLET_TKIN : - // ::= 'tkLet' 'tkIn' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkLet tkIn "));}return null; - case (int)RuleConstants.RULE_SIMPLE_EXPR4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_EXPR5 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_EXPR6 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDOPEN_TKROUNDCLOSE_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundOpen' 'tkRoundClose' 'tkRoundClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkRoundOpen tkRoundClose tkRoundClose"));}return null; - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKINT : - // ::= 'tkInt' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKDOUBLE : - // ::= 'tkDouble' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKBOOL : - // ::= 'tkBool' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKCHAR : - // ::= 'tkChar' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKSTRING : - // ::= 'tkString' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIABLE_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_DEF_VARS : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_DEF_VARS_TKSEMICOLON : - // ::= 'tkSemiColon' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkSemiColon "));}return null; - case (int)RuleConstants.RULE_DEF_VAR_TKIDENT : - // ::= 'tkIdent' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkIdent "));}return null; - case (int)RuleConstants.RULE_GUARD_BODY_LIST : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_GUARD_BODY_LIST2 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_GUARD_BODY_TKASSIGN : - // ::= 'tkAssign' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkAssign "));}return null; - case (int)RuleConstants.RULE_VARIABLE_TKIDENT : - // ::= 'tkIdent' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKIDENT_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkIdent' 'tkRoundClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkIdent tkRoundClose"));}return null; - case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkRoundClose"));}return null; - case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkQuote tkIdent tkQuote tkRoundClose"));}return null; - case (int)RuleConstants.RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkQuote tkIdent tkQuote tkRoundClose"));}return null; - case (int)RuleConstants.RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE2 : - // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkQuote tkIdent tkQuote tkRoundClose"));}return null; - case (int)RuleConstants.RULE_INFIX_EXPR_TKROUNDOPEN_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' 'tkRoundClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkRoundOpen tkQuote tkIdent tkQuote tkRoundClose tkRoundClose"));}return null; - case (int)RuleConstants.RULE_MULTOP_TKSTAR : - // ::= 'tkStar' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_MULTOP_TKSLASH : - // ::= 'tkSlash' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ADDOP_TKPLUS : - // ::= 'tkPlus' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ADDOP_TKMINUS : - // ::= 'tkMinus' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_STMT_TKIDENT_TKARROWGEN_TKIDENT : - // ::= 'tkIdent' 'tkArrowGen' 'tkIdent' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkIdent tkArrowGen tkIdent"));}return null; - case (int)RuleConstants.RULE_STMT_TKIF_TKTHEN_TKELSE : - // ::= 'tkIf' 'tkThen' 'tkElse' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkIf tkThen tkElse "));}return null; - case (int)RuleConstants.RULE_STMT_TKCASE_TKROUNDOPEN_TKROUNDCLOSE_TKOF : - // ::= 'tkCase' 'tkRoundOpen' 'tkRoundClose' 'tkOf' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkCase tkRoundOpen tkRoundClose tkOf "));}return null; - case (int)RuleConstants.RULE_STMT_TKDO_TKFIGUREOPEN_TKSEMICOLON_TKFIGURECLOSE : - // ::= 'tkDo' 'tkFigureOpen' 'tkSemiColon' 'tkFigureClose' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkDo tkFigureOpen tkSemiColon tkFigureClose"));}return null; - case (int)RuleConstants.RULE_STMT_TKDO : - // ::= 'tkDo' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkDo "));}return null; - case (int)RuleConstants.RULE_STMT_TKRETURN : - // ::= 'tkReturn' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkReturn "));}return null; - case (int)RuleConstants.RULE_STMT : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CASE_VARIANTS : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_CASE_VARIANTS_TKSPLIT : - // ::= 'tkSplit' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkSplit "));}return null; - case (int)RuleConstants.RULE_CASE_VARIANT_TKROUNDOPEN_TKROUNDCLOSE_TKARROW : - // ::= 'tkRoundOpen' 'tkRoundClose' 'tkArrow' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkRoundClose tkArrow "));}return null; - case (int)RuleConstants.RULE_PARAMS1 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_PARAMS1_TKCOMMA : - // ::= 'tkComma' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkComma "));}return null; - case (int)RuleConstants.RULE_FUNC_CALL : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_PARAMS_VALUE : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_PARAMS_VALUE2 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_PARAM_VALUE : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_LAMBDA_FUNC_TKLEFTSLASH_TKARROW : - // ::= 'tkLeftSlash' 'tkArrow' - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkLeftSlash tkArrow "));}return null; - case (int)RuleConstants.RULE_EMPTY : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL -} -throw new RuleException("Unknown rule"); -} - -public method_call _ob(object dt) - { - token_info _token_info = new token_info("."); - _token_info.source_context = parsertools.GetTokenSourceContext(); - /////////// - ident id = new ident("ob"); - dot_node _dot_node = new dot_node(null, (addressed_value)id); - parsertools.create_source_context(_dot_node, _token_info, id); - _dot_node.left = (addressed_value)dt; - parsertools.create_source_context(_dot_node, dt, _dot_node.right); - ///////////////////////// - expression_list el = new expression_list(); - el.expressions.Add(_dot_node); - method_call _method_call = new method_call(el); - parsertools.create_source_context(_method_call, null, null); - ///////////////////////// - ident id1 = new ident("boolean"); - ///////////////////////// - if (_method_call is dereference) - { - ((dereference)_method_call).dereferencing_value = (addressed_value)id1; - parsertools.create_source_context(_method_call, id1, _method_call); - } - return _method_call; - } -public procedure_definition lambda(function_lambda_definition _function_lambda_definition) -{ - SyntaxTree.procedure_definition _func_def = new PascalABCCompiler.SyntaxTree.procedure_definition(); - SyntaxTree.method_name _method_name1 = new SyntaxTree.method_name(null, new SyntaxTree.ident(_function_lambda_definition.lambda_name), null); - SyntaxTree.function_header _function_header1 = new SyntaxTree.function_header(); - - object rt1 = new object(); - _function_header1.name = _method_name1; - SyntaxTree.formal_parametres fps = new PascalABCCompiler.SyntaxTree.formal_parametres(); - _function_header1.parametres = _function_lambda_definition.formal_parametres;//fps; - SyntaxTree.named_type_reference _named_type_reference = new SyntaxTree.named_type_reference(); - SyntaxTree.ident idtype = new SyntaxTree.ident("datatype"); - _named_type_reference.source_context = idtype.source_context; - _named_type_reference.names.Add(idtype); - - rt1 = _named_type_reference; - _function_header1.return_type = (SyntaxTree.type_definition)_named_type_reference; - - _function_header1.of_object = false; - _function_header1.class_keyword = false; - SyntaxTree.block _block1 = new SyntaxTree.block(null, null); - SyntaxTree.statement_list sl1 = new SyntaxTree.statement_list(); - sl1.subnodes.Add(_function_lambda_definition.proc_body); - _block1.program_code = sl1; - _func_def.proc_header = _function_header1; - _func_def.proc_body = (SyntaxTree.proc_block)_block1; - _function_lambda_definition.proc_definition = _func_def; - return _func_def; -} - -public procedure_definition find_function1(string name) -{ - int i = 0; - while (i < _functions.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != name) - i++; - if (i < _functions.Count) - return (procedure_definition)_functions[i]; - else - return null; -} - -public int find_count_params(string name) -{ - if (param_value_list_main.Count == 0 && param_value_list.Count == 0) - { - int i = 0; - while (i < _functions.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != name) - i++; - if (i < _functions.Count) - { - if (((procedure_definition)_functions[i]).proc_header.parametres == null) - return 0; - else - return ((procedure_definition)_functions[i]).proc_header.parametres.params_list.Count; - } - else - return 0; - } - else - { - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != name) - i++; - if (i < func_name.Count) - { - if (i >= param_value_list_main.Count) - { - if (i >= param_value_list_main.Count) - //if (param_value_list_main.Count==0) - { - if (param_value_list[param_value_list.Count - 1] == null) - return 0; - else - return ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Count; - } - else - return 0; - } - else - { - if (((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1] == null) - return 0; - else - return ((expression_list)((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1]).expressions.Count; - } - } - else - return 0; - } -} -public int find_count_params_lambda(string name) -{ - int i = 0; - while (i < _function_lambda_definitions_after.Count && ((function_lambda_definition)_function_lambda_definitions_after[i]).lambda_name != name) - i += 2; - if (i < _function_lambda_definitions_after.Count) - return ((function_lambda_definition)_function_lambda_definitions_after[i]).formal_parametres.params_list.Count; - else - return -1; -} - -public string find_name_params_lambda(string name, int ind) -{ - int i = 0; - while (i < _function_lambda_definitions_after.Count && ((function_lambda_definition)_function_lambda_definitions_after[i]).lambda_name != name) - i += 2; - if (i < _function_lambda_definitions_after.Count) - { - formal_parametres fp = ((function_lambda_definition)_function_lambda_definitions_after[i]).formal_parametres; - if (ind < fp.params_list.Count) - return fp.params_list[ind].idents.idents[0].name; - else - return ""; - } - else - return ""; -} - -public bool find_func_name(string name) -{ - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != name) - i++; - if (i < func_name.Count) - return true; - else - return false; -} - -public function_lambda_definition find_func_lambda_name(string name) -{ - int i = 0; - while (i < _function_lambda_definitions.Count && ((function_lambda_definition)_function_lambda_definitions[i]).lambda_name != name) - i++; - if (i < _function_lambda_definitions.Count) - return (function_lambda_definition)_function_lambda_definitions[i]; - else - return null; -} - -public type_definition func_type(int count) -{ - //int count = mc.parametres.expressions.Count; - - formal_parametres _formal_parametres = new formal_parametres(); - for (int i = 0; i < count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = new ident("$a" + i.ToString()); - _ident_list.idents.Add(id); - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.names.Add(idtype1); - typed_parametres _typed_parametres = new typed_parametres(_ident_list, (type_definition)_named_type_reference1, parametr_kind.none, null); - _formal_parametres.params_list.Add(_typed_parametres); - } - named_type_reference _named_type_reference = new named_type_reference(); - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - function_header _function_header = new function_header(); - _function_header.parametres = _formal_parametres; - _function_header.return_type = (type_definition)_named_type_reference; - _function_header.of_object = false; - _function_header.class_keyword = false; - return (type_definition)_function_header; -} - -public var_statement var_st(string name, type_definition td) -{ - ident_list il = new ident_list(); - il.idents.Add(new ident(name)); - var_def_statement _var_def_statement = new var_def_statement(il, td, null, definition_attribute.None, false); - return new var_statement(_var_def_statement); -} - -public method_call find_method_call(string name, int k) -{ - int i = 0; - while (i < ((ArrayList)list_method_calls_main[k]).Count && - ((ident)((method_call)((ArrayList)list_method_calls_main[k])[i]).dereferencing_value).name != name) - i++; - if (i < ((ArrayList)list_method_calls_main[k]).Count) - return (method_call)((ArrayList)list_method_calls_main[k])[i]; - else - return null; -} - -public method_call find_method_call_lambda(string name) -{ - int i = 0; - while (i < list_method_calls_lambda.Count && - ((ident)((method_call)list_method_calls_lambda[i]).dereferencing_value).name != name) - i++; - if (i < list_method_calls_lambda.Count) - return (method_call)list_method_calls_lambda[i]; - else - return null; -} -public function_lambda_definition find_func_lambda_after(string name) -{ - int i = 0; - while (i < _function_lambda_definitions_after.Count && - ((function_lambda_definition)_function_lambda_definitions_after[i]).lambda_name != name) - i += 2; - if (i < _function_lambda_definitions_after.Count) - return _function_lambda_definitions_after[i] as function_lambda_definition; - else - return null; -} -public ArrayList find_params(string name) -{ - ArrayList _params = new ArrayList(); - if (param_value_list_main.Count == 0 && param_value_list.Count == 0) - { - int i = 0; - while (i < _functions.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != name) - i++; - if (i < _functions.Count) - { - if (((procedure_definition)_functions[i]).proc_header.parametres == null) - return _params; - else - { - for (int j = 0; j < ((procedure_definition)_functions[i]).proc_header.parametres.params_list.Count; j++) - _params.Add(((procedure_definition)_functions[i]).proc_header.parametres.params_list[j]); - return _params; - } - } - else - return _params; - } - else - { - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != name) - i++; - if (i < func_name.Count) - { - if (i >= param_value_list_main.Count) - { - if (i >= param_value_list_main.Count) - //if (param_value_list_main.Count==0) - { - if (param_value_list[param_value_list.Count - 1] == null) - return _params; - else - { - for (int j = 0; j < ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Count; j++) - _params.Add(((expression_list)param_value_list[param_value_list.Count - 1]).expressions[j]); - return _params; - } - } - else - return _params; - } - else - { - if (((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1] == null) - return _params; - else - { - for (int j = 0; j < ((expression_list)((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1]).expressions.Count; j++) - _params.Add(((expression_list)((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1]).expressions[j]); - return _params; - } - } - } - else - return _params; - } -} - - - -} -} diff --git a/Grammars/Haskell/bat.txt b/Grammars/Haskell/bat.txt deleted file mode 100644 index 1c18e5eed..000000000 --- a/Grammars/Haskell/bat.txt +++ /dev/null @@ -1,31 +0,0 @@ -cls -@echo off -echo [Haskell] GRM to CS,RES compiler. -echo. - -echo Delete old files... -del Haskell_lrparser_rules.cs -del haskell_parser.cgt -del HaskellLang.resources -del haskell_parser.tmpl -del haskell_parser.log - -echo Compile: GRM to CGT... -start /wait ..\..\Utils\gpbcmd\goldbuilder_main haskell_parser.grm haskell_parser.cgt -copy haskell_parser.log con -echo. - -echo Compile: CGT,PGT to TEMPLATE... -start /wait ..\..\Utils\gpbcmd\createskelprog_main haskell_parser.cgt haskell_parser.pgt haskell_parser.tmpl -echo. - -echo Compile: GRM,TEMPLATE to CS... -..\..\Utils\grmCommentCompiler\bin\Debug\grmCommentCompiler.exe haskell_parser.grm haskell_parser.tmpl Haskell_lrparser_rules.cs -echo. - -echo Compile: CGT to RES... -start /wait ..\..\Utils\ResXMaker\ResXMaker.exe haskell_parser.CGT HaskellLanguage HaskellLang.resources -echo. - -copy HaskellLang.resources ..\..\Parsers\HaskellParser\HaskellLang.resources -copy Haskell_lrparser_rules.cs ..\..\Parsers\HaskellParser\Haskell_lrparser_rules.cs \ No newline at end of file diff --git a/Grammars/Haskell/compile_ALL.bat b/Grammars/Haskell/compile_ALL.bat deleted file mode 100644 index 1c18e5eed..000000000 --- a/Grammars/Haskell/compile_ALL.bat +++ /dev/null @@ -1,31 +0,0 @@ -cls -@echo off -echo [Haskell] GRM to CS,RES compiler. -echo. - -echo Delete old files... -del Haskell_lrparser_rules.cs -del haskell_parser.cgt -del HaskellLang.resources -del haskell_parser.tmpl -del haskell_parser.log - -echo Compile: GRM to CGT... -start /wait ..\..\Utils\gpbcmd\goldbuilder_main haskell_parser.grm haskell_parser.cgt -copy haskell_parser.log con -echo. - -echo Compile: CGT,PGT to TEMPLATE... -start /wait ..\..\Utils\gpbcmd\createskelprog_main haskell_parser.cgt haskell_parser.pgt haskell_parser.tmpl -echo. - -echo Compile: GRM,TEMPLATE to CS... -..\..\Utils\grmCommentCompiler\bin\Debug\grmCommentCompiler.exe haskell_parser.grm haskell_parser.tmpl Haskell_lrparser_rules.cs -echo. - -echo Compile: CGT to RES... -start /wait ..\..\Utils\ResXMaker\ResXMaker.exe haskell_parser.CGT HaskellLanguage HaskellLang.resources -echo. - -copy HaskellLang.resources ..\..\Parsers\HaskellParser\HaskellLang.resources -copy Haskell_lrparser_rules.cs ..\..\Parsers\HaskellParser\Haskell_lrparser_rules.cs \ No newline at end of file diff --git a/Grammars/Haskell/haskell_parser.cgt b/Grammars/Haskell/haskell_parser.cgt deleted file mode 100644 index 8a6708058..000000000 Binary files a/Grammars/Haskell/haskell_parser.cgt and /dev/null differ diff --git a/Grammars/Haskell/haskell_parser.grm b/Grammars/Haskell/haskell_parser.grm deleted file mode 100644 index d9005d2c9..000000000 --- a/Grammars/Haskell/haskell_parser.grm +++ /dev/null @@ -1,394 +0,0 @@ -!========================================================================= -! -! This is a version of programming language Haskell -! -!========================================================================= - - -"Name" = 'Haskell' -"Author" = 'Tasha' -"About" = 'A version of the Haskell language.' - -"Case Sensitive" = True -"Start Symbol" = - - - -!<%NAME%> %CODE% -!* -[TERMINALTEMPLATE] - { - %NAME% _%NAME%=new %NAME%(%PARAMS%); - _%NAME%.source_context=parsertools.GetTokenSourceContext(); - %CODE% - return _%NAME%; - } -*! - -!%NAME%<%PARAMS%> %CODE% -!%PARAMS%=$1,$2,... -!* -[NONTERMINALTEMPLATE0] - { - %NAME% _%NAME%=new %NAME%(%PARAMS%); - parsertools.create_source_context(_%NAME%,%LEFTTOKEN%,%RIGHTTOKEN%); - %CODE% - return _%NAME%; - } -*! - -!add to list -!* -[NONTERMINALTEMPLATE1] - { - %NAME% _%NAME%=(%NAME%)%CODE% - return _%NAME%; - } -*! - -!* -[NONTERMINALTEMPLATE2] - { - %NAME% _%NAME%; - %CODE% - return _%NAME%; - } -*! - - -!* -[NONTERMINALTEMPLATE3] - { - %NAME% _%NAME%=new %NAME%(%PARAMS%); - %CODE% - return _%NAME%; - } -*! - - -!for list: -! -! token -!* -[NONTERMINALTEMPLATE6] - //TemplateList for %NAME% (create) - { - %NAME% _%NAME%=new %NAME%(); - _%NAME%.source_context=((%CODE%)$1).source_context; - _%NAME%.%PARAMS%.Add((%CODE%)$1); - return _%NAME%; - } -*! -!* -[NONTERMINALTEMPLATE7] - //TemplateList for %NAME% (add) - { - %NAME% _%NAME%=(%NAME%)$1; - parsertools.create_source_context(_%NAME%,$$,$3); - _%NAME%.%PARAMS%.Add($3 as %CODE%); - return _%NAME%; - } -*! - -!* -[NONTERMINALTEMPLATE8] -{ - procedure_call pc = new procedure_call(); - expression_list expr = new expression_list(); - expr.expressions.Add((expression)$2); - method_call mc = new method_call(expr); - mc.dereferencing_value = new ident("%NAME%"); - pc.func_name = mc; - parsertools.create_source_context(mc.dereferencing_value,$2,$2); - parsertools.create_source_context(expr,$2,$2); - parsertools.create_source_context(mc,$1,$2); - parsertools.create_source_context(pc,$1,$2); - return pc; -} -*! - -{Chars} = {ANSI Printable} + {HT} + {Cyrillic} -{String Chars} = {ANSI Printable} + {HT} + {Cyrillic} - ["] - -Comment Start = '{-' -Comment End = '-}' -Comment Line = '--' - -tkIdent = {Letter}{Alphanumeric}* !*$$=parsertools.create_ident(this);*! -tkInt = {digit}+ !*$$=parsertools.create_int_const(this);*! -tkDouble = {Digit}+[.]{Digit}+ !*$$=parsertools.create_double_const(this);*! -tkChar = ''{Chars}'' !*$$=parsertools.create_char_const(this);*! -tkString = '"'{String Chars}* '"' !*$$=parsertools.create_string_const(this);*! -tkBool = (True) | (False) | (true) | (false) !*{ - ident _ident = null; - string s = LRParser.TokenText; - if (s == "True" || s == "true") - s = "true"; - else - s = "false"; - _ident =new ident(s); - _ident.source_context = parsertools.GetTokenSourceContext(); - return _ident; - }*! - - -tkModule = 'module' !**! -tkWhere = 'where' !*{ - token_where = 1; - token_where_count++; - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - }*! -tkDo = 'do' !**! -tkIf = 'if' !**! -tkThen = 'then' !**! -tkElse = 'else' !**! -tkCase = 'case' !**! -tkOf = 'of' !**! -tkLet = 'let' !**! -tkIn = 'in' !**! -tkReturn = 'return' !**! - -tkMinus = '-' !**! -tkPlus = '+' !**! -tkSlash = '/' !**! -tkStar = '*' !**! -tkSemiColon = ';' !**! -tkDot = '.' !**! -tkAssign = '=' !*{ - if (token_where == 2 || token_where == 1) - { - token_where = 0; - //if (let_where_funcs_main.Count > 1) - //for (int i = 0; i let_where_funcs.Count; i++) - //if (let_funcs.Count > 0) - //let_funcs.RemoveAt(let_funcs.Count - 1); - let_where_funcs_main.Add(let_where_funcs.Clone()); - let_where_funcs.Clear(); - } - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - }*! -tkRoundOpen = '(' !**! -tkRoundClose = ')' !**! -tkFigureOpen = '{' !**! -tkFigureClose = '}' !**! -tkSquareOpen = '[' !**! -tkSquareClose = ']' !**! -tkMainIdent = 'Main' !**! -tkMainIdent1 = 'main' !**! -tkArrow = '->' !**! -tkMore = '>' !**! -tkLess = '<' !**! -tkMoreEq = '>=' !**! -tkLessEq = '<=' !**! -tkEqual = '==' !**! -tkNotEqual = '/=' !**! -tkOr = 'or' !**! -tkAnd = 'and' !**! -tkNot = 'not' !**! -tkImport = 'import' !**! -tkRef = '#reference' !*$$=parsertools.create_directive_name(this);*! -tkSplit = '|' !**! -tkComma = ',' !**! -tkColon = ':' !**! -tkLeftSlash = '\' !**! -tkOtherwise = 'otherwise' !**! -tkArrowGen = '<-' !**! -tkQuote = '`' !**! -tkBottomMinus = '_' !**! - -::= tkModule tkMainIdent tkWhere - | - | tkModule tkIdent tkWhere - -::= - | tkRef tkString - -::= - | - | - -::= tkImport tkIdent - -::= - | - -::= - -::= - -::= - | - -::= tkIdent - | tkQuote tkIdent tkQuote - -::= - -::= - -::= - | tkWhere - -::= - | tkSemiColon - -::= tkIdent - -::= - | - | - -::= - | - | - -::= - - ::= tkIdent - | - | tkSquareOpen tkSquareClose - | tkBottomMinus - | tkIdent tkColon - | tkBottomMinus tkColon - | tkRoundOpen tkRoundClose - -::= - | tkSplit - | tkSplit tkOtherwise - -::= tkMainIdent1 tkAssign - -::= - -::= - | tkSemiColon - -::= - | - -::= tkEqual - | tkNotEqual - | tkMore - | tkLess - | tkMoreEq - | tkLessEq - | - -::= tkSquareOpen tkSquareClose - | tkSquareOpen tkDot tkDot tkSquareClose - | tkSquareOpen tkDot tkDot tkSquareClose - | - | tkColon - -::= tkSquareOpen tkSplit tkSquareClose - -::= - | tkComma - -::= tkArrowGen - -::= - | tkComma - -::= - | tkComma - -::= - -::= tkRoundOpen tkComma tkRoundClose - -::= - | - | tkComma - -::= tkAnd - | - | - -::= tkOr - | - | - -::= tkMinus - | tkNot - | - -::= - | tkRoundOpen tkRoundClose - | - | - | tkLet tkIn - | - | - | - | tkRoundOpen tkRoundOpen tkRoundClose tkRoundClose - -::=tkInt - | tkDouble - | tkBool - | tkChar - | tkString - -::= - -::= - | tkSemiColon - -::= tkIdent - -::= - | - -::= tkAssign - -::= tkIdent - | tkRoundOpen tkIdent tkRoundClose - | tkRoundOpen tkRoundClose - | tkRoundOpen tkQuote tkIdent tkQuote tkRoundClose - -::= tkRoundOpen tkQuote tkIdent tkQuote tkRoundClose - | tkRoundOpen tkQuote tkIdent tkQuote tkRoundClose - | tkRoundOpen tkRoundOpen tkQuote tkIdent tkQuote tkRoundClose tkRoundClose - -::= tkStar - | tkSlash - -::= tkPlus - | tkMinus - -::= tkIdent tkArrowGen tkIdent - | tkIf tkThen tkElse - | tkCase tkRoundOpen tkRoundClose tkOf - | tkDo tkFigureOpen tkSemiColon tkFigureClose - | tkDo - | tkReturn - | - -::= - | tkSplit - -::= tkRoundOpen tkRoundClose tkArrow - -::= - | tkComma - -::= - -::= - | - -::= - -::= tkLeftSlash tkArrow - -::= ! for rule code call - - - - diff --git a/Grammars/Haskell/haskell_parser.log b/Grammars/Haskell/haskell_parser.log deleted file mode 100644 index 2f18e5a6e..000000000 --- a/Grammars/Haskell/haskell_parser.log +++ /dev/null @@ -1,61 +0,0 @@ -============================================================ -GOLD Parser Builder -Version 3.2.3 -============================================================ - - -======================================== -Log -======================================== - -Grammar Details Whitespace was implicitly defined -Grammar Details The grammar contains a total of 52 formal terminals. -Grammar Warning Unreachable rule: -Grammar Warning Unreachable rule: -Grammar Success The grammar was successfully analyzed -LALR States Details The temporary First and Nullable tables were successfully created -LALR States Warning 4 A Shift-Reduce Conflict was fixed -LALR States Warning 19 A Shift-Reduce Conflict was fixed -LALR States Warning 35 A Shift-Reduce Conflict was fixed -LALR States Warning 36 A Shift-Reduce Conflict was fixed -LALR States Warning 69 A Shift-Reduce Conflict was fixed -LALR States Warning 71 A Shift-Reduce Conflict was fixed -LALR States Warning 78 A Shift-Reduce Conflict was fixed -LALR States Warning 81 A Shift-Reduce Conflict was fixed -LALR States Warning 87 A Shift-Reduce Conflict was fixed -LALR States Warning 89 A Shift-Reduce Conflict was fixed -LALR States Warning 108 A Shift-Reduce Conflict was fixed -LALR States Warning 112 A Shift-Reduce Conflict was fixed -LALR States Warning 115 A Shift-Reduce Conflict was fixed -LALR States Warning 116 A Shift-Reduce Conflict was fixed -LALR States Warning 117 A Shift-Reduce Conflict was fixed -LALR States Warning 118 A Shift-Reduce Conflict was fixed -LALR States Warning 123 A Shift-Reduce Conflict was fixed -LALR States Warning 149 A Shift-Reduce Conflict was fixed -LALR States Warning 151 A Shift-Reduce Conflict was fixed -LALR States Warning 169 A Shift-Reduce Conflict was fixed -LALR States Warning 180 A Shift-Reduce Conflict was fixed -LALR States Warning 181 A Shift-Reduce Conflict was fixed -LALR States Warning 182 A Shift-Reduce Conflict was fixed -LALR States Warning 183 A Shift-Reduce Conflict was fixed -LALR States Warning 184 A Shift-Reduce Conflict was fixed -LALR States Warning 185 A Shift-Reduce Conflict was fixed -LALR States Warning 186 A Shift-Reduce Conflict was fixed -LALR States Warning 187 A Shift-Reduce Conflict was fixed -LALR States Warning 223 A Shift-Reduce Conflict was fixed -LALR States Warning 252 A Shift-Reduce Conflict was fixed -LALR States Warning 270 A Shift-Reduce Conflict was fixed -LALR States Details LALR computation took: 0 Hours 0 Minutes 3 Seconds -LALR States Success The LALR Table was succesfully created -LALR States Details Total actions: 968 Shifts, 3725 Reduces, 754 Gotos, 1 Accepts. -DFA States Details The terminal 'Whitespace' is variable length. -DFA States Details The terminal 'tkDouble' is variable length. -DFA States Details The terminal 'tkIdent' is variable length. -DFA States Details The terminal 'tkInt' is variable length. -DFA States Details The terminal 'tkString' is variable length. -DFA States Details The initial Nondeterministic Finite Automata has 338 states -DFA States Success The DFA State Table was successfully created -DFA States Details DFA computation took: 0 Hours 0 Minutes 1 Second -System Complete The grammar was successfully analyzed and the CGT file was created. - - diff --git a/Grammars/Haskell/haskell_parser.pgt b/Grammars/Haskell/haskell_parser.pgt deleted file mode 100644 index e406af89d..000000000 --- a/Grammars/Haskell/haskell_parser.pgt +++ /dev/null @@ -1,488 +0,0 @@ -##TEMPLATE-NAME 'PascalABC.NET' -##LANGUAGE 'Haskell' -##ENGINE-NAME 'PascalABCNET GOLD Parser Engine' -##AUTHOR 'Tasha' -##FILE-EXTENSION 'cs' -##NOTES -Haskell parser template. -Version 1.0 -##END-NOTES -##ID-CASE UPPERCASE -##ID-SEPARATOR '_' -##ID-SYMBOL-PREFIX 'Symbol' -##ID-RULE-PREFIX 'Rule' - -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.HaskellParser.Errors; -using PascalABCCompiler.ParserTools; -using GoldParser; - -namespace PascalABCCompiler.HaskellParser -{ -public partial class GPBParser_Haskell : GPBParser -{ - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//SymbolConstants -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public enum SymbolConstants : int -{ -##SYMBOLS -##DELIMITER ',' - %ID.Padded% = %Value.Padded%%Delimiter% // %Description% -##END-SYMBOLS -}; - - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//RuleConstants -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public enum RuleConstants : int -{ -##RULES -##DELIMITER ',' - %ID.Padded% = %Value.Padded%%Delimiter% // %Description% -##END-RULES -}; - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -private Object CreateTerminalObject(int TokenSymbolIndex) -{ -switch (TokenSymbolIndex) -{ -##SYMBOLS - case (int)SymbolConstants.%ID% : - //%Description% - //TERMINAL:%Name% - return null; - //ENDTERMINAL -##END-SYMBOLS -} -throw new SymbolException("Unknown symbol"); -} - - - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateNonTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -public ArrayList param_value_list = new ArrayList(); -public ArrayList body_variant_list = new ArrayList(); -public ArrayList param_value_list_main = new ArrayList(); -public ArrayList body_variant_list_main = new ArrayList(); -public ArrayList guard_list = new ArrayList(); -public ArrayList guard_list_main = new ArrayList(); -public ArrayList where_list_var = new ArrayList(); -public ArrayList where_list_assign = new ArrayList(); -public ArrayList where_list_var_main = new ArrayList(); -public ArrayList where_list_assign_main = new ArrayList(); -public ArrayList func_name = new ArrayList(); -public ArrayList where_list_counts=new ArrayList(); -public ArrayList where_list_counts_main = new ArrayList(); -public int decls_counts = 0; -public bool where_flag = false; -public ArrayList list_param = new ArrayList(); -public ArrayList list_params = new ArrayList(); -public ArrayList list_params_temp = new ArrayList(); -public ArrayList list_params_main = new ArrayList(); -public ArrayList _function_lambda_definitions = new ArrayList(); -public ArrayList _function_lambda_definitions_after = new ArrayList(); -public int lambda_num = 0; -public ArrayList _functions = new ArrayList(); -public ArrayList list_method_calls = new ArrayList(); -public ArrayList list_method_calls_main = new ArrayList(); -public ArrayList list_return_funcs = new ArrayList(); -public ArrayList list_return_funcs_main = new ArrayList(); -public ArrayList list_params1 = new ArrayList(); -public ArrayList last_function_lambda_definitions = new ArrayList(); -public ArrayList last_list_method_calls = new ArrayList(); -public ArrayList last_list_method_calls_lambda = new ArrayList(); -public ArrayList let_fact_params = new ArrayList(); -public ArrayList let_funcs = new ArrayList(); -public ArrayList let_funcs_funcs = new ArrayList(); -public ArrayList let_func_last = new ArrayList(); -public ArrayList let_funcs1 = new ArrayList(); -public ArrayList let_flag = new ArrayList(); -public struct types_param_lampda -{ - public string name; - public ArrayList types; -} -public ArrayList list_method_calls_lambda = new ArrayList(); - -public Object CreateNonTerminalObject(int ReductionRuleIndex) -{ -switch (ReductionRuleIndex) -{ -##RULES - case (int)RuleConstants.%ID% : - //%Description% - //NONTERMINAL:%Description% - return null; - //ENDNONTERMINAL -##END-RULES -} -throw new RuleException("Unknown rule"); -} - -public method_call _ob(object dt) - { - token_info _token_info = new token_info("."); - _token_info.source_context = parsertools.GetTokenSourceContext(); - /////////// - ident id = new ident("ob"); - dot_node _dot_node = new dot_node(null, (addressed_value)id); - parsertools.create_source_context(_dot_node, _token_info, id); - _dot_node.left = (addressed_value)dt; - parsertools.create_source_context(_dot_node, dt, _dot_node.right); - ///////////////////////// - expression_list el = new expression_list(); - el.expressions.Add(_dot_node); - method_call _method_call = new method_call(el); - parsertools.create_source_context(_method_call, null, null); - ///////////////////////// - ident id1 = new ident("boolean"); - ///////////////////////// - if (_method_call is dereference) - { - ((dereference)_method_call).dereferencing_value = (addressed_value)id1; - parsertools.create_source_context(_method_call, id1, _method_call); - } - return _method_call; - } -public procedure_definition lambda(function_lambda_definition _function_lambda_definition) -{ - SyntaxTree.procedure_definition _func_def = new PascalABCCompiler.SyntaxTree.procedure_definition(); - SyntaxTree.method_name _method_name1 = new SyntaxTree.method_name(null, new SyntaxTree.ident(_function_lambda_definition.lambda_name), null); - SyntaxTree.function_header _function_header1 = new SyntaxTree.function_header(); - - object rt1 = new object(); - _function_header1.name = _method_name1; - SyntaxTree.formal_parametres fps = new PascalABCCompiler.SyntaxTree.formal_parametres(); - _function_header1.parametres = _function_lambda_definition.formal_parametres;//fps; - SyntaxTree.named_type_reference _named_type_reference = new SyntaxTree.named_type_reference(); - SyntaxTree.ident idtype = new SyntaxTree.ident("datatype"); - _named_type_reference.source_context = idtype.source_context; - _named_type_reference.names.Add(idtype); - - rt1 = _named_type_reference; - _function_header1.return_type = (SyntaxTree.type_definition)_named_type_reference; - - _function_header1.of_object = false; - _function_header1.class_keyword = false; - SyntaxTree.block _block1 = new SyntaxTree.block(null, null); - SyntaxTree.statement_list sl1 = new SyntaxTree.statement_list(); - sl1.subnodes.Add(_function_lambda_definition.proc_body); - _block1.program_code = sl1; - _func_def.proc_header = _function_header1; - _func_def.proc_body = (SyntaxTree.proc_block)_block1; - _function_lambda_definition.proc_definition = _func_def; - return _func_def; -} - -public procedure_definition find_function1(string name) -{ - int i = 0; - while (i < _functions.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != name) - i++; - if (i < _functions.Count) - return (procedure_definition)_functions[i]; - else - return null; -} - -public int find_count_params(string name) -{ - if (param_value_list_main.Count == 0 && param_value_list.Count == 0) - { - int i = 0; - while (i < _functions.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != name) - i++; - if (i < _functions.Count) - { - if (((procedure_definition)_functions[i]).proc_header.parametres == null) - return 0; - else - return ((procedure_definition)_functions[i]).proc_header.parametres.params_list.Count; - } - else - return 0; - } - else - { - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != name) - i++; - if (i < func_name.Count) - { - if (i >= param_value_list_main.Count) - { - if (i >= param_value_list_main.Count) - //if (param_value_list_main.Count==0) - { - if (param_value_list[param_value_list.Count - 1] == null) - return 0; - else - return ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Count; - } - else - return 0; - } - else - { - if (((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1] == null) - return 0; - else - return ((expression_list)((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1]).expressions.Count; - } - } - else - return 0; - } -} -public int find_count_params_lambda(string name) -{ - int i = 0; - while (i < _function_lambda_definitions_after.Count && ((function_lambda_definition)_function_lambda_definitions_after[i]).lambda_name != name) - i += 2; - if (i < _function_lambda_definitions_after.Count) - return ((function_lambda_definition)_function_lambda_definitions_after[i]).formal_parametres.params_list.Count; - else - return -1; -} - -public string find_name_params_lambda(string name, int ind) -{ - int i = 0; - while (i < _function_lambda_definitions_after.Count && ((function_lambda_definition)_function_lambda_definitions_after[i]).lambda_name != name) - i += 2; - if (i < _function_lambda_definitions_after.Count) - { - formal_parametres fp = ((function_lambda_definition)_function_lambda_definitions_after[i]).formal_parametres; - if (ind < fp.params_list.Count) - return fp.params_list[ind].idents.idents[0].name; - else - return ""; - } - else - return ""; -} - -public bool find_func_name(string name) -{ - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != name) - i++; - if (i < func_name.Count) - return true; - else - return false; -} - -public function_lambda_definition find_func_lambda_name(string name) -{ - int i = 0; - while (i < _function_lambda_definitions.Count && ((function_lambda_definition)_function_lambda_definitions[i]).lambda_name != name) - i++; - if (i < _function_lambda_definitions.Count) - return (function_lambda_definition)_function_lambda_definitions[i]; - else - return null; -} - -public type_definition func_type(int count) -{ - //int count = mc.parametres.expressions.Count; - - formal_parametres _formal_parametres = new formal_parametres(); - for (int i = 0; i < count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = new ident("$a" + i.ToString()); - _ident_list.idents.Add(id); - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.names.Add(idtype1); - typed_parametres _typed_parametres = new typed_parametres(_ident_list, (type_definition)_named_type_reference1, parametr_kind.none, null); - _formal_parametres.params_list.Add(_typed_parametres); - } - named_type_reference _named_type_reference = new named_type_reference(); - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - function_header _function_header = new function_header(); - _function_header.parametres = _formal_parametres; - _function_header.return_type = (type_definition)_named_type_reference; - _function_header.of_object = false; - _function_header.class_keyword = false; - return (type_definition)_function_header; -} - -public var_statement var_st(string name, type_definition td) -{ - ident_list il = new ident_list(); - il.idents.Add(new ident(name)); - var_def_statement _var_def_statement = new var_def_statement(il, td, null, definition_attribute.None, false); - return new var_statement(_var_def_statement); -} - -public method_call find_method_call(string name, int k) -{ - int i = 0; - while (i < ((ArrayList)list_method_calls_main[k]).Count && - ((ident)((method_call)((ArrayList)list_method_calls_main[k])[i]).dereferencing_value).name != name) - i++; - if (i < ((ArrayList)list_method_calls_main[k]).Count) - return (method_call)((ArrayList)list_method_calls_main[k])[i]; - else - return null; -} - -public method_call find_method_call_lambda(string name) -{ - int i = 0; - while (i < list_method_calls_lambda.Count && - ((ident)((method_call)list_method_calls_lambda[i]).dereferencing_value).name != name) - i++; - if (i < list_method_calls_lambda.Count) - return (method_call)list_method_calls_lambda[i]; - else - return null; -} -public function_lambda_definition find_func_lambda_after(string name) -{ - int i = 0; - while (i < _function_lambda_definitions_after.Count && - ((function_lambda_definition)_function_lambda_definitions_after[i]).lambda_name != name) - i += 2; - if (i < _function_lambda_definitions_after.Count) - return _function_lambda_definitions_after[i] as function_lambda_definition; - else - return null; -} -public ArrayList find_params(string name) -{ - ArrayList _params = new ArrayList(); - if (param_value_list_main.Count == 0 && param_value_list.Count == 0) - { - int i = 0; - while (i < _functions.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != name) - i++; - if (i < _functions.Count) - { - if (((procedure_definition)_functions[i]).proc_header.parametres == null) - return _params; - else - { - for (int j = 0; j < ((procedure_definition)_functions[i]).proc_header.parametres.params_list.Count; j++) - _params.Add(((procedure_definition)_functions[i]).proc_header.parametres.params_list[j]); - return _params; - } - } - else - return _params; - } - else - { - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != name) - i++; - if (i < func_name.Count) - { - if (i >= param_value_list_main.Count) - { - if (i >= param_value_list_main.Count) - //if (param_value_list_main.Count==0) - { - if (param_value_list[param_value_list.Count - 1] == null) - return _params; - else - { - for (int j = 0; j < ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Count; j++) - _params.Add(((expression_list)param_value_list[param_value_list.Count - 1]).expressions[j]); - return _params; - } - } - else - return _params; - } - else - { - if (((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1] == null) - return _params; - else - { - for (int j = 0; j < ((expression_list)((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1]).expressions.Count; j++) - _params.Add(((expression_list)((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1]).expressions[j]); - return _params; - } - } - } - else - return _params; - } -} - - - -} -} diff --git a/Grammars/Haskell/haskell_parser.tmpl b/Grammars/Haskell/haskell_parser.tmpl deleted file mode 100644 index 73d9e9885..000000000 --- a/Grammars/Haskell/haskell_parser.tmpl +++ /dev/null @@ -1,1923 +0,0 @@ - -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.HaskellParser.Errors; -using PascalABCCompiler.ParserTools; -using GoldParser; - -namespace PascalABCCompiler.HaskellParser -{ -public partial class GPBParser_Haskell : GPBParser -{ - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//SymbolConstants -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public enum SymbolConstants : int -{ - SYMBOL_EOF = 0, // (EOF) - SYMBOL_ERROR = 1, // (Error) - SYMBOL_WHITESPACE = 2, // (Whitespace) - SYMBOL_COMMENTEND = 3, // (Comment End) - SYMBOL_COMMENTLINE = 4, // (Comment Line) - SYMBOL_COMMENTSTART = 5, // (Comment Start) - SYMBOL_TKAND = 6, // 'tkAnd' - SYMBOL_TKARROW = 7, // 'tkArrow' - SYMBOL_TKARROWGEN = 8, // 'tkArrowGen' - SYMBOL_TKASSIGN = 9, // 'tkAssign' - SYMBOL_TKBOOL = 10, // 'tkBool' - SYMBOL_TKBOTTOMMINUS = 11, // 'tkBottomMinus' - SYMBOL_TKCASE = 12, // 'tkCase' - SYMBOL_TKCHAR = 13, // 'tkChar' - SYMBOL_TKCOLON = 14, // 'tkColon' - SYMBOL_TKCOMMA = 15, // 'tkComma' - SYMBOL_TKDO = 16, // 'tkDo' - SYMBOL_TKDOT = 17, // 'tkDot' - SYMBOL_TKDOUBLE = 18, // 'tkDouble' - SYMBOL_TKELSE = 19, // 'tkElse' - SYMBOL_TKEQUAL = 20, // 'tkEqual' - SYMBOL_TKFIGURECLOSE = 21, // 'tkFigureClose' - SYMBOL_TKFIGUREOPEN = 22, // 'tkFigureOpen' - SYMBOL_TKIDENT = 23, // 'tkIdent' - SYMBOL_TKIF = 24, // 'tkIf' - SYMBOL_TKIMPORT = 25, // 'tkImport' - SYMBOL_TKIN = 26, // 'tkIn' - SYMBOL_TKINT = 27, // 'tkInt' - SYMBOL_TKLEFTSLASH = 28, // 'tkLeftSlash' - SYMBOL_TKLESS = 29, // 'tkLess' - SYMBOL_TKLESSEQ = 30, // 'tkLessEq' - SYMBOL_TKLET = 31, // 'tkLet' - SYMBOL_TKMAINIDENT = 32, // 'tkMainIdent' - SYMBOL_TKMAINIDENT1 = 33, // 'tkMainIdent1' - SYMBOL_TKMINUS = 34, // 'tkMinus' - SYMBOL_TKMODULE = 35, // 'tkModule' - SYMBOL_TKMORE = 36, // 'tkMore' - SYMBOL_TKMOREEQ = 37, // 'tkMoreEq' - SYMBOL_TKNOT = 38, // 'tkNot' - SYMBOL_TKNOTEQUAL = 39, // 'tkNotEqual' - SYMBOL_TKOF = 40, // 'tkOf' - SYMBOL_TKOR = 41, // 'tkOr' - SYMBOL_TKOTHERWISE = 42, // 'tkOtherwise' - SYMBOL_TKPLUS = 43, // 'tkPlus' - SYMBOL_TKQUOTE = 44, // 'tkQuote' - SYMBOL_TKREF = 45, // 'tkRef' - SYMBOL_TKRETURN = 46, // 'tkReturn' - SYMBOL_TKROUNDCLOSE = 47, // 'tkRoundClose' - SYMBOL_TKROUNDOPEN = 48, // 'tkRoundOpen' - SYMBOL_TKSEMICOLON = 49, // 'tkSemiColon' - SYMBOL_TKSLASH = 50, // 'tkSlash' - SYMBOL_TKSPLIT = 51, // 'tkSplit' - SYMBOL_TKSQUARECLOSE = 52, // 'tkSquareClose' - SYMBOL_TKSQUAREOPEN = 53, // 'tkSquareOpen' - SYMBOL_TKSTAR = 54, // 'tkStar' - SYMBOL_TKSTRING = 55, // 'tkString' - SYMBOL_TKTHEN = 56, // 'tkThen' - SYMBOL_TKWHERE = 57, // 'tkWhere' - SYMBOL_ADD_EXPR = 58, // - SYMBOL_ADDOP = 59, // - SYMBOL_BODY = 60, // - SYMBOL_BODY_FUNC = 61, // - SYMBOL_BODY_WHERE = 62, // - SYMBOL_CASE_VARIANT = 63, // - SYMBOL_CASE_VARIANTS = 64, // - SYMBOL_CONDITION = 65, // - SYMBOL_CONDITIONS = 66, // - SYMBOL_CONDITIONS_COMMA = 67, // - SYMBOL_CORTEG = 68, // - SYMBOL_DEF_VAR = 69, // - SYMBOL_DEF_VARS = 70, // - SYMBOL_EMPTY = 71, // - SYMBOL_EXPR = 72, // - SYMBOL_FUNC_CALL = 73, // - SYMBOL_FUNCS = 74, // - SYMBOL_FUNCS_VARIANTS = 75, // - SYMBOL_GENERATOR = 76, // - SYMBOL_GENERATORS = 77, // - SYMBOL_GUARD = 78, // - SYMBOL_GUARD_BODY = 79, // - SYMBOL_GUARD_BODY_LIST = 80, // - SYMBOL_IMPORT = 81, // - SYMBOL_IMPORTS = 82, // - SYMBOL_INFIX_EXPR = 83, // - SYMBOL_INIT = 84, // - SYMBOL_INITS = 85, // - SYMBOL_LAMBDA_FUNC = 86, // - SYMBOL_LIST = 87, // - SYMBOL_LIST_CONSTRUCTOR = 88, // - SYMBOL_LIST_ELEMENTS = 89, // - SYMBOL_LIST_PARAM = 90, // - SYMBOL_LIST_PARAM1 = 91, // - SYMBOL_MAIN_FUNC = 92, // - SYMBOL_MODULE = 93, // - SYMBOL_MULT_EXPR = 94, // - SYMBOL_MULTOP = 95, // - SYMBOL_NEGATE_EXPR = 96, // - SYMBOL_PARAM = 97, // - SYMBOL_PARAM_VALUE = 98, // - SYMBOL_PARAMS = 99, // - SYMBOL_PARAMS_VALUE = 100, // - SYMBOL_PARAMS_WHERE = 101, // - SYMBOL_PARAMS1 = 102, // - SYMBOL_REFERENCE = 103, // - SYMBOL_SIMPLE_EXPR = 104, // - SYMBOL_SIMPLE_TYPE_EXPR = 105, // - SYMBOL_STMT = 106, // - SYMBOL_STMTS = 107, // - SYMBOL_STMTS1 = 108, // - SYMBOL_VARIABLE = 109, // - SYMBOL_VARIABLE_EXPR = 110, // - SYMBOL_VARIANT = 111, // - SYMBOL_VARIANTS = 112, // - SYMBOL_WHERE_VAR = 113 // -}; - - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//RuleConstants -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public enum RuleConstants : int -{ - RULE_MODULE_TKMODULE_TKMAINIDENT_TKWHERE = 0, // ::= 'tkModule' 'tkMainIdent' 'tkWhere' - RULE_MODULE = 1, // ::= - RULE_MODULE_TKMODULE_TKIDENT_TKWHERE = 2, // ::= 'tkModule' 'tkIdent' 'tkWhere' - RULE_REFERENCE = 3, // ::= - RULE_REFERENCE_TKREF_TKSTRING = 4, // ::= 'tkRef' 'tkString' - RULE_IMPORTS = 5, // ::= - RULE_IMPORTS2 = 6, // ::= - RULE_IMPORTS3 = 7, // ::= - RULE_IMPORT_TKIMPORT_TKIDENT = 8, // ::= 'tkImport' 'tkIdent' - RULE_BODY = 9, // ::= - RULE_BODY2 = 10, // ::= - RULE_FUNCS = 11, // ::= - RULE_FUNCS_VARIANTS = 12, // ::= - RULE_VARIANTS = 13, // ::= - RULE_VARIANTS2 = 14, // ::= - RULE_VARIANT_TKIDENT = 15, // ::= 'tkIdent' - RULE_VARIANT_TKQUOTE_TKIDENT_TKQUOTE = 16, // ::= 'tkQuote' 'tkIdent' 'tkQuote' - RULE_LIST_PARAM1 = 17, // ::= - RULE_BODY_WHERE = 18, // ::= - RULE_WHERE_VAR = 19, // ::= - RULE_WHERE_VAR_TKWHERE = 20, // ::= 'tkWhere' - RULE_INITS = 21, // ::= - RULE_INITS_TKSEMICOLON = 22, // ::= 'tkSemiColon' - RULE_INIT_TKIDENT = 23, // ::= 'tkIdent' - RULE_PARAMS_WHERE = 24, // ::= - RULE_PARAMS_WHERE2 = 25, // ::= - RULE_PARAMS_WHERE3 = 26, // ::= - RULE_PARAMS = 27, // ::= - RULE_PARAMS2 = 28, // ::= - RULE_PARAMS3 = 29, // ::= - RULE_PARAM = 30, // ::= - RULE_LIST_PARAM_TKIDENT = 31, // ::= 'tkIdent' - RULE_LIST_PARAM = 32, // ::= - RULE_LIST_PARAM_TKSQUAREOPEN_TKSQUARECLOSE = 33, // ::= 'tkSquareOpen' 'tkSquareClose' - RULE_LIST_PARAM_TKBOTTOMMINUS = 34, // ::= 'tkBottomMinus' - RULE_LIST_PARAM_TKIDENT_TKCOLON = 35, // ::= 'tkIdent' 'tkColon' - RULE_LIST_PARAM_TKBOTTOMMINUS_TKCOLON = 36, // ::= 'tkBottomMinus' 'tkColon' - RULE_LIST_PARAM_TKROUNDOPEN_TKROUNDCLOSE = 37, // ::= 'tkRoundOpen' 'tkRoundClose' - RULE_GUARD = 38, // ::= - RULE_GUARD_TKSPLIT = 39, // ::= 'tkSplit' - RULE_GUARD_TKSPLIT_TKOTHERWISE = 40, // ::= 'tkSplit' 'tkOtherwise' - RULE_MAIN_FUNC_TKMAINIDENT1_TKASSIGN = 41, // ::= 'tkMainIdent1' 'tkAssign' - RULE_BODY_FUNC = 42, // ::= - RULE_STMTS = 43, // ::= - RULE_STMTS_TKSEMICOLON = 44, // ::= 'tkSemiColon' - RULE_STMTS1 = 45, // ::= - RULE_STMTS12 = 46, // ::= - RULE_EXPR_TKEQUAL = 47, // ::= 'tkEqual' - RULE_EXPR_TKNOTEQUAL = 48, // ::= 'tkNotEqual' - RULE_EXPR_TKMORE = 49, // ::= 'tkMore' - RULE_EXPR_TKLESS = 50, // ::= 'tkLess' - RULE_EXPR_TKMOREEQ = 51, // ::= 'tkMoreEq' - RULE_EXPR_TKLESSEQ = 52, // ::= 'tkLessEq' - RULE_EXPR = 53, // ::= - RULE_LIST_TKSQUAREOPEN_TKSQUARECLOSE = 54, // ::= 'tkSquareOpen' 'tkSquareClose' - RULE_LIST_TKSQUAREOPEN_TKDOT_TKDOT_TKSQUARECLOSE = 55, // ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' - RULE_LIST_TKSQUAREOPEN_TKDOT_TKDOT_TKSQUARECLOSE2 = 56, // ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' - RULE_LIST = 57, // ::= - RULE_LIST_TKCOLON = 58, // ::= 'tkColon' - RULE_LIST_CONSTRUCTOR_TKSQUAREOPEN_TKSPLIT_TKSQUARECLOSE = 59, // ::= 'tkSquareOpen' 'tkSplit' 'tkSquareClose' - RULE_GENERATORS = 60, // ::= - RULE_GENERATORS_TKCOMMA = 61, // ::= 'tkComma' - RULE_GENERATOR_TKARROWGEN = 62, // ::= 'tkArrowGen' - RULE_CONDITIONS_COMMA = 63, // ::= - RULE_CONDITIONS_COMMA_TKCOMMA = 64, // ::= 'tkComma' - RULE_CONDITIONS = 65, // ::= - RULE_CONDITIONS_TKCOMMA = 66, // ::= 'tkComma' - RULE_CONDITION = 67, // ::= - RULE_CORTEG_TKROUNDOPEN_TKCOMMA_TKROUNDCLOSE = 68, // ::= 'tkRoundOpen' 'tkComma' 'tkRoundClose' - RULE_LIST_ELEMENTS = 69, // ::= - RULE_LIST_ELEMENTS2 = 70, // ::= - RULE_LIST_ELEMENTS_TKCOMMA = 71, // ::= 'tkComma' - RULE_ADD_EXPR_TKAND = 72, // ::= 'tkAnd' - RULE_ADD_EXPR = 73, // ::= - RULE_ADD_EXPR2 = 74, // ::= - RULE_MULT_EXPR_TKOR = 75, // ::= 'tkOr' - RULE_MULT_EXPR = 76, // ::= - RULE_MULT_EXPR2 = 77, // ::= - RULE_NEGATE_EXPR_TKMINUS = 78, // ::= 'tkMinus' - RULE_NEGATE_EXPR_TKNOT = 79, // ::= 'tkNot' - RULE_NEGATE_EXPR = 80, // ::= - RULE_SIMPLE_EXPR = 81, // ::= - RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDCLOSE = 82, // ::= 'tkRoundOpen' 'tkRoundClose' - RULE_SIMPLE_EXPR2 = 83, // ::= - RULE_SIMPLE_EXPR3 = 84, // ::= - RULE_SIMPLE_EXPR_TKLET_TKIN = 85, // ::= 'tkLet' 'tkIn' - RULE_SIMPLE_EXPR4 = 86, // ::= - RULE_SIMPLE_EXPR5 = 87, // ::= - RULE_SIMPLE_EXPR6 = 88, // ::= - RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDOPEN_TKROUNDCLOSE_TKROUNDCLOSE = 89, // ::= 'tkRoundOpen' 'tkRoundOpen' 'tkRoundClose' 'tkRoundClose' - RULE_SIMPLE_TYPE_EXPR_TKINT = 90, // ::= 'tkInt' - RULE_SIMPLE_TYPE_EXPR_TKDOUBLE = 91, // ::= 'tkDouble' - RULE_SIMPLE_TYPE_EXPR_TKBOOL = 92, // ::= 'tkBool' - RULE_SIMPLE_TYPE_EXPR_TKCHAR = 93, // ::= 'tkChar' - RULE_SIMPLE_TYPE_EXPR_TKSTRING = 94, // ::= 'tkString' - RULE_VARIABLE_EXPR = 95, // ::= - RULE_DEF_VARS = 96, // ::= - RULE_DEF_VARS_TKSEMICOLON = 97, // ::= 'tkSemiColon' - RULE_DEF_VAR_TKIDENT = 98, // ::= 'tkIdent' - RULE_GUARD_BODY_LIST = 99, // ::= - RULE_GUARD_BODY_LIST2 = 100, // ::= - RULE_GUARD_BODY_TKASSIGN = 101, // ::= 'tkAssign' - RULE_VARIABLE_TKIDENT = 102, // ::= 'tkIdent' - RULE_VARIABLE_TKROUNDOPEN_TKIDENT_TKROUNDCLOSE = 103, // ::= 'tkRoundOpen' 'tkIdent' 'tkRoundClose' - RULE_VARIABLE_TKROUNDOPEN_TKROUNDCLOSE = 104, // ::= 'tkRoundOpen' 'tkRoundClose' - RULE_VARIABLE_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE = 105, // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE = 106, // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE2 = 107, // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - RULE_INFIX_EXPR_TKROUNDOPEN_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE_TKROUNDCLOSE = 108, // ::= 'tkRoundOpen' 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' 'tkRoundClose' - RULE_MULTOP_TKSTAR = 109, // ::= 'tkStar' - RULE_MULTOP_TKSLASH = 110, // ::= 'tkSlash' - RULE_ADDOP_TKPLUS = 111, // ::= 'tkPlus' - RULE_ADDOP_TKMINUS = 112, // ::= 'tkMinus' - RULE_STMT_TKIDENT_TKARROWGEN_TKIDENT = 113, // ::= 'tkIdent' 'tkArrowGen' 'tkIdent' - RULE_STMT_TKIF_TKTHEN_TKELSE = 114, // ::= 'tkIf' 'tkThen' 'tkElse' - RULE_STMT_TKCASE_TKROUNDOPEN_TKROUNDCLOSE_TKOF = 115, // ::= 'tkCase' 'tkRoundOpen' 'tkRoundClose' 'tkOf' - RULE_STMT_TKDO_TKFIGUREOPEN_TKSEMICOLON_TKFIGURECLOSE = 116, // ::= 'tkDo' 'tkFigureOpen' 'tkSemiColon' 'tkFigureClose' - RULE_STMT_TKDO = 117, // ::= 'tkDo' - RULE_STMT_TKRETURN = 118, // ::= 'tkReturn' - RULE_STMT = 119, // ::= - RULE_CASE_VARIANTS = 120, // ::= - RULE_CASE_VARIANTS_TKSPLIT = 121, // ::= 'tkSplit' - RULE_CASE_VARIANT_TKROUNDOPEN_TKROUNDCLOSE_TKARROW = 122, // ::= 'tkRoundOpen' 'tkRoundClose' 'tkArrow' - RULE_PARAMS1 = 123, // ::= - RULE_PARAMS1_TKCOMMA = 124, // ::= 'tkComma' - RULE_FUNC_CALL = 125, // ::= - RULE_PARAMS_VALUE = 126, // ::= - RULE_PARAMS_VALUE2 = 127, // ::= - RULE_PARAM_VALUE = 128, // ::= - RULE_LAMBDA_FUNC_TKLEFTSLASH_TKARROW = 129, // ::= 'tkLeftSlash' 'tkArrow' - RULE_EMPTY = 130 // ::= -}; - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -private Object CreateTerminalObject(int TokenSymbolIndex) -{ -switch (TokenSymbolIndex) -{ - case (int)SymbolConstants.SYMBOL_EOF : - //(EOF) - //TERMINAL:EOF - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ERROR : - //(Error) - //TERMINAL:Error - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_WHITESPACE : - //(Whitespace) - //TERMINAL:Whitespace - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_COMMENTEND : - //(Comment End) - //TERMINAL:Comment End - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_COMMENTLINE : - //(Comment Line) - //TERMINAL:Comment Line - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_COMMENTSTART : - //(Comment Start) - //TERMINAL:Comment Start - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKAND : - //'tkAnd' - //TERMINAL:tkAnd - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKARROW : - //'tkArrow' - //TERMINAL:tkArrow - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKARROWGEN : - //'tkArrowGen' - //TERMINAL:tkArrowGen - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKASSIGN : - //'tkAssign' - //TERMINAL:tkAssign - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKBOOL : - //'tkBool' - //TERMINAL:tkBool - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKBOTTOMMINUS : - //'tkBottomMinus' - //TERMINAL:tkBottomMinus - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKCASE : - //'tkCase' - //TERMINAL:tkCase - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKCHAR : - //'tkChar' - //TERMINAL:tkChar - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKCOLON : - //'tkColon' - //TERMINAL:tkColon - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKCOMMA : - //'tkComma' - //TERMINAL:tkComma - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKDO : - //'tkDo' - //TERMINAL:tkDo - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKDOT : - //'tkDot' - //TERMINAL:tkDot - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKDOUBLE : - //'tkDouble' - //TERMINAL:tkDouble - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKELSE : - //'tkElse' - //TERMINAL:tkElse - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKEQUAL : - //'tkEqual' - //TERMINAL:tkEqual - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKFIGURECLOSE : - //'tkFigureClose' - //TERMINAL:tkFigureClose - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKFIGUREOPEN : - //'tkFigureOpen' - //TERMINAL:tkFigureOpen - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKIDENT : - //'tkIdent' - //TERMINAL:tkIdent - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKIF : - //'tkIf' - //TERMINAL:tkIf - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKIMPORT : - //'tkImport' - //TERMINAL:tkImport - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKIN : - //'tkIn' - //TERMINAL:tkIn - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKINT : - //'tkInt' - //TERMINAL:tkInt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKLEFTSLASH : - //'tkLeftSlash' - //TERMINAL:tkLeftSlash - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKLESS : - //'tkLess' - //TERMINAL:tkLess - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKLESSEQ : - //'tkLessEq' - //TERMINAL:tkLessEq - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKLET : - //'tkLet' - //TERMINAL:tkLet - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKMAINIDENT : - //'tkMainIdent' - //TERMINAL:tkMainIdent - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKMAINIDENT1 : - //'tkMainIdent1' - //TERMINAL:tkMainIdent1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKMINUS : - //'tkMinus' - //TERMINAL:tkMinus - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKMODULE : - //'tkModule' - //TERMINAL:tkModule - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKMORE : - //'tkMore' - //TERMINAL:tkMore - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKMOREEQ : - //'tkMoreEq' - //TERMINAL:tkMoreEq - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKNOT : - //'tkNot' - //TERMINAL:tkNot - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKNOTEQUAL : - //'tkNotEqual' - //TERMINAL:tkNotEqual - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKOF : - //'tkOf' - //TERMINAL:tkOf - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKOR : - //'tkOr' - //TERMINAL:tkOr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKOTHERWISE : - //'tkOtherwise' - //TERMINAL:tkOtherwise - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKPLUS : - //'tkPlus' - //TERMINAL:tkPlus - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKQUOTE : - //'tkQuote' - //TERMINAL:tkQuote - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKREF : - //'tkRef' - //TERMINAL:tkRef - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKRETURN : - //'tkReturn' - //TERMINAL:tkReturn - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKROUNDCLOSE : - //'tkRoundClose' - //TERMINAL:tkRoundClose - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKROUNDOPEN : - //'tkRoundOpen' - //TERMINAL:tkRoundOpen - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKSEMICOLON : - //'tkSemiColon' - //TERMINAL:tkSemiColon - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKSLASH : - //'tkSlash' - //TERMINAL:tkSlash - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKSPLIT : - //'tkSplit' - //TERMINAL:tkSplit - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKSQUARECLOSE : - //'tkSquareClose' - //TERMINAL:tkSquareClose - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKSQUAREOPEN : - //'tkSquareOpen' - //TERMINAL:tkSquareOpen - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKSTAR : - //'tkStar' - //TERMINAL:tkStar - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKSTRING : - //'tkString' - //TERMINAL:tkString - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKTHEN : - //'tkThen' - //TERMINAL:tkThen - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKWHERE : - //'tkWhere' - //TERMINAL:tkWhere - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ADD_EXPR : - // - //TERMINAL:add_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ADDOP : - // - //TERMINAL:addop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_BODY : - // - //TERMINAL:body - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_BODY_FUNC : - // - //TERMINAL:body_func - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_BODY_WHERE : - // - //TERMINAL:body_where - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CASE_VARIANT : - // - //TERMINAL:case_variant - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CASE_VARIANTS : - // - //TERMINAL:case_variants - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONDITION : - // - //TERMINAL:condition - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONDITIONS : - // - //TERMINAL:conditions - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONDITIONS_COMMA : - // - //TERMINAL:conditions_comma - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CORTEG : - // - //TERMINAL:corteg - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_DEF_VAR : - // - //TERMINAL:def_var - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_DEF_VARS : - // - //TERMINAL:def_vars - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EMPTY : - // - //TERMINAL:empty - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPR : - // - //TERMINAL:expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_CALL : - // - //TERMINAL:func_call - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNCS : - // - //TERMINAL:funcs - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNCS_VARIANTS : - // - //TERMINAL:funcs_variants - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GENERATOR : - // - //TERMINAL:generator - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GENERATORS : - // - //TERMINAL:generators - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GUARD : - // - //TERMINAL:guard - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GUARD_BODY : - // - //TERMINAL:guard_body - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GUARD_BODY_LIST : - // - //TERMINAL:guard_body_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IMPORT : - // - //TERMINAL:import - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IMPORTS : - // - //TERMINAL:imports - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INFIX_EXPR : - // - //TERMINAL:infix_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INIT : - // - //TERMINAL:init - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INITS : - // - //TERMINAL:inits - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LAMBDA_FUNC : - // - //TERMINAL:lambda_func - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST : - // - //TERMINAL:list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST_CONSTRUCTOR : - // - //TERMINAL:list_constructor - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST_ELEMENTS : - // - //TERMINAL:list_elements - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST_PARAM : - // - //TERMINAL:list_param - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST_PARAM1 : - // - //TERMINAL:list_param1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MAIN_FUNC : - // - //TERMINAL:main_func - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MODULE : - // - //TERMINAL:module - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MULT_EXPR : - // - //TERMINAL:mult_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MULTOP : - // - //TERMINAL:multop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NEGATE_EXPR : - // - //TERMINAL:negate_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAM : - // - //TERMINAL:param - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAM_VALUE : - // - //TERMINAL:param_value - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAMS : - // - //TERMINAL:params - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAMS_VALUE : - // - //TERMINAL:params_value - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAMS_WHERE : - // - //TERMINAL:params_where - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAMS1 : - // - //TERMINAL:params1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_REFERENCE : - // - //TERMINAL:reference - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_EXPR : - // - //TERMINAL:simple_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_TYPE_EXPR : - // - //TERMINAL:simple_type_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STMT : - // - //TERMINAL:stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STMTS : - // - //TERMINAL:stmts - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STMTS1 : - // - //TERMINAL:stmts1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIABLE : - // - //TERMINAL:variable - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIABLE_EXPR : - // - //TERMINAL:variable_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIANT : - // - //TERMINAL:variant - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIANTS : - // - //TERMINAL:variants - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_WHERE_VAR : - // - //TERMINAL:where_var - return null; - //ENDTERMINAL -} -throw new SymbolException("Unknown symbol"); -} - - - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateNonTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -public ArrayList param_value_list = new ArrayList(); -public ArrayList body_variant_list = new ArrayList(); -public ArrayList param_value_list_main = new ArrayList(); -public ArrayList body_variant_list_main = new ArrayList(); -public ArrayList guard_list = new ArrayList(); -public ArrayList guard_list_main = new ArrayList(); -public ArrayList where_list_var = new ArrayList(); -public ArrayList where_list_assign = new ArrayList(); -public ArrayList where_list_var_main = new ArrayList(); -public ArrayList where_list_assign_main = new ArrayList(); -public ArrayList func_name = new ArrayList(); -public ArrayList where_list_counts=new ArrayList(); -public ArrayList where_list_counts_main = new ArrayList(); -public int decls_counts = 0; -public bool where_flag = false; -public ArrayList list_param = new ArrayList(); -public ArrayList list_params = new ArrayList(); -public ArrayList list_params_temp = new ArrayList(); -public ArrayList list_params_main = new ArrayList(); -public ArrayList _function_lambda_definitions = new ArrayList(); -public ArrayList _function_lambda_definitions_after = new ArrayList(); -public int lambda_num = 0; -public ArrayList _functions = new ArrayList(); -public ArrayList list_method_calls = new ArrayList(); -public ArrayList list_method_calls_main = new ArrayList(); -public ArrayList list_return_funcs = new ArrayList(); -public ArrayList list_return_funcs_main = new ArrayList(); -public ArrayList list_params1 = new ArrayList(); -public ArrayList last_function_lambda_definitions = new ArrayList(); -public ArrayList last_list_method_calls = new ArrayList(); -public ArrayList last_list_method_calls_lambda = new ArrayList(); -public ArrayList let_fact_params = new ArrayList(); -public ArrayList let_funcs = new ArrayList(); -public ArrayList let_funcs_funcs = new ArrayList(); -public ArrayList let_func_last = new ArrayList(); -public ArrayList let_funcs1 = new ArrayList(); -public ArrayList let_flag = new ArrayList(); -public struct types_param_lampda -{ - public string name; - public ArrayList types; -} -public ArrayList list_method_calls_lambda = new ArrayList(); - -public Object CreateNonTerminalObject(int ReductionRuleIndex) -{ -switch (ReductionRuleIndex) -{ - case (int)RuleConstants.RULE_MODULE_TKMODULE_TKMAINIDENT_TKWHERE : - // ::= 'tkModule' 'tkMainIdent' 'tkWhere' - //NONTERMINAL: ::= 'tkModule' 'tkMainIdent' 'tkWhere' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_MODULE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_MODULE_TKMODULE_TKIDENT_TKWHERE : - // ::= 'tkModule' 'tkIdent' 'tkWhere' - //NONTERMINAL: ::= 'tkModule' 'tkIdent' 'tkWhere' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_REFERENCE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_REFERENCE_TKREF_TKSTRING : - // ::= 'tkRef' 'tkString' - //NONTERMINAL: ::= 'tkRef' 'tkString' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_IMPORTS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_IMPORTS2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_IMPORTS3 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_IMPORT_TKIMPORT_TKIDENT : - // ::= 'tkImport' 'tkIdent' - //NONTERMINAL: ::= 'tkImport' 'tkIdent' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_BODY : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_BODY2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_FUNCS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_FUNCS_VARIANTS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_VARIANTS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_VARIANTS2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_VARIANT_TKIDENT : - // ::= 'tkIdent' - //NONTERMINAL: ::= 'tkIdent' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_VARIANT_TKQUOTE_TKIDENT_TKQUOTE : - // ::= 'tkQuote' 'tkIdent' 'tkQuote' - //NONTERMINAL: ::= 'tkQuote' 'tkIdent' 'tkQuote' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_PARAM1 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_BODY_WHERE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_WHERE_VAR : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_WHERE_VAR_TKWHERE : - // ::= 'tkWhere' - //NONTERMINAL: ::= 'tkWhere' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_INITS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_INITS_TKSEMICOLON : - // ::= 'tkSemiColon' - //NONTERMINAL: ::= 'tkSemiColon' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_INIT_TKIDENT : - // ::= 'tkIdent' - //NONTERMINAL: ::= 'tkIdent' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS_WHERE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS_WHERE2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS_WHERE3 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS3 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAM : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_PARAM_TKIDENT : - // ::= 'tkIdent' - //NONTERMINAL: ::= 'tkIdent' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_PARAM : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_PARAM_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= 'tkSquareOpen' 'tkSquareClose' - //NONTERMINAL: ::= 'tkSquareOpen' 'tkSquareClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_PARAM_TKBOTTOMMINUS : - // ::= 'tkBottomMinus' - //NONTERMINAL: ::= 'tkBottomMinus' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_PARAM_TKIDENT_TKCOLON : - // ::= 'tkIdent' 'tkColon' - //NONTERMINAL: ::= 'tkIdent' 'tkColon' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_PARAM_TKBOTTOMMINUS_TKCOLON : - // ::= 'tkBottomMinus' 'tkColon' - //NONTERMINAL: ::= 'tkBottomMinus' 'tkColon' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_PARAM_TKROUNDOPEN_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundClose' - //NONTERMINAL: ::= 'tkRoundOpen' 'tkRoundClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_GUARD : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_GUARD_TKSPLIT : - // ::= 'tkSplit' - //NONTERMINAL: ::= 'tkSplit' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_GUARD_TKSPLIT_TKOTHERWISE : - // ::= 'tkSplit' 'tkOtherwise' - //NONTERMINAL: ::= 'tkSplit' 'tkOtherwise' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_MAIN_FUNC_TKMAINIDENT1_TKASSIGN : - // ::= 'tkMainIdent1' 'tkAssign' - //NONTERMINAL: ::= 'tkMainIdent1' 'tkAssign' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_BODY_FUNC : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_STMTS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_STMTS_TKSEMICOLON : - // ::= 'tkSemiColon' - //NONTERMINAL: ::= 'tkSemiColon' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_STMTS1 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_STMTS12 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_EXPR_TKEQUAL : - // ::= 'tkEqual' - //NONTERMINAL: ::= 'tkEqual' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_EXPR_TKNOTEQUAL : - // ::= 'tkNotEqual' - //NONTERMINAL: ::= 'tkNotEqual' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_EXPR_TKMORE : - // ::= 'tkMore' - //NONTERMINAL: ::= 'tkMore' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_EXPR_TKLESS : - // ::= 'tkLess' - //NONTERMINAL: ::= 'tkLess' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_EXPR_TKMOREEQ : - // ::= 'tkMoreEq' - //NONTERMINAL: ::= 'tkMoreEq' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_EXPR_TKLESSEQ : - // ::= 'tkLessEq' - //NONTERMINAL: ::= 'tkLessEq' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_EXPR : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= 'tkSquareOpen' 'tkSquareClose' - //NONTERMINAL: ::= 'tkSquareOpen' 'tkSquareClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_TKSQUAREOPEN_TKDOT_TKDOT_TKSQUARECLOSE : - // ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' - //NONTERMINAL: ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_TKSQUAREOPEN_TKDOT_TKDOT_TKSQUARECLOSE2 : - // ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' - //NONTERMINAL: ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_TKCOLON : - // ::= 'tkColon' - //NONTERMINAL: ::= 'tkColon' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_CONSTRUCTOR_TKSQUAREOPEN_TKSPLIT_TKSQUARECLOSE : - // ::= 'tkSquareOpen' 'tkSplit' 'tkSquareClose' - //NONTERMINAL: ::= 'tkSquareOpen' 'tkSplit' 'tkSquareClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_GENERATORS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_GENERATORS_TKCOMMA : - // ::= 'tkComma' - //NONTERMINAL: ::= 'tkComma' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_GENERATOR_TKARROWGEN : - // ::= 'tkArrowGen' - //NONTERMINAL: ::= 'tkArrowGen' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_CONDITIONS_COMMA : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_CONDITIONS_COMMA_TKCOMMA : - // ::= 'tkComma' - //NONTERMINAL: ::= 'tkComma' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_CONDITIONS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_CONDITIONS_TKCOMMA : - // ::= 'tkComma' - //NONTERMINAL: ::= 'tkComma' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_CONDITION : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_CORTEG_TKROUNDOPEN_TKCOMMA_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkComma' 'tkRoundClose' - //NONTERMINAL: ::= 'tkRoundOpen' 'tkComma' 'tkRoundClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_ELEMENTS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_ELEMENTS2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIST_ELEMENTS_TKCOMMA : - // ::= 'tkComma' - //NONTERMINAL: ::= 'tkComma' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_ADD_EXPR_TKAND : - // ::= 'tkAnd' - //NONTERMINAL: ::= 'tkAnd' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_ADD_EXPR : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_ADD_EXPR2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_MULT_EXPR_TKOR : - // ::= 'tkOr' - //NONTERMINAL: ::= 'tkOr' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_MULT_EXPR : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_MULT_EXPR2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_NEGATE_EXPR_TKMINUS : - // ::= 'tkMinus' - //NONTERMINAL: ::= 'tkMinus' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_NEGATE_EXPR_TKNOT : - // ::= 'tkNot' - //NONTERMINAL: ::= 'tkNot' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_NEGATE_EXPR : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_EXPR : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundClose' - //NONTERMINAL: ::= 'tkRoundOpen' 'tkRoundClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_EXPR2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_EXPR3 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_EXPR_TKLET_TKIN : - // ::= 'tkLet' 'tkIn' - //NONTERMINAL: ::= 'tkLet' 'tkIn' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_EXPR4 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_EXPR5 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_EXPR6 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDOPEN_TKROUNDCLOSE_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundOpen' 'tkRoundClose' 'tkRoundClose' - //NONTERMINAL: ::= 'tkRoundOpen' 'tkRoundOpen' 'tkRoundClose' 'tkRoundClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKINT : - // ::= 'tkInt' - //NONTERMINAL: ::= 'tkInt' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKDOUBLE : - // ::= 'tkDouble' - //NONTERMINAL: ::= 'tkDouble' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKBOOL : - // ::= 'tkBool' - //NONTERMINAL: ::= 'tkBool' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKCHAR : - // ::= 'tkChar' - //NONTERMINAL: ::= 'tkChar' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKSTRING : - // ::= 'tkString' - //NONTERMINAL: ::= 'tkString' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_VARIABLE_EXPR : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_DEF_VARS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_DEF_VARS_TKSEMICOLON : - // ::= 'tkSemiColon' - //NONTERMINAL: ::= 'tkSemiColon' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_DEF_VAR_TKIDENT : - // ::= 'tkIdent' - //NONTERMINAL: ::= 'tkIdent' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_GUARD_BODY_LIST : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_GUARD_BODY_LIST2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_GUARD_BODY_TKASSIGN : - // ::= 'tkAssign' - //NONTERMINAL: ::= 'tkAssign' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_VARIABLE_TKIDENT : - // ::= 'tkIdent' - //NONTERMINAL: ::= 'tkIdent' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKIDENT_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkIdent' 'tkRoundClose' - //NONTERMINAL: ::= 'tkRoundOpen' 'tkIdent' 'tkRoundClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundClose' - //NONTERMINAL: ::= 'tkRoundOpen' 'tkRoundClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - //NONTERMINAL: ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - //NONTERMINAL: ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE2 : - // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - //NONTERMINAL: ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_INFIX_EXPR_TKROUNDOPEN_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' 'tkRoundClose' - //NONTERMINAL: ::= 'tkRoundOpen' 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' 'tkRoundClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_MULTOP_TKSTAR : - // ::= 'tkStar' - //NONTERMINAL: ::= 'tkStar' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_MULTOP_TKSLASH : - // ::= 'tkSlash' - //NONTERMINAL: ::= 'tkSlash' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_ADDOP_TKPLUS : - // ::= 'tkPlus' - //NONTERMINAL: ::= 'tkPlus' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_ADDOP_TKMINUS : - // ::= 'tkMinus' - //NONTERMINAL: ::= 'tkMinus' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_STMT_TKIDENT_TKARROWGEN_TKIDENT : - // ::= 'tkIdent' 'tkArrowGen' 'tkIdent' - //NONTERMINAL: ::= 'tkIdent' 'tkArrowGen' 'tkIdent' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_STMT_TKIF_TKTHEN_TKELSE : - // ::= 'tkIf' 'tkThen' 'tkElse' - //NONTERMINAL: ::= 'tkIf' 'tkThen' 'tkElse' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_STMT_TKCASE_TKROUNDOPEN_TKROUNDCLOSE_TKOF : - // ::= 'tkCase' 'tkRoundOpen' 'tkRoundClose' 'tkOf' - //NONTERMINAL: ::= 'tkCase' 'tkRoundOpen' 'tkRoundClose' 'tkOf' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_STMT_TKDO_TKFIGUREOPEN_TKSEMICOLON_TKFIGURECLOSE : - // ::= 'tkDo' 'tkFigureOpen' 'tkSemiColon' 'tkFigureClose' - //NONTERMINAL: ::= 'tkDo' 'tkFigureOpen' 'tkSemiColon' 'tkFigureClose' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_STMT_TKDO : - // ::= 'tkDo' - //NONTERMINAL: ::= 'tkDo' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_STMT_TKRETURN : - // ::= 'tkReturn' - //NONTERMINAL: ::= 'tkReturn' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_STMT : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_CASE_VARIANTS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_CASE_VARIANTS_TKSPLIT : - // ::= 'tkSplit' - //NONTERMINAL: ::= 'tkSplit' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_CASE_VARIANT_TKROUNDOPEN_TKROUNDCLOSE_TKARROW : - // ::= 'tkRoundOpen' 'tkRoundClose' 'tkArrow' - //NONTERMINAL: ::= 'tkRoundOpen' 'tkRoundClose' 'tkArrow' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS1 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS1_TKCOMMA : - // ::= 'tkComma' - //NONTERMINAL: ::= 'tkComma' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_FUNC_CALL : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS_VALUE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS_VALUE2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAM_VALUE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LAMBDA_FUNC_TKLEFTSLASH_TKARROW : - // ::= 'tkLeftSlash' 'tkArrow' - //NONTERMINAL: ::= 'tkLeftSlash' 'tkArrow' - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_EMPTY : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL -} -throw new RuleException("Unknown rule"); -} - -public method_call _ob(object dt) - { - token_info _token_info = new token_info("."); - _token_info.source_context = parsertools.GetTokenSourceContext(); - /////////// - ident id = new ident("ob"); - dot_node _dot_node = new dot_node(null, (addressed_value)id); - parsertools.create_source_context(_dot_node, _token_info, id); - _dot_node.left = (addressed_value)dt; - parsertools.create_source_context(_dot_node, dt, _dot_node.right); - ///////////////////////// - expression_list el = new expression_list(); - el.expressions.Add(_dot_node); - method_call _method_call = new method_call(el); - parsertools.create_source_context(_method_call, null, null); - ///////////////////////// - ident id1 = new ident("boolean"); - ///////////////////////// - if (_method_call is dereference) - { - ((dereference)_method_call).dereferencing_value = (addressed_value)id1; - parsertools.create_source_context(_method_call, id1, _method_call); - } - return _method_call; - } -public procedure_definition lambda(function_lambda_definition _function_lambda_definition) -{ - SyntaxTree.procedure_definition _func_def = new PascalABCCompiler.SyntaxTree.procedure_definition(); - SyntaxTree.method_name _method_name1 = new SyntaxTree.method_name(null, new SyntaxTree.ident(_function_lambda_definition.lambda_name), null); - SyntaxTree.function_header _function_header1 = new SyntaxTree.function_header(); - - object rt1 = new object(); - _function_header1.name = _method_name1; - SyntaxTree.formal_parametres fps = new PascalABCCompiler.SyntaxTree.formal_parametres(); - _function_header1.parametres = _function_lambda_definition.formal_parametres;//fps; - SyntaxTree.named_type_reference _named_type_reference = new SyntaxTree.named_type_reference(); - SyntaxTree.ident idtype = new SyntaxTree.ident("datatype"); - _named_type_reference.source_context = idtype.source_context; - _named_type_reference.names.Add(idtype); - - rt1 = _named_type_reference; - _function_header1.return_type = (SyntaxTree.type_definition)_named_type_reference; - - _function_header1.of_object = false; - _function_header1.class_keyword = false; - SyntaxTree.block _block1 = new SyntaxTree.block(null, null); - SyntaxTree.statement_list sl1 = new SyntaxTree.statement_list(); - sl1.subnodes.Add(_function_lambda_definition.proc_body); - _block1.program_code = sl1; - _func_def.proc_header = _function_header1; - _func_def.proc_body = (SyntaxTree.proc_block)_block1; - _function_lambda_definition.proc_definition = _func_def; - return _func_def; -} - -public procedure_definition find_function1(string name) -{ - int i = 0; - while (i < _functions.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != name) - i++; - if (i < _functions.Count) - return (procedure_definition)_functions[i]; - else - return null; -} - -public int find_count_params(string name) -{ - if (param_value_list_main.Count == 0 && param_value_list.Count == 0) - { - int i = 0; - while (i < _functions.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != name) - i++; - if (i < _functions.Count) - { - if (((procedure_definition)_functions[i]).proc_header.parametres == null) - return 0; - else - return ((procedure_definition)_functions[i]).proc_header.parametres.params_list.Count; - } - else - return 0; - } - else - { - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != name) - i++; - if (i < func_name.Count) - { - if (i >= param_value_list_main.Count) - { - if (i >= param_value_list_main.Count) - //if (param_value_list_main.Count==0) - { - if (param_value_list[param_value_list.Count - 1] == null) - return 0; - else - return ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Count; - } - else - return 0; - } - else - { - if (((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1] == null) - return 0; - else - return ((expression_list)((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1]).expressions.Count; - } - } - else - return 0; - } -} -public int find_count_params_lambda(string name) -{ - int i = 0; - while (i < _function_lambda_definitions_after.Count && ((function_lambda_definition)_function_lambda_definitions_after[i]).lambda_name != name) - i += 2; - if (i < _function_lambda_definitions_after.Count) - return ((function_lambda_definition)_function_lambda_definitions_after[i]).formal_parametres.params_list.Count; - else - return -1; -} - -public string find_name_params_lambda(string name, int ind) -{ - int i = 0; - while (i < _function_lambda_definitions_after.Count && ((function_lambda_definition)_function_lambda_definitions_after[i]).lambda_name != name) - i += 2; - if (i < _function_lambda_definitions_after.Count) - { - formal_parametres fp = ((function_lambda_definition)_function_lambda_definitions_after[i]).formal_parametres; - if (ind < fp.params_list.Count) - return fp.params_list[ind].idents.idents[0].name; - else - return ""; - } - else - return ""; -} - -public bool find_func_name(string name) -{ - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != name) - i++; - if (i < func_name.Count) - return true; - else - return false; -} - -public function_lambda_definition find_func_lambda_name(string name) -{ - int i = 0; - while (i < _function_lambda_definitions.Count && ((function_lambda_definition)_function_lambda_definitions[i]).lambda_name != name) - i++; - if (i < _function_lambda_definitions.Count) - return (function_lambda_definition)_function_lambda_definitions[i]; - else - return null; -} - -public type_definition func_type(int count) -{ - //int count = mc.parametres.expressions.Count; - - formal_parametres _formal_parametres = new formal_parametres(); - for (int i = 0; i < count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = new ident("$a" + i.ToString()); - _ident_list.idents.Add(id); - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.names.Add(idtype1); - typed_parametres _typed_parametres = new typed_parametres(_ident_list, (type_definition)_named_type_reference1, parametr_kind.none, null); - _formal_parametres.params_list.Add(_typed_parametres); - } - named_type_reference _named_type_reference = new named_type_reference(); - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - function_header _function_header = new function_header(); - _function_header.parametres = _formal_parametres; - _function_header.return_type = (type_definition)_named_type_reference; - _function_header.of_object = false; - _function_header.class_keyword = false; - return (type_definition)_function_header; -} - -public var_statement var_st(string name, type_definition td) -{ - ident_list il = new ident_list(); - il.idents.Add(new ident(name)); - var_def_statement _var_def_statement = new var_def_statement(il, td, null, definition_attribute.None, false); - return new var_statement(_var_def_statement); -} - -public method_call find_method_call(string name, int k) -{ - int i = 0; - while (i < ((ArrayList)list_method_calls_main[k]).Count && - ((ident)((method_call)((ArrayList)list_method_calls_main[k])[i]).dereferencing_value).name != name) - i++; - if (i < ((ArrayList)list_method_calls_main[k]).Count) - return (method_call)((ArrayList)list_method_calls_main[k])[i]; - else - return null; -} - -public method_call find_method_call_lambda(string name) -{ - int i = 0; - while (i < list_method_calls_lambda.Count && - ((ident)((method_call)list_method_calls_lambda[i]).dereferencing_value).name != name) - i++; - if (i < list_method_calls_lambda.Count) - return (method_call)list_method_calls_lambda[i]; - else - return null; -} -public function_lambda_definition find_func_lambda_after(string name) -{ - int i = 0; - while (i < _function_lambda_definitions_after.Count && - ((function_lambda_definition)_function_lambda_definitions_after[i]).lambda_name != name) - i += 2; - if (i < _function_lambda_definitions_after.Count) - return _function_lambda_definitions_after[i] as function_lambda_definition; - else - return null; -} -public ArrayList find_params(string name) -{ - ArrayList _params = new ArrayList(); - if (param_value_list_main.Count == 0 && param_value_list.Count == 0) - { - int i = 0; - while (i < _functions.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != name) - i++; - if (i < _functions.Count) - { - if (((procedure_definition)_functions[i]).proc_header.parametres == null) - return _params; - else - { - for (int j = 0; j < ((procedure_definition)_functions[i]).proc_header.parametres.params_list.Count; j++) - _params.Add(((procedure_definition)_functions[i]).proc_header.parametres.params_list[j]); - return _params; - } - } - else - return _params; - } - else - { - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != name) - i++; - if (i < func_name.Count) - { - if (i >= param_value_list_main.Count) - { - if (i >= param_value_list_main.Count) - //if (param_value_list_main.Count==0) - { - if (param_value_list[param_value_list.Count - 1] == null) - return _params; - else - { - for (int j = 0; j < ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Count; j++) - _params.Add(((expression_list)param_value_list[param_value_list.Count - 1]).expressions[j]); - return _params; - } - } - else - return _params; - } - else - { - if (((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1] == null) - return _params; - else - { - for (int j = 0; j < ((expression_list)((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1]).expressions.Count; j++) - _params.Add(((expression_list)((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1]).expressions[j]); - return _params; - } - } - } - else - return _params; - } -} - - - -} -} diff --git a/Grammars/Haskell/определение_функции.txt b/Grammars/Haskell/определение_функции.txt deleted file mode 100644 index e1ed8ddac..000000000 --- a/Grammars/Haskell/определение_функции.txt +++ /dev/null @@ -1,445 +0,0 @@ -{ - //////////////////////////head - method_name _method_name = new method_name(null, (ident)LRParser.GetReductionSyntaxNode(0), null); - parsertools.create_source_context(_method_name, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - - function_header _function_header = new function_header(); - - object rt = LRParser.GetReductionSyntaxNode(2); - _function_header.name = _method_name; - if (_function_header.name.meth_name is template_type_name) - { - _function_header.template_args = (_function_header.name.meth_name as template_type_name).template_args; - ident id = new ident(_function_header.name.meth_name.name); - parsertools.create_source_context(id, _function_header.name.meth_name, _function_header.name.meth_name); - _function_header.name.meth_name = id; - } - if (LRParser.GetReductionSyntaxNode(1)!=null) { - rt=LRParser.GetReductionSyntaxNode(1); - _function_header.parametres=(formal_parametres)LRParser.GetReductionSyntaxNode(1); - } - named_type_reference _named_type_reference = new named_type_reference(); - ident idtype = new ident("integer"); - _named_type_reference.source_context = idtype.source_context; - _named_type_reference.names.Add(idtype); - rt=_named_type_reference; - _function_header.return_type=(type_definition)_named_type_reference; - - _function_header.of_object = false; - _function_header.class_keyword = false; - token_info _token_info = new token_info("function"); - _token_info.source_context = parsertools.GetTokenSourceContext(); - parsertools.create_source_context(_function_header, _token_info, rt); - //////////////////////////////////////block - block _block = new block(null, null); - - statement_list sl = null; - if (LRParser.GetReductionSyntaxNode(3) is statement_list) - sl = LRParser.GetReductionSyntaxNode(3) as statement_list; - else - { - sl = new statement_list(); - sl.subnodes.Add(LRParser.GetReductionSyntaxNode(3) as statement); - if (!(LRParser.GetReductionSyntaxNode(3) is empty_statement)) - parsertools.assign_source_context(sl, LRParser.GetReductionSyntaxNode(3)); - } - _block.program_code = sl; - ////////////////// - procedure_definition _procedure_definition = new procedure_definition(_function_header, null); - rt = _function_header; - if (_block != null) - { - rt = _block; - if (_block is proc_block) - _procedure_definition.proc_body = (proc_block)_block; - } - parsertools.create_source_context(_procedure_definition, _function_header, rt); - - return _procedure_definition; - } -///////////////////////////////////////////////////////////////////////////////// - -{ - //////////////////////////head - method_name _method_name = new method_name(null, func_name, null); - parsertools.create_source_context(_method_name, func_name, func_name); - - function_header _function_header = new function_header(); - - object rt = new object(); - _function_header.name = _method_name; - if (_function_header.name.meth_name is template_type_name) - { - _function_header.template_args = (_function_header.name.meth_name as template_type_name).template_args; - ident id = new ident(_function_header.name.meth_name.name); - parsertools.create_source_context(id, _function_header.name.meth_name, _function_header.name.meth_name); - _function_header.name.meth_name = id; - } - ////////////////////////////////params - formal_parametres _formal_parametres = new formal_parametres(); - expression_list f = (expression_list)param_value_list[param_value_list.Count-1]; - for (int i = 0; i < f.expressions.Count; i++) - { - ident_list _ident_list = new ident_list(); - _ident_list.source_context = ((ident)f.expressions[i]).source_context; - _ident_list.idents.Add((ident)f.expressions[i]); - - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("integer"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - - typed_parametres _typed_parametres = new typed_parametres(_ident_list, (type_definition)_named_type_reference1, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference1); - - _formal_parametres.params_list.Add(_typed_parametres); - } - _function_header.parametres = _formal_parametres; - //////////////////////////type - named_type_reference _named_type_reference = new named_type_reference(); - ident idtype = new ident("integer"); - _named_type_reference.source_context = idtype.source_context; - _named_type_reference.names.Add(idtype); - rt=_named_type_reference; - _function_header.return_type=(type_definition)_named_type_reference; - - _function_header.of_object = false; - _function_header.class_keyword = false; - token_info _token_info = new token_info("function"); - _token_info.source_context = parsertools.GetTokenSourceContext(); - parsertools.create_source_context(_function_header, _token_info, rt); - //////////////////////////////////////block - statement_list stmt_l = new statement_list(); - for (int i=0;i= 0; i--) - { - expression_list pv = (expression_list)param_value_list[i]; - statement body_part = (statement)body_variant_list[i]; - - if_node _if_node = new if_node(null, body_part, last_if); - parsertools.create_source_context(_if_node, null, parsertools.sc_not_null(body_part, last_if)); - - ident id_true = new ident("true"); - expression last_expr = id_true as expression; - for (int j = 0; j < pv.expressions.Count; j++) - { - typed_parametres tp = (typed_parametres)_function_header.parametres.params_list[j]; - if (!(pv.expressions[j] is ident))//vstavka if (vyhod iz rekursii) - { - op_type_node _op_type_node = new op_type_node(Operators.Equal); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - bin_expr _bin_expr = new bin_expr(tp.idents.idents[0] as expression, (expression)pv.expressions[j], _op_type_node.type); - parsertools.create_source_context(_bin_expr, tp.idents.idents[0], pv.expressions[j]); - - op_type_node _op_type_node1 = new op_type_node(Operators.LogicalAND); - _op_type_node1.source_context = parsertools.GetTokenSourceContext(); - bin_expr _bin_expr1 = new bin_expr(_bin_expr, last_expr, _op_type_node1.type); - parsertools.create_source_context(_bin_expr1, _bin_expr, last_expr); - last_expr = _bin_expr1; - } - } - _if_node.condition = last_expr; - parsertools.create_source_context(_if_node, null, _if_node); - last_if = _if_node; - } - stmt_l.subnodes.Add(last_if); - - block _block = new block(null, null); - statement_list sl = null; - if (stmt_l is statement_list) - sl = stmt_l as statement_list; - else - { - sl = new statement_list(); - sl.subnodes.Add(stmt_l as statement); - if (!(stmt_l is empty_statement)) - parsertools.assign_source_context(sl, stmt_l); - } - _block.program_code = sl; - ////////////////// - procedure_definition _procedure_definition = new procedure_definition(_function_header, null); - rt = _function_header; - if (_block != null) - { - rt = _block; - if (_block is proc_block) - _procedure_definition.proc_body = (proc_block)_block; - } - parsertools.create_source_context(_procedure_definition, _function_header, rt); - param_value_list.Clear(); - body_variant_list.Clear(); - return _procedure_definition; - } -///////////////////////////////////////////////////////////////////// -{ - //////////////////////////head - /*ident_list il = new ident_list(); - il.idents.Add(new ident("T")); - template_type_name _template_type_name = new template_type_name(il); - _template_type_name.name = func_name.name; - parsertools.create_source_context(_template_type_name, func_name, il);*/ - - - method_name _method_name = new method_name(null, func_name, null); - parsertools.create_source_context(_method_name, func_name, func_name); - - function_header _function_header = new function_header(); - - object rt = new object(); - _function_header.name = _method_name; - if (_function_header.name.meth_name is template_type_name) - { - _function_header.template_args = (_function_header.name.meth_name as template_type_name).template_args; - ident id = new ident(_function_header.name.meth_name.name); - parsertools.create_source_context(id, _function_header.name.meth_name, _function_header.name.meth_name); - _function_header.name.meth_name = id; - } - ////////////////////////////////params - formal_parametres _formal_parametres = new formal_parametres(); - expression_list f = (expression_list)param_value_list[param_value_list.Count - 1]; - if (f != null) - { - for (int i = 0; i < f.expressions.Count; i++) - { - ident_list _ident_list = new ident_list(); - if (f.expressions[i] is ident) - { - _ident_list.source_context = ((ident)f.expressions[i]).source_context; - _ident_list.idents.Add((ident)f.expressions[i]); - } - else - { - int i1=0; - expression_list el = (expression_list)param_value_list[0]; - while (i1 < param_value_list.Count && !(el.expressions[i] is ident)) - { - i1++; - el = (expression_list)param_value_list[i1]; - } - if (i1 < param_value_list.Count) - { - _ident_list.source_context = (el.expressions[i]).source_context; - _ident_list.idents.Add(el.expressions[i] as ident); - } - } - - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("integer"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - - typed_parametres _typed_parametres = new typed_parametres(_ident_list, (type_definition)_named_type_reference1, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference1); - - _formal_parametres.params_list.Add(_typed_parametres); - } - _function_header.parametres = _formal_parametres; - } - //////////////////////////type - named_type_reference _named_type_reference = new named_type_reference(); - ident idtype = new ident("integer"); - _named_type_reference.source_context = idtype.source_context; - _named_type_reference.names.Add(idtype); - rt = _named_type_reference; - _function_header.return_type = (type_definition)_named_type_reference; - - _function_header.of_object = false; - _function_header.class_keyword = false; - token_info _token_info = new token_info("function"); - _token_info.source_context = parsertools.GetTokenSourceContext(); - parsertools.create_source_context(_function_header, _token_info, rt); - //////////////////////////////////////block - statement_list stmt_l = new statement_list(); - - statement last_if = (statement)body_variant_list[body_variant_list.Count - 1]; - for (int i = param_value_list.Count - 2; i >= 0; i--) - { - expression_list pv = (expression_list)param_value_list[i]; - statement body_part = (statement)body_variant_list[i]; - - if_node _if_node = new if_node(null, body_part, last_if); - parsertools.create_source_context(_if_node, null, parsertools.sc_not_null(body_part, last_if)); - - ident id_true = new ident("true"); - expression last_expr = id_true as expression; - for (int j = 0; j < pv.expressions.Count; j++) - { - typed_parametres tp = (typed_parametres)_function_header.parametres.params_list[j]; - if (!(pv.expressions[j] is ident))//vstavka if (vyhod iz rekursii) - { - op_type_node _op_type_node = new op_type_node(Operators.Equal); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - bin_expr _bin_expr = new bin_expr(tp.idents.idents[0] as expression, (expression)pv.expressions[j], _op_type_node.type); - parsertools.create_source_context(_bin_expr, tp.idents.idents[0], pv.expressions[j]); - - op_type_node _op_type_node1 = new op_type_node(Operators.LogicalAND); - _op_type_node1.source_context = parsertools.GetTokenSourceContext(); - bin_expr _bin_expr1 = new bin_expr(_bin_expr, last_expr, _op_type_node1.type); - parsertools.create_source_context(_bin_expr1, _bin_expr, last_expr); - last_expr = _bin_expr1; - } - } - _if_node.condition = last_expr; - ////ââîä íîâûõ ïåðåìåííûõ - /*for (int j = 0; j < pv.expressions.Count; j++) - { - if (pv.expressions[j] is ident && ((ident)pv.expressions[j]).name!=_function_header.parametres.params_list[j].idents.idents[0].name) - { - ident_list il = new ident_list(); - il.idents.Add(new ident(((ident)pv.expressions[j]).name)); - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("integer"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - - var_def_statement _var_def_statement = new var_def_statement(il, (type_definition)_named_type_reference1, null, definition_attribute.None, false); - parsertools.create_source_context(_var_def_statement, il, _named_type_reference1); - var_statement _var_statement = new var_statement(_var_def_statement); - parsertools.create_source_context(_var_statement, null, _var_def_statement); - ((statement_list)_if_node.then_body).subnodes.Insert(0, _var_statement);//obyavlenie peremennoy - - op_type_node _op_type_node2 = new op_type_node(Operators.Assignment); - _op_type_node2.source_context = parsertools.GetTokenSourceContext(); - assign _assign = new assign(il.idents[0] as addressed_value, _function_header.parametres.params_list[j].idents.idents[0] as expression, _op_type_node2.type); - parsertools.create_source_context(_assign, il.idents[0], _function_header.parametres.params_list[j].idents.idents[0]); - ((statement_list)_if_node.then_body).subnodes.Insert(1, _assign); - } - }*/ - //// - parsertools.create_source_context(_if_node, null, _if_node); - last_if = _if_node; - } - stmt_l.subnodes.Add(last_if); - - block _block = new block(null, null); - statement_list sl = null; - if (stmt_l is statement_list) - sl = stmt_l as statement_list; - else - { - sl = new statement_list(); - sl.subnodes.Add(stmt_l as statement); - if (!(stmt_l is empty_statement)) - parsertools.assign_source_context(sl, stmt_l); - } - _block.program_code = sl; - ////////////////// - procedure_definition _procedure_definition = new procedure_definition(_function_header, null); - rt = _function_header; - if (_block != null) - { - rt = _block; - if (_block is proc_block) - _procedure_definition.proc_body = (proc_block)_block; - } - parsertools.create_source_context(_procedure_definition, _function_header, rt); - param_value_list.Clear(); - body_variant_list.Clear(); - return _procedure_definition; - } \ No newline at end of file diff --git a/Parsers/BFParser/BFLang.resources b/Parsers/BFParser/BFLang.resources deleted file mode 100644 index 9ba3d827d..000000000 Binary files a/Parsers/BFParser/BFLang.resources and /dev/null differ diff --git a/Parsers/BFParser/BFParser.csproj b/Parsers/BFParser/BFParser.csproj deleted file mode 100644 index 41bda4808..000000000 --- a/Parsers/BFParser/BFParser.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {35F1E213-0BEA-4C12-B004-129EA088CD75} - Library - Properties - BFParser - BFParser - - - 4.0 - - - v4.0 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - ..\..\bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - ..\..\bin\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\bin\SyntaxTree.dll - - - - - - - - - - - - - - - - - {44A01F9E-DCE7-470C-AAE5-C3DE0CCBEE3B} - Errors - - - {AF2EFD7B-69DD-4B43-AF65-B59B29349C23} - ParserTools - - - - - False - КлиентÑ�кий профиль .NET Framework 3.5 SP1 - false - - - False - .NET Framework 3.5 SP1 - true - - - False - УÑ�тановщик Windows 3.1 - true - - - - - \ No newline at end of file diff --git a/Parsers/BFParser/BFParserTools.cs b/Parsers/BFParser/BFParserTools.cs deleted file mode 100644 index 6d4bb9af5..000000000 --- a/Parsers/BFParser/BFParserTools.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Text; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.ParserTools; -using GoldParser; - - -namespace PascalABCCompiler.BFParser -{ - public class BF_parsertools:parser_tools - { - public override string symbol_to_string(Symbol symbol) - { - return null; - } - public override int symbol_priority(Symbol symbol) - { - return 0; - } - } -} diff --git a/Parsers/BFParser/BF_lrparser.cs b/Parsers/BFParser/BF_lrparser.cs deleted file mode 100644 index 79ea7c1ed..000000000 --- a/Parsers/BFParser/BF_lrparser.cs +++ /dev/null @@ -1,492 +0,0 @@ - -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.ParserTools; -using GoldParser; - -namespace PascalABCCompiler.BFParser -{ - - public class GPBParser_BF:GPBParser - { - private Stack NodesStack; - private int operation_value=0; - private object left_node,right_node; - - public GPBParser_BF(Stream stream) - :base(stream) - { - parsertools = new BF_parsertools(); - } - - public object Parse(string source) - { - NodesStack = new Stack(); - LRParser = new Parser(new StringReader(source), LanguageGrammar); - parsertools.parser = LRParser; - LRParser.TrimReductions = false; - while (true) - { - switch (LRParser.Parse()) - { - case ParseMessage.LexicalError: - errors.Add(new TokenReadError(this)); - LRParser.PopInputToken(); - if (errors.Count > max_errors) - return null; - break; - - case ParseMessage.SyntaxError: - prev_node = LRParser.TokenSyntaxNode; - Error er = new UnexpectedToken(this,parsertools.symbol_collection_to_string(this.LRParser.GetExpectedTokens())); - Symbol sym = LRParser.PopInputToken(); - if (sym.SymbolType == SymbolType.End && errors.Count > 0) - return null; - errors.Add(er); - if (errors.Count > max_errors) - return null; - break; - case ParseMessage.Reduction: - LRParser.TokenSyntaxNode = CreateNonTerminalObject(); - break; - - case ParseMessage.Accept: - return LRParser.TokenSyntaxNode; - - case ParseMessage.TokenRead: - LRParser.TokenSyntaxNode = CreateTerminalObject(); - break; - - case ParseMessage.InternalError: - errors.Add(new CompilerInternalError("PascalABCParser", new Exception("ParseMessage.InternalError"))); - return null; - - case ParseMessage.NotLoadedError: - errors.Add(new CompilerInternalError("PascalABCParser", new Exception("ParseMessage.NotLoadedError"))); - return null; - - case ParseMessage.CommentError: - errors.Add(new UnexpectedToken(this,"(EOF)")); - return null; - - /*case ParseMessage.CommentBlockRead: - break; - - case ParseMessage.CommentLineRead: - break;*/ - } - } - - } - - public enum SymbolConstants : int - { - SYMBOL_EOF = 0, // (EOF) - SYMBOL_ERROR = 1, // (Error) - SYMBOL_WHITESPACE = 2, // (Whitespace) - SYMBOL_TKDEC = 3, // 'tkDec' - SYMBOL_TKDECVALUE = 4, // 'tkDecValue' - SYMBOL_TKINC = 5, // 'tkInc' - SYMBOL_TKINCVALUE = 6, // 'tkIncValue' - SYMBOL_TKJMPPAST = 7, // 'tkJMPPast' - SYMBOL_TKJMPRET = 8, // 'tkJMPRet' - SYMBOL_TKREAD = 9, // 'tkRead' - SYMBOL_TKWRITE = 10, // 'tkWrite' - SYMBOL_BF = 11, // - SYMBOL_BF_EMPTY_INSTRUCTION = 12, // - SYMBOL_BF_INSTRUCTION = 13, // - SYMBOL_BF_INSTRUCTIONS = 14, // - SYMBOL_BF_INSTRUCTIONS_LIST = 15, // - SYMBOL_CHANGE_POS = 16, // - SYMBOL_CHANGE_POS_LIST = 17, // - SYMBOL_CHANGE_VALUE = 18, // - SYMBOL_CHANGE_VALUE_LIST = 19 // - }; - - public enum RuleConstants : int - { - RULE_BF = 0, // ::= - RULE_BF_EMPTY_INSTRUCTION = 1, // ::= - RULE_BF_INSTRUCTIONS = 2, // ::= - RULE_BF_INSTRUCTIONS2 = 3, // ::= - RULE_BF_INSTRUCTIONS_LIST = 4, // ::= - RULE_BF_INSTRUCTIONS_LIST2 = 5, // ::= - RULE_CHANGE_POS_LIST = 6, // ::= - RULE_CHANGE_POS_LIST2 = 7, // ::= - RULE_CHANGE_VALUE_LIST = 8, // ::= - RULE_CHANGE_VALUE_LIST2 = 9, // ::= - RULE_CHANGE_POS_TKINC = 10, // ::= 'tkInc' - RULE_CHANGE_POS_TKDEC = 11, // ::= 'tkDec' - RULE_CHANGE_VALUE_TKINCVALUE = 12, // ::= 'tkIncValue' - RULE_CHANGE_VALUE_TKDECVALUE = 13, // ::= 'tkDecValue' - RULE_BF_INSTRUCTION_TKJMPPAST_TKJMPRET = 14, // ::= 'tkJMPPast' 'tkJMPRet' - RULE_BF_INSTRUCTION = 15, // ::= - RULE_BF_INSTRUCTION2 = 16, // ::= - RULE_BF_INSTRUCTION_TKWRITE = 17, // ::= 'tkWrite' - RULE_BF_INSTRUCTION_TKREAD = 18 // ::= 'tkRead' - }; - - private Object CreateTerminalObject() - { - switch ((SymbolConstants) LRParser.TokenSymbol.Index) - { - case SymbolConstants.SYMBOL_EOF : - //(EOF) - //TERMINAL:EOF - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_ERROR : - //(Error) - //TERMINAL:Error - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_WHITESPACE : - //(Whitespace) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Whitespace' return NULL! \n\r");*/return null; - - case SymbolConstants.SYMBOL_TKDEC : - //'tkDec' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - - case SymbolConstants.SYMBOL_TKDECVALUE : - //'tkDecValue' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - - case SymbolConstants.SYMBOL_TKINC : - //'tkInc' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - - case SymbolConstants.SYMBOL_TKINCVALUE : - //'tkIncValue' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - - case SymbolConstants.SYMBOL_TKJMPPAST : - //'tkJMPPast' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - - case SymbolConstants.SYMBOL_TKJMPRET : - //'tkJMPRet' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - - case SymbolConstants.SYMBOL_TKREAD : - //'tkRead' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - - case SymbolConstants.SYMBOL_TKWRITE : - //'tkWrite' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - - case SymbolConstants.SYMBOL_BF : - // - //TERMINAL:BF - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_BF_EMPTY_INSTRUCTION : - // - //TERMINAL:bf_empty_instruction - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_BF_INSTRUCTION : - // - //TERMINAL:bf_instruction - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_BF_INSTRUCTIONS : - // - //TERMINAL:bf_instructions - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_BF_INSTRUCTIONS_LIST : - // - //TERMINAL:bf_instructions_list - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_CHANGE_POS : - // - //TERMINAL:change_pos - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_CHANGE_POS_LIST : - // - //TERMINAL:change_pos_list - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_CHANGE_VALUE : - // - //TERMINAL:change_value - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_CHANGE_VALUE_LIST : - // - //TERMINAL:change_value_list - return null; - //ENDTERMINAL - - } - throw new SymbolException("Unknown symbol"); - } - - public Object CreateNonTerminalObject() - { - switch ((RuleConstants) LRParser.ReductionRule.Index) - { - case RuleConstants.RULE_BF : - // ::= - - { - program_module _program_module=new program_module(); - - _program_module.Language = LanguageId.PascalABCNET; - ident BFSystem=new ident("BFSystem"); - unit_or_namespace unit=new unit_or_namespace(); - unit.name = new ident_list(); - unit.name.idents.Add(BFSystem); - uses_list used_units=new uses_list(); - used_units.units.Add(unit); - block program_block=new block(null,(statement_list)LRParser.GetReductionSyntaxNode(0)); - _program_module.used_units=used_units; - _program_module.program_block=program_block; - used_units.source_context=unit.source_context=BFSystem.source_context=new SourceContext(1,1,1,1,1,1); - parsertools.create_source_context(program_block,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_program_module,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - operation_value=0; - - return _program_module; - } - - - case RuleConstants.RULE_BF_EMPTY_INSTRUCTION : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - - case RuleConstants.RULE_BF_INSTRUCTIONS : - // ::= -return LRParser.GetReductionSyntaxNode(0); - - case RuleConstants.RULE_BF_INSTRUCTIONS2 : - // ::= - - { - statement_list _statement_list=new statement_list(); - _statement_list.subnodes.Add(new empty_statement()); - return _statement_list; - } - - - case RuleConstants.RULE_BF_INSTRUCTIONS_LIST : - // ::= - - //TemplateList for statement_list (create) - { - statement_list _statement_list=new statement_list(); - _statement_list.source_context=((statement)LRParser.GetReductionSyntaxNode(0)).source_context; - _statement_list.subnodes.Add((statement)LRParser.GetReductionSyntaxNode(0)); - return _statement_list; - } - - - case RuleConstants.RULE_BF_INSTRUCTIONS_LIST2 : - // ::= - - //TemplateList for statement_list (add) - { - statement_list _statement_list=(statement_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_statement_list,_statement_list,LRParser.GetReductionSyntaxNode(1)); - _statement_list.subnodes.Add((statement)LRParser.GetReductionSyntaxNode(1)); - return _statement_list; - } - - - case RuleConstants.RULE_CHANGE_POS_LIST : - // ::= - left_node=right_node=LRParser.GetReductionSyntaxNode(0); return null; - - case RuleConstants.RULE_CHANGE_POS_LIST2 : - // ::= - right_node=LRParser.GetReductionSyntaxNode(1); return null; - - case RuleConstants.RULE_CHANGE_VALUE_LIST : - // ::= - left_node=right_node=LRParser.GetReductionSyntaxNode(0); return null; - - case RuleConstants.RULE_CHANGE_VALUE_LIST2 : - // ::= - right_node=LRParser.GetReductionSyntaxNode(1); return null; - - case RuleConstants.RULE_CHANGE_POS_TKINC : - // ::= 'tkInc' - operation_value++; return LRParser.GetReductionSyntaxNode(0); - - case RuleConstants.RULE_CHANGE_POS_TKDEC : - // ::= 'tkDec' - operation_value--; return LRParser.GetReductionSyntaxNode(0); - - case RuleConstants.RULE_CHANGE_VALUE_TKINCVALUE : - // ::= 'tkIncValue' - operation_value++; return LRParser.GetReductionSyntaxNode(0); - - case RuleConstants.RULE_CHANGE_VALUE_TKDECVALUE : - // ::= 'tkDecValue' - operation_value--; return LRParser.GetReductionSyntaxNode(0); - - case RuleConstants.RULE_BF_INSTRUCTION_TKJMPPAST_TKJMPRET : - // ::= 'tkJMPPast' 'tkJMPRet' - - { - indexer indx=new indexer(new expression_list()); - indx.indexes.expressions.Add(new ident("BFCaretPos")); - indx.dereferencing_value=new ident("BFField"); - bin_expr be=new bin_expr(indx,new int32_const(0),Operators.NotEqual); - while_node wn=new while_node(); - wn.expr=be; - wn.statements=(statement_list)LRParser.GetReductionSyntaxNode(1); - parsertools.create_source_context(wn,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - be.right.source_context=indx.dereferencing_value.source_context=indx.source_context=indx.indexes.expressions[0].source_context=be.source_context=wn.source_context; - return wn; - } - - - case RuleConstants.RULE_BF_INSTRUCTION : - // ::= - - { - if (operation_value!=0) - { - ident caret=new ident("BFCaretPos"); - int32_const caret_n=new int32_const(operation_value); - operation_value=0; - bin_expr expr=new bin_expr(caret,caret_n,Operators.Plus); - assign _assign=new assign(caret,expr,Operators.Assignment); - parsertools.create_source_context(caret,left_node,right_node); - caret_n.source_context=expr.source_context=_assign.source_context=caret.source_context; - return _assign; - } - syntax_tree_node tn=new empty_statement(); - parsertools.create_source_context(tn,left_node,right_node); - return tn; - } - - - case RuleConstants.RULE_BF_INSTRUCTION2 : - // ::= - - { - if (operation_value!=0) - { - indexer indx=new indexer(new expression_list()); - indx.indexes.expressions.Add(new ident("BFCaretPos")); - indx.dereferencing_value=new ident("BFField"); - bin_expr be=new bin_expr(indx,new int32_const(operation_value),Operators.Plus); - assign assg=new assign(indx,be,Operators.Assignment); - operation_value=0; - parsertools.create_source_context(assg,left_node,right_node); - indx.dereferencing_value.source_context=indx.source_context=indx.indexes.expressions[0].source_context=be.right.source_context=be.source_context=assg.source_context; - return assg; - } - syntax_tree_node tn=new empty_statement(); - parsertools.create_source_context(tn,left_node,right_node); - return tn; - } - - - case RuleConstants.RULE_BF_INSTRUCTION_TKWRITE : - // ::= 'tkWrite' - - { - ident _ident=new ident("WriteCaretValue"); - procedure_call _procedure_call=new procedure_call(_ident); - parsertools.create_source_context(_ident,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_procedure_call,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _procedure_call; - } - - - case RuleConstants.RULE_BF_INSTRUCTION_TKREAD : - // ::= 'tkRead' - - { - ident _ident=new ident("ReadCaretValue"); - procedure_call _procedure_call=new procedure_call(_ident); - parsertools.create_source_context(_ident,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_procedure_call,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _procedure_call; - } - - - } - throw new RuleException("Unknown rule"); - } - } -} diff --git a/Parsers/BFParser/Parser.cs b/Parsers/BFParser/Parser.cs deleted file mode 100644 index 3f5e65214..000000000 --- a/Parsers/BFParser/Parser.cs +++ /dev/null @@ -1,154 +0,0 @@ -using System; -using System.IO; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Parsers; -using System.Resources; -using System.Reflection; -using System.Collections.Generic; -using PascalABCCompiler.Errors; - - - -namespace PascalABCCompiler.BFParser -{ - - public class BFLanguageParser: IParser - { - private GPBParser_BF parser; - - public BFLanguageParser() - { - filesExtensions = new string[1]; - filesExtensions[0] = ".bf"; - parser = null; - } - - string[] filesExtensions; - public string[] FilesExtensions - { - get - { - return filesExtensions; - } - } - - public ILanguageInformation LanguageInformation { - get { - return null; - } - } - - public bool CaseSensitive - { - get - { - return parser.LanguageGrammar.CaseSensitive; - } - } - - public Keyword[] Keywords - { - get - { - return new Keyword[0]; - } - } - - - public List CompilerDirectives - { - get - { - return new List(); - } - } - - List errors = new List(); - public List Errors - { - get - { - return errors; - } - set - { - errors = value; - } - } - - SourceFilesProviderDelegate sourceFilesProvider = null; - public SourceFilesProviderDelegate SourceFilesProvider - { - get - { - return sourceFilesProvider; - } - set - { - sourceFilesProvider = value; - } - } - - public string Name - { - get - { - return "BF"; - } - } - public string Version - { - get - { - return "1.1"; - } - } - public string Copyright - { - get - { - return "(c) Òêà÷óê À.Â. 2006"; - } - } - public void Reset() - { - parser = new GPBParser_BF(CGTResourceExtractor.Extract(new ResourceManager("BFParser.BFLang", Assembly.GetExecutingAssembly()), "BFLanguage")); - //parser.Parse("+[.,]"); - parser.max_errors = 5; - } - - public syntax_tree_node BuildTree(string FileName, string Text,string[] SearchPatchs, ParseMode ParseMode) - { - if (parser == null) - Reset(); - parser.errors = Errors; - parser.current_file_name = FileName; - switch (ParseMode) - { - case ParseMode.Expression: - case ParseMode.Statement: - return null; - } - syntax_tree_node cu = (syntax_tree_node)parser.Parse(Text); - if (cu != null && cu is compilation_unit) - (cu as compilation_unit).file_name = FileName; - return cu; - } - - public override string ToString() - { - return "BF Language Parser v1.1"; - } - public IPreprocessor Preprocessor - { - get - { - return null; - } - } - - } - - -} diff --git a/Parsers/BFParser/Properties/AssemblyInfo.cs b/Parsers/BFParser/Properties/AssemblyInfo.cs deleted file mode 100644 index d81824dcf..000000000 --- a/Parsers/BFParser/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("BF Language Parser")] -[assembly: AssemblyDescription("BF Language Parser for PascalABC.NET")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("PascalABCNETCompiler Team")] -[assembly: AssemblyProduct("BFParser")] -[assembly: AssemblyCopyright("Copyright © DarkStar 2006, 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("92be8996-4d69-46fa-a243-85b2a459a603")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/Parsers/HaskellParser/Errors.cs b/Parsers/HaskellParser/Errors.cs deleted file mode 100644 index 6bcd5dc1a..000000000 --- a/Parsers/HaskellParser/Errors.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.HaskellParser; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.Errors; -using System.Collections.Generic; - -namespace PascalABCCompiler.HaskellParser.Errors -{ - public class UnexpectedToken : SyntaxError - { - private string _message; - public UnexpectedToken(PascalABCCompiler.ParserTools.GPBParser parser) - : base("", parser.current_file_name, parser.parsertools.GetTokenSourceContext(parser.LRParser), (syntax_tree_node)parser.prev_node) - { - List Symbols = parser.parsertools.GetPrioritySymbols(parser.LRParser.GetExpectedTokens()); - if (Symbols.Count == 1) - { - string OneSybmolText = "ONE_" + Symbols[0].Name.ToUpper(); - string LocOneSybmolText = StringResources.Get(OneSybmolText); - if (LocOneSybmolText != OneSybmolText) - { - _message = string.Format(LocOneSybmolText); - return; - } - } - _message = string.Format(StringResources.Get("EXPECTED{0}"), PascalABCCompiler.FormatTools.ObjectsToString(parser.parsertools.SymbolsToStrings(Symbols.ToArray()), ",")); - } - public UnexpectedToken(string _file_name, string expected, SourceContext _source_context, syntax_tree_node _node) - : base("", _file_name, _source_context, _node) - { - _message = string.Format(StringResources.Get("EXPECTED{0}"), expected); - } - public override string Message - { - get - { - return _message; - } - } - } -} diff --git a/Parsers/HaskellParser/HaskellLang.resources b/Parsers/HaskellParser/HaskellLang.resources deleted file mode 100644 index c9c568365..000000000 Binary files a/Parsers/HaskellParser/HaskellLang.resources and /dev/null differ diff --git a/Parsers/HaskellParser/HaskellParser.csproj b/Parsers/HaskellParser/HaskellParser.csproj deleted file mode 100644 index e884f43a2..000000000 --- a/Parsers/HaskellParser/HaskellParser.csproj +++ /dev/null @@ -1,83 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {760E7113-85AE-430F-A3E5-84A20F294356} - Library - Properties - HaskellParser - HaskellParser - - - 4.0 - - - v4.0 - - - - true - full - false - ..\..\bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - ..\..\bin\ - TRACE - prompt - 4 - AllRules.ruleset - - - - - - - - - - - - - - - - - - {44A01F9E-DCE7-470C-AAE5-C3DE0CCBEE3B} - Errors - - - {2DE2842F-0912-4251-BC0F-480854C44A13} - Localization - - - {AF2EFD7B-69DD-4B43-AF65-B59B29349C23} - ParserTools - - - {C2CAC65A-B2AE-4CCC-B067-E6B8E75DF73A} - SyntaxTree - - - - - - - - \ No newline at end of file diff --git a/Parsers/HaskellParser/HaskellParserTools.cs b/Parsers/HaskellParser/HaskellParserTools.cs deleted file mode 100644 index b0600d718..000000000 --- a/Parsers/HaskellParser/HaskellParserTools.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Text; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.ParserTools; -using GoldParser; - -namespace PascalABCCompiler.HaskellParser -{ - public static class StringResources - { - private static string prefix = "HaskellPARSER_"; - public static string Get(string Id) - { - string ret = PascalABCCompiler.StringResources.Get(prefix + Id); - if (ret == prefix + Id) - return Id; - else - return ret; - } - } - - public class Haskell_parsertools : parser_tools - { - public override string symbol_to_string(Symbol symbol) - { - /*switch (symbol.Index) - { - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKMINUS: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKSLASH: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKSTAR: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKGREATER: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKGREATEREQUAL: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKLOWER: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKLOWEREQUAL: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKNOTEQUAL: - return StringResources.Get("OPERATOR"); - }*/ - string res = StringResources.Get(symbol.Name.ToUpper()); - if (res.IndexOf("TK") == 0) - return res.Remove(0, 2).ToLower(); - return res; - } - - public override int symbol_priority(Symbol symbol) - { - /*switch (symbol.Index) - { - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKEND: - return 8; - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKBEGIN: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKNUMBER: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKROUNDCLOSE: - return 9; - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKIDENT: - return 10; - - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKASSIGN: - return 25; - - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKEQUAL: - return 25; - - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKSEMICOLON: - return 30; - - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_EXPRESSION: - return 100; - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_STATEMENT: - return 110; - - }*/ - if (symbol.SymbolType == SymbolType.Terminal) - return 1; - return 0; - } - } -} diff --git a/Parsers/HaskellParser/Haskell_lrparser.cs b/Parsers/HaskellParser/Haskell_lrparser.cs deleted file mode 100644 index d6c411bc4..000000000 --- a/Parsers/HaskellParser/Haskell_lrparser.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.HaskellParser.Errors; -using PascalABCCompiler.ParserTools; - -namespace PascalABCCompiler.HaskellParser -{ - public partial class GPBParser_Haskell : GPBParser - { - private Stack NodesStack; - private SyntaxError error; - - Stream GrammarStream; - - public GPBParser_Haskell(Stream stream) - : base(stream) - { - GrammarStream = stream; - parsertools = new Haskell_parsertools(); - } - - public object Parse(string source) - { - NodesStack = new Stack(); - LRParser = new GoldParser.Parser(new StringReader(source), LanguageGrammar); - parsertools.parser = LRParser; - LRParser.TrimReductions = true; - try - { - while (true) - { - switch (LRParser.Parse()) - { - case GoldParser.ParseMessage.LexicalError: - errors.Add(new TokenReadError(this)); - LRParser.PopInputToken(); - if (errors.Count >= max_errors) - return null; - break; - - //sdes nugno vesti chtoto vrode steka poslednix oshibok. podumat - case GoldParser.ParseMessage.SyntaxError: - GoldParser.Symbol sym = LRParser.PopInputToken(); - error = new HaskellParser.Errors.UnexpectedToken(this); - //error = new UnexpectedToken(this, parsertools.symbol_collection_to_string(this.LRParser.GetExpectedTokens())); - if (sym.SymbolType == GoldParser.SymbolType.End && errors.Count > 0) - return null; - errors.Add(error); - if (errors.Count >= max_errors) - return null; - break; - case GoldParser.ParseMessage.Reduction: - LRParser.TokenSyntaxNode = CreateNonTerminalObject(LRParser.ReductionRule.Index); - if ((LRParser.TokenSyntaxNode as syntax_tree_node) != null) - prev_node = LRParser.TokenSyntaxNode; - break; - - case GoldParser.ParseMessage.Accept: - return LRParser.TokenSyntaxNode; - - case GoldParser.ParseMessage.TokenRead: - LRParser.TokenSyntaxNode = CreateTerminalObject(LRParser.TokenSymbol.Index); - break; - - case GoldParser.ParseMessage.InternalError: - errors.Add(new CompilerInternalError("HaskellParser", new Exception("ParseMessage.InternalError"))); - return null; - - case GoldParser.ParseMessage.NotLoadedError: - errors.Add(new CompilerInternalError("HaskellParser", new Exception("ParseMessage.NotLoadedError"))); - return null; - - case GoldParser.ParseMessage.CommentError: - errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "(EOF)")); - return null; - - /*case ParseMessage.CommentBlockRead: - break; - - case ParseMessage.CommentLineRead: - break;*/ - } - } - } - catch (Exception e) - { - Error_Clear(); - if (errors.Count > 0) - return null; - else - throw; - } - - } - } -} diff --git a/Parsers/HaskellParser/Haskell_lrparser_rules.cs b/Parsers/HaskellParser/Haskell_lrparser_rules.cs deleted file mode 100644 index 3732c6f86..000000000 --- a/Parsers/HaskellParser/Haskell_lrparser_rules.cs +++ /dev/null @@ -1,6511 +0,0 @@ - -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using System.Collections.Generic; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.HaskellParser.Errors; -using PascalABCCompiler.ParserTools; -using GoldParser; -using PascalABCCompiler; - -namespace PascalABCCompiler.HaskellParser -{ -public partial class GPBParser_Haskell : GPBParser -{ - - - - - - - - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - //SymbolConstants - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - - public enum SymbolConstants : int - { - SYMBOL_EOF = 0, // (EOF) - SYMBOL_ERROR = 1, // (Error) - SYMBOL_WHITESPACE = 2, // (Whitespace) - SYMBOL_COMMENTEND = 3, // (Comment End) - SYMBOL_COMMENTLINE = 4, // (Comment Line) - SYMBOL_COMMENTSTART = 5, // (Comment Start) - SYMBOL_TKAND = 6, // 'tkAnd' - SYMBOL_TKARROW = 7, // 'tkArrow' - SYMBOL_TKARROWGEN = 8, // 'tkArrowGen' - SYMBOL_TKASSIGN = 9, // 'tkAssign' - SYMBOL_TKBOOL = 10, // 'tkBool' - SYMBOL_TKBOTTOMMINUS = 11, // 'tkBottomMinus' - SYMBOL_TKCASE = 12, // 'tkCase' - SYMBOL_TKCHAR = 13, // 'tkChar' - SYMBOL_TKCOLON = 14, // 'tkColon' - SYMBOL_TKCOMMA = 15, // 'tkComma' - SYMBOL_TKDO = 16, // 'tkDo' - SYMBOL_TKDOT = 17, // 'tkDot' - SYMBOL_TKDOUBLE = 18, // 'tkDouble' - SYMBOL_TKELSE = 19, // 'tkElse' - SYMBOL_TKEQUAL = 20, // 'tkEqual' - SYMBOL_TKFIGURECLOSE = 21, // 'tkFigureClose' - SYMBOL_TKFIGUREOPEN = 22, // 'tkFigureOpen' - SYMBOL_TKIDENT = 23, // 'tkIdent' - SYMBOL_TKIF = 24, // 'tkIf' - SYMBOL_TKIMPORT = 25, // 'tkImport' - SYMBOL_TKIN = 26, // 'tkIn' - SYMBOL_TKINT = 27, // 'tkInt' - SYMBOL_TKLEFTSLASH = 28, // 'tkLeftSlash' - SYMBOL_TKLESS = 29, // 'tkLess' - SYMBOL_TKLESSEQ = 30, // 'tkLessEq' - SYMBOL_TKLET = 31, // 'tkLet' - SYMBOL_TKMAINIDENT = 32, // 'tkMainIdent' - SYMBOL_TKMAINIDENT1 = 33, // 'tkMainIdent1' - SYMBOL_TKMINUS = 34, // 'tkMinus' - SYMBOL_TKMODULE = 35, // 'tkModule' - SYMBOL_TKMORE = 36, // 'tkMore' - SYMBOL_TKMOREEQ = 37, // 'tkMoreEq' - SYMBOL_TKNOT = 38, // 'tkNot' - SYMBOL_TKNOTEQUAL = 39, // 'tkNotEqual' - SYMBOL_TKOF = 40, // 'tkOf' - SYMBOL_TKOR = 41, // 'tkOr' - SYMBOL_TKOTHERWISE = 42, // 'tkOtherwise' - SYMBOL_TKPLUS = 43, // 'tkPlus' - SYMBOL_TKQUOTE = 44, // 'tkQuote' - SYMBOL_TKREF = 45, // 'tkRef' - SYMBOL_TKRETURN = 46, // 'tkReturn' - SYMBOL_TKROUNDCLOSE = 47, // 'tkRoundClose' - SYMBOL_TKROUNDOPEN = 48, // 'tkRoundOpen' - SYMBOL_TKSEMICOLON = 49, // 'tkSemiColon' - SYMBOL_TKSLASH = 50, // 'tkSlash' - SYMBOL_TKSPLIT = 51, // 'tkSplit' - SYMBOL_TKSQUARECLOSE = 52, // 'tkSquareClose' - SYMBOL_TKSQUAREOPEN = 53, // 'tkSquareOpen' - SYMBOL_TKSTAR = 54, // 'tkStar' - SYMBOL_TKSTRING = 55, // 'tkString' - SYMBOL_TKTHEN = 56, // 'tkThen' - SYMBOL_TKWHERE = 57, // 'tkWhere' - SYMBOL_ADD_EXPR = 58, // - SYMBOL_ADDOP = 59, // - SYMBOL_BODY = 60, // - SYMBOL_BODY_FUNC = 61, // - SYMBOL_BODY_WHERE = 62, // - SYMBOL_CASE_VARIANT = 63, // - SYMBOL_CASE_VARIANTS = 64, // - SYMBOL_CONDITION = 65, // - SYMBOL_CONDITIONS = 66, // - SYMBOL_CONDITIONS_COMMA = 67, // - SYMBOL_CORTEG = 68, // - SYMBOL_DEF_VAR = 69, // - SYMBOL_DEF_VARS = 70, // - SYMBOL_EMPTY = 71, // - SYMBOL_EXPR = 72, // - SYMBOL_FUNC_CALL = 73, // - SYMBOL_FUNCS = 74, // - SYMBOL_FUNCS_VARIANTS = 75, // - SYMBOL_GENERATOR = 76, // - SYMBOL_GENERATORS = 77, // - SYMBOL_GUARD = 78, // - SYMBOL_GUARD_BODY = 79, // - SYMBOL_GUARD_BODY_LIST = 80, // - SYMBOL_IMPORT = 81, // - SYMBOL_IMPORTS = 82, // - SYMBOL_INFIX_EXPR = 83, // - SYMBOL_INIT = 84, // - SYMBOL_INITS = 85, // - SYMBOL_LAMBDA_FUNC = 86, // - SYMBOL_LIST = 87, // - SYMBOL_LIST_CONSTRUCTOR = 88, // - SYMBOL_LIST_ELEMENTS = 89, // - SYMBOL_LIST_PARAM = 90, // - SYMBOL_LIST_PARAM1 = 91, // - SYMBOL_MAIN_FUNC = 92, // - SYMBOL_MODULE = 93, // - SYMBOL_MULT_EXPR = 94, // - SYMBOL_MULTOP = 95, // - SYMBOL_NEGATE_EXPR = 96, // - SYMBOL_PARAM = 97, // - SYMBOL_PARAM_VALUE = 98, // - SYMBOL_PARAMS = 99, // - SYMBOL_PARAMS_VALUE = 100, // - SYMBOL_PARAMS_WHERE = 101, // - SYMBOL_PARAMS1 = 102, // - SYMBOL_REFERENCE = 103, // - SYMBOL_SIMPLE_EXPR = 104, // - SYMBOL_SIMPLE_TYPE_EXPR = 105, // - SYMBOL_STMT = 106, // - SYMBOL_STMTS = 107, // - SYMBOL_STMTS1 = 108, // - SYMBOL_VARIABLE = 109, // - SYMBOL_VARIABLE_EXPR = 110, // - SYMBOL_VARIANT = 111, // - SYMBOL_VARIANTS = 112, // - SYMBOL_WHERE_VAR = 113 // - }; - - - - - - - - - - - - - - - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - //RuleConstants - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - - public enum RuleConstants : int - { - RULE_MODULE_TKMODULE_TKMAINIDENT_TKWHERE = 0, // ::= 'tkModule' 'tkMainIdent' 'tkWhere' - RULE_MODULE = 1, // ::= - RULE_MODULE_TKMODULE_TKIDENT_TKWHERE = 2, // ::= 'tkModule' 'tkIdent' 'tkWhere' - RULE_REFERENCE = 3, // ::= - RULE_REFERENCE_TKREF_TKSTRING = 4, // ::= 'tkRef' 'tkString' - RULE_IMPORTS = 5, // ::= - RULE_IMPORTS2 = 6, // ::= - RULE_IMPORTS3 = 7, // ::= - RULE_IMPORT_TKIMPORT_TKIDENT = 8, // ::= 'tkImport' 'tkIdent' - RULE_BODY = 9, // ::= - RULE_BODY2 = 10, // ::= - RULE_FUNCS = 11, // ::= - RULE_FUNCS_VARIANTS = 12, // ::= - RULE_VARIANTS = 13, // ::= - RULE_VARIANTS2 = 14, // ::= - RULE_VARIANT_TKIDENT = 15, // ::= 'tkIdent' - RULE_VARIANT_TKQUOTE_TKIDENT_TKQUOTE = 16, // ::= 'tkQuote' 'tkIdent' 'tkQuote' - RULE_LIST_PARAM1 = 17, // ::= - RULE_BODY_WHERE = 18, // ::= - RULE_WHERE_VAR = 19, // ::= - RULE_WHERE_VAR_TKWHERE = 20, // ::= 'tkWhere' - RULE_INITS = 21, // ::= - RULE_INITS_TKSEMICOLON = 22, // ::= 'tkSemiColon' - RULE_INIT_TKIDENT = 23, // ::= 'tkIdent' - RULE_PARAMS_WHERE = 24, // ::= - RULE_PARAMS_WHERE2 = 25, // ::= - RULE_PARAMS_WHERE3 = 26, // ::= - RULE_PARAMS = 27, // ::= - RULE_PARAMS2 = 28, // ::= - RULE_PARAMS3 = 29, // ::= - RULE_PARAM = 30, // ::= - RULE_LIST_PARAM_TKIDENT = 31, // ::= 'tkIdent' - RULE_LIST_PARAM = 32, // ::= - RULE_LIST_PARAM_TKSQUAREOPEN_TKSQUARECLOSE = 33, // ::= 'tkSquareOpen' 'tkSquareClose' - RULE_LIST_PARAM_TKBOTTOMMINUS = 34, // ::= 'tkBottomMinus' - RULE_LIST_PARAM_TKIDENT_TKCOLON = 35, // ::= 'tkIdent' 'tkColon' - RULE_LIST_PARAM_TKBOTTOMMINUS_TKCOLON = 36, // ::= 'tkBottomMinus' 'tkColon' - RULE_LIST_PARAM_TKROUNDOPEN_TKROUNDCLOSE = 37, // ::= 'tkRoundOpen' 'tkRoundClose' - RULE_GUARD = 38, // ::= - RULE_GUARD_TKSPLIT = 39, // ::= 'tkSplit' - RULE_GUARD_TKSPLIT_TKOTHERWISE = 40, // ::= 'tkSplit' 'tkOtherwise' - RULE_MAIN_FUNC_TKMAINIDENT1_TKASSIGN = 41, // ::= 'tkMainIdent1' 'tkAssign' - RULE_BODY_FUNC = 42, // ::= - RULE_STMTS = 43, // ::= - RULE_STMTS_TKSEMICOLON = 44, // ::= 'tkSemiColon' - RULE_STMTS1 = 45, // ::= - RULE_STMTS12 = 46, // ::= - RULE_EXPR_TKEQUAL = 47, // ::= 'tkEqual' - RULE_EXPR_TKNOTEQUAL = 48, // ::= 'tkNotEqual' - RULE_EXPR_TKMORE = 49, // ::= 'tkMore' - RULE_EXPR_TKLESS = 50, // ::= 'tkLess' - RULE_EXPR_TKMOREEQ = 51, // ::= 'tkMoreEq' - RULE_EXPR_TKLESSEQ = 52, // ::= 'tkLessEq' - RULE_EXPR = 53, // ::= - RULE_LIST_TKSQUAREOPEN_TKSQUARECLOSE = 54, // ::= 'tkSquareOpen' 'tkSquareClose' - RULE_LIST_TKSQUAREOPEN_TKDOT_TKDOT_TKSQUARECLOSE = 55, // ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' - RULE_LIST_TKSQUAREOPEN_TKDOT_TKDOT_TKSQUARECLOSE2 = 56, // ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' - RULE_LIST = 57, // ::= - RULE_LIST_TKCOLON = 58, // ::= 'tkColon' - RULE_LIST_CONSTRUCTOR_TKSQUAREOPEN_TKSPLIT_TKSQUARECLOSE = 59, // ::= 'tkSquareOpen' 'tkSplit' 'tkSquareClose' - RULE_GENERATORS = 60, // ::= - RULE_GENERATORS_TKCOMMA = 61, // ::= 'tkComma' - RULE_GENERATOR_TKARROWGEN = 62, // ::= 'tkArrowGen' - RULE_CONDITIONS_COMMA = 63, // ::= - RULE_CONDITIONS_COMMA_TKCOMMA = 64, // ::= 'tkComma' - RULE_CONDITIONS = 65, // ::= - RULE_CONDITIONS_TKCOMMA = 66, // ::= 'tkComma' - RULE_CONDITION = 67, // ::= - RULE_CORTEG_TKROUNDOPEN_TKCOMMA_TKROUNDCLOSE = 68, // ::= 'tkRoundOpen' 'tkComma' 'tkRoundClose' - RULE_LIST_ELEMENTS = 69, // ::= - RULE_LIST_ELEMENTS2 = 70, // ::= - RULE_LIST_ELEMENTS_TKCOMMA = 71, // ::= 'tkComma' - RULE_ADD_EXPR_TKAND = 72, // ::= 'tkAnd' - RULE_ADD_EXPR = 73, // ::= - RULE_ADD_EXPR2 = 74, // ::= - RULE_MULT_EXPR_TKOR = 75, // ::= 'tkOr' - RULE_MULT_EXPR = 76, // ::= - RULE_MULT_EXPR2 = 77, // ::= - RULE_NEGATE_EXPR_TKMINUS = 78, // ::= 'tkMinus' - RULE_NEGATE_EXPR_TKNOT = 79, // ::= 'tkNot' - RULE_NEGATE_EXPR = 80, // ::= - RULE_SIMPLE_EXPR = 81, // ::= - RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDCLOSE = 82, // ::= 'tkRoundOpen' 'tkRoundClose' - RULE_SIMPLE_EXPR2 = 83, // ::= - RULE_SIMPLE_EXPR3 = 84, // ::= - RULE_SIMPLE_EXPR_TKLET_TKIN = 85, // ::= 'tkLet' 'tkIn' - RULE_SIMPLE_EXPR4 = 86, // ::= - RULE_SIMPLE_EXPR5 = 87, // ::= - RULE_SIMPLE_EXPR6 = 88, // ::= - RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDOPEN_TKROUNDCLOSE_TKROUNDCLOSE = 89, // ::= 'tkRoundOpen' 'tkRoundOpen' 'tkRoundClose' 'tkRoundClose' - RULE_SIMPLE_TYPE_EXPR_TKINT = 90, // ::= 'tkInt' - RULE_SIMPLE_TYPE_EXPR_TKDOUBLE = 91, // ::= 'tkDouble' - RULE_SIMPLE_TYPE_EXPR_TKBOOL = 92, // ::= 'tkBool' - RULE_SIMPLE_TYPE_EXPR_TKCHAR = 93, // ::= 'tkChar' - RULE_SIMPLE_TYPE_EXPR_TKSTRING = 94, // ::= 'tkString' - RULE_VARIABLE_EXPR = 95, // ::= - RULE_DEF_VARS = 96, // ::= - RULE_DEF_VARS_TKSEMICOLON = 97, // ::= 'tkSemiColon' - RULE_DEF_VAR_TKIDENT = 98, // ::= 'tkIdent' - RULE_GUARD_BODY_LIST = 99, // ::= - RULE_GUARD_BODY_LIST2 = 100, // ::= - RULE_GUARD_BODY_TKASSIGN = 101, // ::= 'tkAssign' - RULE_VARIABLE_TKIDENT = 102, // ::= 'tkIdent' - RULE_VARIABLE_TKROUNDOPEN_TKIDENT_TKROUNDCLOSE = 103, // ::= 'tkRoundOpen' 'tkIdent' 'tkRoundClose' - RULE_VARIABLE_TKROUNDOPEN_TKROUNDCLOSE = 104, // ::= 'tkRoundOpen' 'tkRoundClose' - RULE_VARIABLE_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE = 105, // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE = 106, // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE2 = 107, // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - RULE_INFIX_EXPR_TKROUNDOPEN_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE_TKROUNDCLOSE = 108, // ::= 'tkRoundOpen' 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' 'tkRoundClose' - RULE_MULTOP_TKSTAR = 109, // ::= 'tkStar' - RULE_MULTOP_TKSLASH = 110, // ::= 'tkSlash' - RULE_ADDOP_TKPLUS = 111, // ::= 'tkPlus' - RULE_ADDOP_TKMINUS = 112, // ::= 'tkMinus' - RULE_STMT_TKIDENT_TKARROWGEN_TKIDENT = 113, // ::= 'tkIdent' 'tkArrowGen' 'tkIdent' - RULE_STMT_TKIF_TKTHEN_TKELSE = 114, // ::= 'tkIf' 'tkThen' 'tkElse' - RULE_STMT_TKCASE_TKROUNDOPEN_TKROUNDCLOSE_TKOF = 115, // ::= 'tkCase' 'tkRoundOpen' 'tkRoundClose' 'tkOf' - RULE_STMT_TKDO_TKFIGUREOPEN_TKSEMICOLON_TKFIGURECLOSE = 116, // ::= 'tkDo' 'tkFigureOpen' 'tkSemiColon' 'tkFigureClose' - RULE_STMT_TKDO = 117, // ::= 'tkDo' - RULE_STMT_TKRETURN = 118, // ::= 'tkReturn' - RULE_STMT = 119, // ::= - RULE_CASE_VARIANTS = 120, // ::= - RULE_CASE_VARIANTS_TKSPLIT = 121, // ::= 'tkSplit' - RULE_CASE_VARIANT_TKROUNDOPEN_TKROUNDCLOSE_TKARROW = 122, // ::= 'tkRoundOpen' 'tkRoundClose' 'tkArrow' - RULE_PARAMS1 = 123, // ::= - RULE_PARAMS1_TKCOMMA = 124, // ::= 'tkComma' - RULE_FUNC_CALL = 125, // ::= - RULE_PARAMS_VALUE = 126, // ::= - RULE_PARAMS_VALUE2 = 127, // ::= - RULE_PARAM_VALUE = 128, // ::= - RULE_LAMBDA_FUNC_TKLEFTSLASH_TKARROW = 129, // ::= 'tkLeftSlash' 'tkArrow' - RULE_EMPTY = 130 // ::= - }; - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -private Object CreateTerminalObject(int TokenSymbolIndex) -{ -switch (TokenSymbolIndex) -{ - case (int)SymbolConstants.SYMBOL_EOF : - //(EOF) - //TERMINAL:EOF - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ERROR : - //(Error) - //TERMINAL:Error - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_WHITESPACE : - //(Whitespace) - //TERMINAL:Whitespace - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_COMMENTEND : - //(Comment End) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment End' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_COMMENTLINE : - //(Comment Line) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment Line' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_COMMENTSTART : - //(Comment Start) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment Start' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_TKAND : - //'tkAnd' - - { - op_type_node _op_type_node=new op_type_node(Operators.LogicalAND); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKARROW : - //'tkArrow' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKARROWGEN: - //'tkArrowGen' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKASSIGN : - //'tkAssign' - - { - if (token_where == 2 || token_where == 1) - { - token_where = 0; - lambda_stack.Add(new ArrayList()); - //let_stack.Add(new ArrayList()); - let_where_funcs_main.Add(let_where_funcs.Clone()); - let_where_funcs.Clear(); - } - else - if (token_let == 1) - lambda_stack.Add(new ArrayList()); - if (token_let == 1) - let_stack.Add(new ArrayList()); - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKBOOL : - //'tkBool' -{ - ident _ident = null; - string s = LRParser.TokenText; - if (s == "True" || s == "true") - s = "true"; - else - s = "false"; - _ident =new ident(s); - _ident.source_context = parsertools.GetTokenSourceContext(); - return _ident; - } - case (int)SymbolConstants.SYMBOL_TKBOTTOMMINUS: - //'tkBottomMinus' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - case (int)SymbolConstants.SYMBOL_TKCASE : - //'tkCase' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCHAR : - //'tkChar' -return parsertools.create_char_const(this); - case (int)SymbolConstants.SYMBOL_TKCOLON : - //'tkColon' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCOMMA : - //'tkComma' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKDO : - //'tkDo' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKDOT : - //'tkDot' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKDOUBLE : - //'tkDouble' -return parsertools.create_double_const(this); - case (int)SymbolConstants.SYMBOL_TKELSE : - //'tkElse' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKEQUAL : - //'tkEqual' - - { - op_type_node _op_type_node=new op_type_node(Operators.Equal); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKFIGURECLOSE : - //'tkFigureClose' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKFIGUREOPEN : - //'tkFigureOpen' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - /*case (int)SymbolConstants.SYMBOL_TKGETCHAR: - //'tkGetChar' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - }*/ - - case (int)SymbolConstants.SYMBOL_TKIDENT : - //'tkIdent' -return parsertools.create_ident(this); - case (int)SymbolConstants.SYMBOL_TKIF : - //'tkIf' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKIMPORT : - //'tkImport' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKIN : - //'tkIn' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKINT : - //'tkInt' -return parsertools.create_int_const(this); - case (int)SymbolConstants.SYMBOL_TKLEFTSLASH : - //'tkLeftSlash' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - lambda_stack.Add(new ArrayList()); - let_stack.Add(new ArrayList()); - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKLESS : - //'tkLess' - - { - op_type_node _op_type_node=new op_type_node(Operators.Less); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKLESSEQ : - //'tkLessEq' - - { - op_type_node _op_type_node=new op_type_node(Operators.LessEqual); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKLET : - //'tkLet' - - { - token_let = 1; - lambda_stack.Add(new ArrayList()); - //let_where_list_params.Clear(); - ///// - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKMAINIDENT : - //'tkMainIdent' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKMAINIDENT1 : - //'tkMainIdent1' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKMINUS : - //'tkMinus' - - { - op_type_node _op_type_node=new op_type_node(Operators.Minus); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKMODULE : - //'tkModule' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKMORE : - //'tkMore' - - { - op_type_node _op_type_node=new op_type_node(Operators.Greater); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKMOREEQ : - //'tkMoreEq' - - { - op_type_node _op_type_node=new op_type_node(Operators.GreaterEqual); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKNOT : - //'tkNot' - - { - op_type_node _op_type_node=new op_type_node(Operators.LogicalNOT); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKNOTEQUAL: - //'tkNotEqual' - { - op_type_node _op_type_node = new op_type_node(Operators.NotEqual); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKOF : - //'tkOf' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKOR : - //'tkOr' - - { - op_type_node _op_type_node=new op_type_node(Operators.LogicalOR); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKOTHERWISE: - //'tkOtherwise' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKPLUS : - //'tkPlus' - - { - op_type_node _op_type_node=new op_type_node(Operators.Plus); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - /*case (int)SymbolConstants.SYMBOL_TKPRINT : - //'tkPrint' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - }*/ - - case (int)SymbolConstants.SYMBOL_TKQUOTE: - //'tkQuote' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKREF : - //'tkRef' -return parsertools.create_directive_name(this); - case (int)SymbolConstants.SYMBOL_TKRETURN : - //'tkReturn' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKROUNDCLOSE : - //'tkRoundClose' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKROUNDOPEN : - //'tkRoundOpen' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSEMICOLON : - //'tkSemiColon' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSLASH : - //'tkSlash' - - { - op_type_node _op_type_node=new op_type_node(Operators.IntegerDivision); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKSPLIT : - //'tkSplit' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSQUARECLOSE : - //'tkSquareClose' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSQUAREOPEN : - //'tkSquareOpen' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSTAR : - //'tkStar' - - { - op_type_node _op_type_node=new op_type_node(Operators.Multiplication); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKSTRING : - //'tkString' -return parsertools.create_string_const(this); - case (int)SymbolConstants.SYMBOL_TKTHEN : - //'tkThen' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKWHERE : - //'tkWhere' - - { - //let_where_list_params.Clear(); - token_where = 1; - token_where_count++; - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_ADD_EXPR : - // - //TERMINAL:add_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ADDOP : - // - //TERMINAL:addop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_BODY : - // - //TERMINAL:body - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_BODY_FUNC : - // - //TERMINAL:body_func - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_BODY_WHERE: - // - //TERMINAL:body_where - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CASE_VARIANT : - // - //TERMINAL:case_variant - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CASE_VARIANTS : - // - //TERMINAL:case_variants - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONDITION: - // - //TERMINAL:condition - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONDITIONS: - // - //TERMINAL:conditions - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONDITIONS_COMMA: - // - //TERMINAL:conditions_comma - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CORTEG: - // - //TERMINAL:corteg - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_DEF_VAR : - // - //TERMINAL:def_var - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_DEF_VARS : - // - //TERMINAL:def_vars - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EMPTY : - // - //TERMINAL:empty - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPR : - // - //TERMINAL:expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_CALL : - // - //TERMINAL:func_call - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNCS : - // - //TERMINAL:funcs - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNCS_VARIANTS : - // - //TERMINAL:funcs_variants - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GENERATOR: - // - //TERMINAL:generator - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GENERATORS: - // - //TERMINAL:generators - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GUARD : - // - //TERMINAL:guard - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GUARD_BODY: - // - //TERMINAL:guard_body - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GUARD_BODY_LIST: - // - //TERMINAL:guard_body_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IMPORT : - // - //TERMINAL:import - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IMPORTS : - // - //TERMINAL:imports - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INFIX_EXPR: - // - //TERMINAL:infix_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INIT: - // - //TERMINAL:init - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INITS : - // - //TERMINAL:inits - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LAMBDA_FUNC : - // - //TERMINAL:lambda_func - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST : - // - //TERMINAL:list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST_CONSTRUCTOR: - // - //TERMINAL:list_constructor - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST_ELEMENTS : - // - //TERMINAL:list_elements - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIST_PARAM : - // - //TERMINAL:list_param - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MAIN_FUNC : - // - //TERMINAL:main_func - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MODULE : - // - //TERMINAL:module - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MULT_EXPR : - // - //TERMINAL:mult_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MULTOP : - // - //TERMINAL:multop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NEGATE_EXPR : - // - //TERMINAL:negate_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAM : - // - //TERMINAL:param - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAM_VALUE : - // - //TERMINAL:param_value - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAMS : - // - //TERMINAL:params - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAMS1: - // - //TERMINAL:params - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAMS_VALUE : - // - //TERMINAL:params_value - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_REFERENCE : - // - //TERMINAL:reference - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_EXPR : - // - //TERMINAL:simple_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_TYPE_EXPR: - // - //TERMINAL:simple_type_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STMT : - // - //TERMINAL:stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STMTS: - // - //TERMINAL:stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STMTS1 : - // - //TERMINAL:stmts - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIABLE : - // - //TERMINAL:variable - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIABLE_EXPR : - // - //TERMINAL:variable_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIANT : - // - //TERMINAL:variant - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIANTS : - // - //TERMINAL:variants - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_WHERE_VAR : - // - //TERMINAL:where_var - return null; - //ENDTERMINAL -} -throw new SymbolException("Unknown symbol"); -} - - - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateNonTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -public ArrayList param_value_list = new ArrayList(); -public ArrayList body_variant_list = new ArrayList(); -public ArrayList param_value_list_main = new ArrayList(); -public ArrayList body_variant_list_main = new ArrayList(); -public ArrayList guard_list = new ArrayList(); -public ArrayList guard_list_main = new ArrayList(); -public ArrayList func_name = new ArrayList(); -public int decls_counts = 0; -public bool where_flag = false; -public ArrayList list_param = new ArrayList(); -public ArrayList list_params = new ArrayList(); -public ArrayList list_params_temp = new ArrayList(); -public ArrayList list_params_main = new ArrayList(); -public ArrayList _function_lambda_definitions = new ArrayList(); -public ArrayList _function_lambda_definitions_after = new ArrayList(); -public int lambda_num = 0; -public ArrayList _functions = new ArrayList(); -public ArrayList list_method_calls = new ArrayList(); -public ArrayList list_method_calls_main = new ArrayList(); -public ArrayList list_return_funcs = new ArrayList(); -public ArrayList list_return_funcs_main = new ArrayList(); -public ArrayList list_params1 = new ArrayList(); -public ArrayList last_function_lambda_definitions = new ArrayList(); -public ArrayList last_list_method_calls = new ArrayList(); -public ArrayList last_list_method_calls_lambda = new ArrayList(); -public ArrayList let_fact_params = new ArrayList(); -public ArrayList let_funcs = new ArrayList(); -public ArrayList let_funcs_funcs = new ArrayList(); -public ArrayList let_func_last = new ArrayList(); -public ArrayList let_funcs1 = new ArrayList(); -public ArrayList let_flag = new ArrayList(); -public ArrayList where_funcs = new ArrayList(); -public ArrayList let_where_funcs = new ArrayList(); -public ArrayList let_where_funcs_main = new ArrayList(); -public ArrayList let_where_list_params = new ArrayList(); -int token_where = 0; -int token_where_count = 0; -public ArrayList last_where_funcs = new ArrayList(); -public struct types_param_lampda -{ - public string name; - public ArrayList types; -} -public ArrayList list_method_calls_lambda = new ArrayList(); -///////////////////////////// -public ArrayList lambda_funcs = new ArrayList(); -public ArrayList lambda_funcs_funcs = new ArrayList(); -///////////////////////////// -public ArrayList _function_lambda_definitions_main = new ArrayList(); -int token_let = 0; -public ArrayList let_stack = new ArrayList(); -public ArrayList lambda_stack = new ArrayList(); -int token_where1 = 0; -int bottom_num = 0; -int rec_num = 0; - -public Object CreateNonTerminalObject(int ReductionRuleIndex) -{ -switch (ReductionRuleIndex) -{ - case (int)RuleConstants.RULE_MODULE_TKMODULE_TKMAINIDENT_TKWHERE : - // ::= 'tkModule' 'tkMainIdent' 'tkWhere' -{ -ident_list _ident_list = new ident_list(); - _ident_list.idents.Add(new ident("LibForHaskell")); - unit_or_namespace _unit_or_namespace = new unit_or_namespace(_ident_list); - uses_list ul = (uses_list)LRParser.GetReductionSyntaxNode(4); - if (ul == null) - ul = new uses_list(); - ul.units.Insert(0, _unit_or_namespace); - //////////////// - declarations _defs = new declarations(); - for (int i = 0; i < _function_lambda_definitions.Count; i++) - _defs.defs.Add((declaration)lambda((function_lambda_definition)_function_lambda_definitions[i])); - for (int i = 0; i < _functions.Count; i++) - { - _defs.defs.Add((declaration)_functions[i]); - int k = 1; - while (k < _function_lambda_definitions_after.Count) - { - int j = k; - while (j < _function_lambda_definitions_after.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != (string)_function_lambda_definitions_after[j]) - j += 2; - if (j < _function_lambda_definitions_after.Count) - { - _defs.defs.Add((declaration)lambda((function_lambda_definition)_function_lambda_definitions_after[j - 1])); - _function_lambda_definitions_after.RemoveAt(j); - _function_lambda_definitions_after.RemoveAt(j - 1); - } - k = j; - } - } - int kk = 1; - while (kk < _function_lambda_definitions_after.Count) - { - int j = 0; - while (j < _defs.defs.Count && ((procedure_definition)_defs.defs[j]).proc_header.name.meth_name.name != (string)_function_lambda_definitions_after[kk]) - j++; - if (j < _defs.defs.Count) - { - _defs.defs.Insert(j+1, (declaration)lambda((function_lambda_definition)_function_lambda_definitions_after[kk - 1])); - _function_lambda_definitions_after.RemoveAt(kk); - _function_lambda_definitions_after.RemoveAt(kk - 1); - } - else - kk += 2; - } - - //for (int i = 0; i < _function_lambda_definitions.Count; i++) - //_defs.defs.Add(lambda((function_lambda_definition)_function_lambda_definitions[i])); - for (int i = 0; i < let_where_funcs.Count; i++) - _defs.defs.Add((procedure_definition)let_where_funcs[i]); - - block _block = new block(_defs, ((block)LRParser.GetReductionSyntaxNode(5)).program_code); - /////////////////////////////////////// - program_module _program_module = new program_module(null, ul, _block, null); - - _program_module.Language = LanguageId.PascalABCNET; - parsertools.create_source_context(_program_module, parsertools.sc_not_null(null, ul, null, LRParser.GetReductionSyntaxNode(5)), LRParser.GetReductionSyntaxNode(5)); - - _functions.Clear(); - _function_lambda_definitions.Clear(); - func_name.Clear(); - lambda_num = 0; - list_method_calls.Clear(); - list_method_calls_main.Clear(); - list_return_funcs.Clear(); - list_return_funcs_main.Clear(); - list_params1.Clear(); - list_method_calls_lambda.Clear(); - last_list_method_calls.Clear(); - last_list_method_calls_lambda.Clear(); - last_function_lambda_definitions.Clear(); - let_funcs1.Clear(); - let_funcs_funcs.Clear(); - let_func_last.Clear(); - let_flag.Clear(); - token_where_count = 0; - let_where_funcs_main.Clear(); - let_where_funcs.Clear(); - token_where = 0; - last_where_funcs.Clear(); - let_where_list_params.Clear(); - _function_lambda_definitions_main.Clear(); - let_stack.Clear(); - token_let = 0; - lambda_stack.Clear(); - - return _program_module; - } - case (int)RuleConstants.RULE_MODULE : - // ::= -{ - ident_list _ident_list = new ident_list(); - _ident_list.idents.Add(new ident("LibForHaskell")); - unit_or_namespace _unit_or_namespace = new unit_or_namespace(_ident_list); - uses_list ul = (uses_list)LRParser.GetReductionSyntaxNode(1); - if (ul == null) - ul = new uses_list(); - ul.units.Insert(0, _unit_or_namespace); - //////////////// - declarations _defs = new declarations(); - for (int i = 0; i < _function_lambda_definitions.Count; i++) - _defs.defs.Add((declaration)lambda((function_lambda_definition)_function_lambda_definitions[i])); - for (int i = 0; i < _functions.Count; i++) - { - _defs.defs.Add((declaration)_functions[i]); - int k = 1; - while (k < _function_lambda_definitions_after.Count) - { - int j = k; - while (j < _function_lambda_definitions_after.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != (string)_function_lambda_definitions_after[j]) - j += 2; - if (j < _function_lambda_definitions_after.Count) - { - _defs.defs.Add((declaration)lambda((function_lambda_definition)_function_lambda_definitions_after[j - 1])); - _function_lambda_definitions_after.RemoveAt(j); - _function_lambda_definitions_after.RemoveAt(j - 1); - } - k = j - 1; - } - } - int kk = 1; - while (kk < _function_lambda_definitions_after.Count) - { - int j = 0; - while (j < _defs.defs.Count && ((procedure_definition)_defs.defs[j]).proc_header.name.meth_name.name != (string)_function_lambda_definitions_after[kk]) - j++; - if (j < _defs.defs.Count) - { - _defs.defs.Insert(j + 1, (declaration)lambda((function_lambda_definition)_function_lambda_definitions_after[kk - 1])); - _function_lambda_definitions_after.RemoveAt(kk); - _function_lambda_definitions_after.RemoveAt(kk - 1); - } - else - kk += 2; - } - block _block = new block(_defs, ((block)LRParser.GetReductionSyntaxNode(2)).program_code); - /////////////////////////////// - program_module _program_module = new program_module(null, ul, (block)LRParser.GetReductionSyntaxNode(2), null); - - _program_module.Language = LanguageId.PascalABCNET; - parsertools.create_source_context(_program_module, parsertools.sc_not_null(null, ul, null, LRParser.GetReductionSyntaxNode(2)), LRParser.GetReductionSyntaxNode(2)); - - _functions.Clear(); - _function_lambda_definitions.Clear(); - func_name.Clear(); - lambda_num = 0; - list_method_calls.Clear(); - list_method_calls_main.Clear(); - list_return_funcs.Clear(); - list_return_funcs_main.Clear(); - list_params1.Clear(); - list_method_calls_lambda.Clear(); - last_list_method_calls.Clear(); - last_list_method_calls_lambda.Clear(); - last_function_lambda_definitions.Clear(); - let_funcs1.Clear(); - let_funcs_funcs.Clear(); - let_func_last.Clear(); - let_flag.Clear(); - let_where_funcs.Clear(); - token_where_count = 0; - let_where_funcs_main.Clear(); - let_where_funcs.Clear(); - token_where = 0; - last_where_funcs.Clear(); - let_where_list_params.Clear(); - _function_lambda_definitions_main.Clear(); - let_stack.Clear(); - lambda_stack.Clear(); - token_let = 0; - - return _program_module; - } - case (int)RuleConstants.RULE_MODULE_TKMODULE_TKIDENT_TKWHERE: -// ::= 'tkModule' 'tkIdent' 'tkWhere' -{ - ident_list _ident_list = new ident_list(); - _ident_list.idents.Add(new ident("LibForHaskell")); - unit_or_namespace _unit_or_namespace = new unit_or_namespace(_ident_list); - uses_list ul = (uses_list)LRParser.GetReductionSyntaxNode(4); - if (ul == null) - ul = new uses_list(); - ul.units.Insert(0, _unit_or_namespace); - //////////////// - declarations _defs = new declarations(); - for (int i = 0; i < _function_lambda_definitions.Count; i++) - _defs.defs.Add((declaration)lambda((function_lambda_definition)_function_lambda_definitions[i])); - for (int i = 0; i < _functions.Count; i++) - { - _defs.defs.Add((declaration)_functions[i]); - int k = 1; - while (k < _function_lambda_definitions_after.Count) - { - int j = k; - while (j < _function_lambda_definitions_after.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != (string)_function_lambda_definitions_after[j]) - j += 2; - if (j < _function_lambda_definitions_after.Count) - { - _defs.defs.Add((declaration)lambda((function_lambda_definition)_function_lambda_definitions_after[j - 1])); - _function_lambda_definitions_after.RemoveAt(j); - _function_lambda_definitions_after.RemoveAt(j - 1); - } - k = j; - } - } - int kk = 1; - while (kk < _function_lambda_definitions_after.Count) - { - int j = 0; - while (j < _defs.defs.Count && ((procedure_definition)_defs.defs[j]).proc_header.name.meth_name.name != (string)_function_lambda_definitions_after[kk]) - j++; - if (j < _defs.defs.Count) - { - _defs.defs.Insert(j + 1, (declaration)lambda((function_lambda_definition)_function_lambda_definitions_after[kk - 1])); - _function_lambda_definitions_after.RemoveAt(kk); - _function_lambda_definitions_after.RemoveAt(kk - 1); - } - else - kk += 2; - } - - //for (int i = 0; i < _function_lambda_definitions.Count; i++) - //_defs.defs.Add(lambda((function_lambda_definition)_function_lambda_definitions[i])); - for (int i = 0; i < let_where_funcs.Count; i++) - _defs.defs.Add((procedure_definition)let_where_funcs[i]); - - //////////////////////////interface - interface_node _interface_node = new interface_node(); - _interface_node.uses_modules = ul; - _interface_node.using_namespaces = null; - _interface_node.interface_definitions = LRParser.GetReductionSyntaxNode(5) as declarations; - ///////////////////////////unit_heading - unit_name _unit_name = new unit_name((ident)LRParser.GetReductionSyntaxNode(1), UnitHeaderKeyword.Unit); - initfinal_part _initfinal_part=new initfinal_part(); - unit_module _unit_module = new unit_module(_unit_name, _interface_node, null, _initfinal_part.initialization_sect, _initfinal_part.finalization_sect); - _unit_module.Language = LanguageId.PascalABCNET; - - _functions.Clear(); - _function_lambda_definitions.Clear(); - func_name.Clear(); - lambda_num = 0; - list_method_calls.Clear(); - list_method_calls_main.Clear(); - list_return_funcs.Clear(); - list_return_funcs_main.Clear(); - list_params1.Clear(); - list_method_calls_lambda.Clear(); - last_list_method_calls.Clear(); - last_list_method_calls_lambda.Clear(); - last_function_lambda_definitions.Clear(); - let_funcs1.Clear(); - let_funcs_funcs.Clear(); - let_func_last.Clear(); - let_flag.Clear(); - token_where_count = 0; - let_where_funcs_main.Clear(); - let_where_funcs.Clear(); - token_where = 0; - last_where_funcs.Clear(); - let_where_list_params.Clear(); - _function_lambda_definitions_main.Clear(); - let_stack.Clear(); - token_let = 0; - lambda_stack.Clear(); - - return _unit_module; -} - case (int)RuleConstants.RULE_REFERENCE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_REFERENCE_TKREF_TKSTRING : - // ::= 'tkRef' 'tkString' -{ - token_info t1 = new token_info(); - t1.text = ((ident)LRParser.GetReductionSyntaxNode(0)).name; - t1.source_context = ((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - token_info t2 = new token_info(); - t2.text = ((string_const)LRParser.GetReductionSyntaxNode(1)).Value; - t2.source_context = ((string_const)LRParser.GetReductionSyntaxNode(1)).source_context; - compiler_directive cd = new compiler_directive(t1, t2); - parsertools.create_source_context(cd, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - CompilerDirectives.Add(cd); - return null; - } - case (int)RuleConstants.RULE_IMPORTS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_IMPORTS2 : - // ::= -{ - uses_list _uses_list = new uses_list(); - - _uses_list.units.Add((unit_or_namespace)LRParser.GetReductionSyntaxNode(0)); - - return _uses_list; - } - case (int)RuleConstants.RULE_IMPORTS3: -// ::= -{ - uses_list _uses_list = (uses_list)LRParser.GetReductionSyntaxNode(0); - _uses_list.units.Add((unit_or_namespace)LRParser.GetReductionSyntaxNode(2)); - - return _uses_list; - } - case (int)RuleConstants.RULE_IMPORT_TKIMPORT_TKIDENT : - // ::= 'tkImport' 'tkIdent' -{ - ident_list _ident_list = new ident_list(); - _ident_list.source_context = ((ident)LRParser.GetReductionSyntaxNode(1)).source_context; - _ident_list.idents.Add((ident)LRParser.GetReductionSyntaxNode(1)); - - unit_or_namespace _unit_or_namespace = new unit_or_namespace(_ident_list); - parsertools.create_source_context(_unit_or_namespace,_ident_list, _ident_list); - - return _unit_or_namespace; - } - case (int)RuleConstants.RULE_BODY : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_BODY2 : - // ::= - - { - token_info _token_info = new token_info(";"); - - _token_info.source_context = parsertools.GetTokenSourceContext(); - - block _block = new block((declarations)LRParser.GetReductionSyntaxNode(0), ((block)LRParser.GetReductionSyntaxNode(1)).program_code); - - parsertools.create_source_context(_block, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0), ((block)LRParser.GetReductionSyntaxNode(1)).program_code), _token_info); - return _block; - } - - case (int)RuleConstants.RULE_FUNCS : - // ::= -{ - declarations _declarations = new declarations(); - ArrayList funcs = (ArrayList)LRParser.GetReductionSyntaxNode(0); - for (int i = 0;i < funcs.Count;i++) - { - _declarations.defs.Add((declaration)funcs[i]); - parsertools.create_source_context(_declarations, parsertools.sc_not_null(_declarations, (declaration)funcs[i]), (declaration)funcs[i]); - } - - param_value_list.Clear(); - param_value_list_main.Clear(); - body_variant_list.Clear(); - body_variant_list_main.Clear(); - guard_list.Clear(); - guard_list_main.Clear(); - list_params_main.Clear(); - list_params.Clear(); - list_param.Clear(); - list_params_temp.Clear(); - where_flag = false; - decls_counts = 0; - let_where_funcs.Clear(); - return _declarations; - } - case (int)RuleConstants.RULE_FUNCS_VARIANTS : - // ::= -{ -param_value_list_main.Add(param_value_list.Clone()); - body_variant_list_main.Add(body_variant_list.Clone()); - list_method_calls_main.Add(list_method_calls.Clone()); - guard_list_main.Add(guard_list.Clone()); - list_params_main.Add(list_params.Clone()); - list_params.Clear(); - - ArrayList funcs = new ArrayList(); - - for (int k = 0; k < func_name.Count; k++) - { - //////////////////////////head - - method_name _method_name = new method_name(null, (ident)func_name[k], null); - parsertools.create_source_context(_method_name, func_name[k], func_name[k]); - - function_header _function_header = new function_header(); - - object rt = new object(); - _function_header.name = _method_name; - if (_function_header.name.meth_name is template_type_name) - { - _function_header.template_args = (_function_header.name.meth_name as template_type_name).template_args; - ident id = new ident(_function_header.name.meth_name.name); - parsertools.create_source_context(id, _function_header.name.meth_name, _function_header.name.meth_name); - _function_header.name.meth_name = id; - } - ////////////////////////////////params - formal_parameters _formal_parametres = new formal_parameters(); - expression_list f = null; - if (((ArrayList)param_value_list_main[k])[0] != null) - { - f = (expression_list)((ArrayList)param_value_list_main[k])[((ArrayList)param_value_list_main[k]).Count - 1]; - string s = ""; - for (int i = 0; i < ((ArrayList)param_value_list_main[k]).Count; i++) - { - for (int j = 0; j < ((expression_list)((ArrayList)param_value_list_main[k])[i]).expressions.Count; j++) - if (((expression_list)((ArrayList)param_value_list_main[k])[i]).expressions[j] is ident) - s += ((ident)((expression_list)((ArrayList)param_value_list_main[k])[i]).expressions[j]).name; - } - for (int i = 0; i < ((expression_list)((ArrayList)param_value_list_main[k])[((ArrayList)param_value_list_main[k]).Count - 1]).expressions.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = new ident(s + i.ToString()); - _ident_list.source_context = id.source_context; - _ident_list.idents.Add(id); - named_type_reference _named_type_reference1 = new named_type_reference(); - - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference1, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference1); - - _formal_parametres.params_list.Add(_typed_parametres); - } - _function_header.parameters = _formal_parametres; - } - //////////////////////////type - { - named_type_reference _named_type_reference11 = new named_type_reference(); - ident idtype11 = new ident("datatype"); - _named_type_reference11.source_context = idtype11.source_context; - _named_type_reference11.names.Add(idtype11); - - rt = _named_type_reference11; - _function_header.return_type = (type_definition)_named_type_reference11; - } - - _function_header.of_object = false; - _function_header.class_keyword = false; - token_info _token_info = new token_info("function"); - _token_info.source_context = parsertools.GetTokenSourceContext(); - parsertools.create_source_context(_function_header, _token_info, rt); - - //////////////////////////////////////block - statement_list stmt_l = new statement_list(); - - statement last_if = null; - ArrayList vars = new ArrayList(); - if (((ArrayList)param_value_list_main[k])[0] != null) - { - bool flag = false; - for (int i = ((ArrayList)body_variant_list_main[k]).Count - 1; i >= 0; i--) - { - expression_list pv = (expression_list)((ArrayList)param_value_list_main[k])[i]; - statement body_part = (statement)((ArrayList)body_variant_list_main[k])[i]; - expression guard = null; - if (i < ((ArrayList)guard_list_main[k]).Count) - guard = (expression)((ArrayList)guard_list_main[k])[i]; - - if_node _if_node = new if_node(null, body_part, last_if); - parsertools.create_source_context(_if_node, null, parsertools.sc_not_null(body_part, last_if)); - - /////////// - named_type_reference _named_type_reference111 = new named_type_reference(); - - ident idtype111 = new ident("datatype"); - _named_type_reference111.source_context = idtype111.source_context; - _named_type_reference111.names.Add(idtype111); - - expression_list el = new expression_list(); - el.expressions.Add(new ident("true") as expression); - literal lt; - string text = "boolean"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - ///// - named_type_reference ntr = _named_type_reference111; - new_expr newexpr = new new_expr(ntr, el, false, null); - parsertools.create_source_context(newexpr, new ident("new"), parsertools.sc_not_null(el, _named_type_reference111)); - /////////// - expression last_expr = newexpr as expression; - if (guard != null) - last_expr = guard; - for (int j = 0; j < _function_header.parameters.params_list.Count; j++) - { - typed_parameters tp = (typed_parameters)_function_header.parameters.params_list[j]; - if (j < pv.expressions.Count && !(pv.expressions[j] is ident))//vstavka if (vyhod iz rekursii) - { - op_type_node _op_type_node = new op_type_node(Operators.Equal); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - bin_expr _bin_expr = new bin_expr(tp.idents.idents[0] as expression, (expression)pv.expressions[j], _op_type_node.type); - parsertools.create_source_context(_bin_expr, tp.idents.idents[0], pv.expressions[j]); - - op_type_node _op_type_node1 = new op_type_node(Operators.LogicalAND); - _op_type_node1.source_context = parsertools.GetTokenSourceContext(); - bin_expr _bin_expr1 = new bin_expr(_bin_expr, last_expr, _op_type_node1.type); - parsertools.create_source_context(_bin_expr1, _bin_expr, last_expr); - last_expr = _bin_expr1; - } - } - _if_node.condition = _ob(last_expr); - ////novye peremennye - statement_list _ass = new statement_list(); - for (int j = 0; j < _function_header.parameters.params_list.Count; j++) - { - if (j < pv.expressions.Count && pv.expressions[j] is ident && ((ident)pv.expressions[j]).name != _function_header.parameters.params_list[j].idents.idents[0].name) - { - ident_list il = new ident_list(); - il.idents.Add(new ident(((ident)pv.expressions[j]).name)); - method_call mc = find_method_call(((ident)pv.expressions[j]).name, k); - if (mc == null) - { - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - - var_def_statement _var_def_statement = new var_def_statement(il, (type_definition)_named_type_reference1, null, definition_attribute.None, false); - parsertools.create_source_context(_var_def_statement, il, _named_type_reference1); - var_statement _var_statement = new var_statement(_var_def_statement); - parsertools.create_source_context(_var_statement, null, _var_def_statement); - //((statement_list)_if_node.then_body).subnodes.Insert(0, _var_statement);//obyavlenie peremennoy - int ii = ((ArrayList)body_variant_list_main[k]).Count - 1; - int jj = 0; - bool b = false; - expression_list exl = (expression_list)((ArrayList)param_value_list_main[k])[ii]; - while (ii > i && !b) - { - jj = 0; - while (jj < exl.expressions.Count && (!(exl.expressions[jj] is ident) || ((ident)exl.expressions[jj]).name != ((ident)pv.expressions[j]).name)) - jj++; - if (jj < exl.expressions.Count) - b = true; - ii--; - if (ii > i) - exl = (expression_list)((ArrayList)param_value_list_main[k])[ii]; - } - if (!b) - { - int kk = 0; - while (kk < vars.Count && il.idents[0].name != ((var_statement)vars[kk]).var_def.vars.idents[0].name) - kk++; - if (kk >= vars.Count) - vars.Add(_var_statement); - } - } - else - { - bool b = false; - int ii = ((ArrayList)body_variant_list_main[k]).Count - 1; - int jj = 0; - expression_list exl = (expression_list)((ArrayList)param_value_list_main[k])[ii]; - while (ii > i && !b) - { - jj = 0; - while (jj < exl.expressions.Count && (!(exl.expressions[jj] is ident) || ((ident)exl.expressions[jj]).name != ((ident)pv.expressions[j]).name)) - jj++; - if (jj < exl.expressions.Count) - b = true; - ii--; - if (ii > i) - exl = (expression_list)((ArrayList)param_value_list_main[k])[ii]; - } - if (!b) - { - _function_header.parameters.params_list[j].vars_type = func_type(mc.parameters.expressions.Count); - stmt_l.subnodes.Add(var_st(((ident)pv.expressions[j]).name, func_type(mc.parameters.expressions.Count))); - } - } - - op_type_node _op_type_node2 = new op_type_node(Operators.Assignment); - _op_type_node2.source_context = parsertools.GetTokenSourceContext(); - assign _assign = new assign(il.idents[0] as addressed_value, _function_header.parameters.params_list[j].idents.idents[0] as expression, _op_type_node2.type); - parsertools.create_source_context(_assign, il.idents[0], _function_header.parameters.params_list[j].idents.idents[0]); - _ass.subnodes.Add(_assign); - } - } - - ///////////////////////////////////////list_param - if (((ArrayList)list_params_main[k]).Count != 0 && i < ((ArrayList)list_params_main[k]).Count) - { - for (int ll = 0; ll < ((ArrayList)((ArrayList)list_params_main[k])[i]).Count; ll++) - { - //if (i == ((ArrayList)body_variant_list_main[k]).Count - 1) - for (int l = 0; l < ((ArrayList)((ArrayList)((ArrayList)list_params_main[k])[i])[ll]).Count; l++) - { - ident_list il1 = new ident_list(); - il1.idents.Add(new ident(((ident)((ArrayList)((ArrayList)((ArrayList)list_params_main[k])[i])[ll])[l]).name)); - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.names.Add(idtype1); - - var_def_statement _var_def_statement = new var_def_statement(il1, (type_definition)_named_type_reference1, null, definition_attribute.None, false); - parsertools.create_source_context(_var_def_statement, il1, _named_type_reference1); - var_statement _var_statement = new var_statement(_var_def_statement); - //stmt_l.subnodes.Add(_var_statement); - int j = 0; - while (j < vars.Count && il1.idents[0].name != ((var_statement)vars[j]).var_def.vars.idents[0].name) - j++; - if (j >= vars.Count) - vars.Add(_var_statement); - } - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - dot_node _dot_node = new dot_node(null, (addressed_value)(new ident("head"))); - ident id = new ident(); - for (int i1 = 0; i1 < ((ArrayList)((ArrayList)((ArrayList)list_params_main[k])[i])[ll]).Count; i1++) - id.name += ((ident)((ArrayList)((ArrayList)((ArrayList)list_params_main[k])[i])[ll])[i1]).name; - if (id.name != null) - { - _dot_node.left = (addressed_value)(id); - object o = null; - method_call _method_call = new method_call(o as expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_dot_node; - assign _assign1 = new assign(((ident)((ArrayList)((ArrayList)((ArrayList)list_params_main[k])[i])[ll])[((ArrayList)((ArrayList)((ArrayList)list_params_main[k])[i])[ll]).Count - 1]) as addressed_value, _method_call as expression, _op_type_node.type); - _ass.subnodes.Add(_assign1); - - /// - for (int i1 = ((ArrayList)((ArrayList)((ArrayList)list_params_main[k])[i])[ll]).Count - 2; i1 > 0; i1--) - { - _dot_node = new dot_node((addressed_value)id, (addressed_value)(new ident("tail"))); - for (int j1 = 0; j1 < ((ArrayList)((ArrayList)((ArrayList)list_params_main[k])[i])[ll]).Count - 2 - i1; j1++) - { - _dot_node = new dot_node(_dot_node, (addressed_value)(new ident("tail"))); - } - _dot_node = new dot_node(_dot_node, (addressed_value)(new ident("head"))); - - _method_call = new method_call(o as expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_dot_node; - _assign1 = new assign(((ident)((ArrayList)((ArrayList)((ArrayList)list_params_main[k])[i])[ll])[i1]) as addressed_value, _method_call as expression, _op_type_node.type); - _ass.subnodes.Add(_assign1); - } - - _dot_node = new dot_node((addressed_value)id, (addressed_value)(new ident("tail"))); - - for (int j1 = 0; j1 < ((ArrayList)((ArrayList)((ArrayList)list_params_main[k])[i])[ll]).Count - 2; j1++) - { - _dot_node = new dot_node(_dot_node, (addressed_value)(new ident("tail"))); - } - _method_call = new method_call(o as expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_dot_node; - _assign1 = new assign(((ident)((ArrayList)((ArrayList)((ArrayList)list_params_main[k])[i])[ll])[0]) as addressed_value, _method_call as expression, _op_type_node.type); - _ass.subnodes.Add(_assign1); - } - } - } - /////////////////////////////////////////////////////////////////////// - parsertools.create_source_context(_if_node, null, _if_node); - last_if = new statement_list(); - for (int ii = 0; ii < _ass.subnodes.Count; ii++) - ((statement_list)last_if).subnodes.Add((assign)_ass.subnodes[ii]); - - ((statement_list)last_if).subnodes.Add(_if_node); - } - stmt_l.subnodes.Add(last_if); - } - else - { - stmt_l.subnodes.Add((statement)((ArrayList)body_variant_list_main[k])[0]); - } - - ////////////////// - - block _block = new block(null, null); - _block.defs = new declarations(); - for (int l = 0; l < vars.Count; l++) - _block.defs.defs.Add(vars[l] as var_statement); - - statement_list sl = null; - if (stmt_l is statement_list) - sl = stmt_l as statement_list; - else - { - sl = new statement_list(); - sl.subnodes.Add(stmt_l as statement); - if (!(stmt_l is empty_statement)) - parsertools.assign_source_context(sl, stmt_l); - } - _block.program_code = sl; - ////////////////// - ArrayList lamdas = find_lambda_funcs_main(_function_header.name.meth_name.name); - for (int l = 0; l < lamdas.Count; l++) - _block.defs.defs.Add(lambda((function_lambda_definition)lamdas[l])); - ////////////////// - int r = 0; - while (r < let_funcs_funcs.Count && ((string)((ArrayList)let_funcs_funcs[r])[0]) != _function_header.name.meth_name.name) - r++; - if (r < let_funcs_funcs.Count) - { - if (_block.defs == null) - _block.defs = new declarations(); - for (int l = 0; l < ((ArrayList)((ArrayList)let_funcs_funcs[r])[1]).Count; l++) - _block.defs.defs.Add(((ArrayList)((ArrayList)let_funcs_funcs[r])[1])[l] as procedure_definition); - } - let_funcs.Clear(); - ////////////////// - procedure_definition _procedure_definition = new procedure_definition(_function_header, null); - rt = _function_header; - if (_block != null) - { - rt = _block; - if (_block is proc_block) - _procedure_definition.proc_body = (proc_block)_block; - } - parsertools.create_source_context(_procedure_definition, _function_header, rt); - funcs.Add(_procedure_definition); - _functions.Add(_procedure_definition); - } - return funcs;} - case (int)RuleConstants.RULE_VARIANTS : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIANTS2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIANT_TKIDENT: -// ::= 'tkIdent' -{ - ArrayList body_list = (ArrayList)LRParser.GetReductionSyntaxNode(2); - for (int g_ind = 0; g_ind < body_list.Count; g_ind++) - { - ///////////////////////////////////body - statement_list st = null; - - statement_list body_1 = (statement_list)((ArrayList)body_list[g_ind])[1]; - - if (LRParser.GetReductionSyntaxNode(3) != null) - { - ArrayList ar = (ArrayList)LRParser.GetReductionSyntaxNode(3); - for (int ii = 0; ii < ar.Count; ii++) - where_funcs.Add(ar[ii]); - - statement_list _statement_list = body_1; - //////////////////////////////////////////////for guard - formal_parameters _formal_parametres = null; - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = null; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = null; - _procedure_definition.lambda_name = "__lam_where__" + lambda_num; - //new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, null, null, null, "lambda_where" + lambda_num); - _procedure_definition.proc_body = _statement_list; - procedure_definition pr = lambda(_procedure_definition); - //_function_lambda_definitions.Add(_procedure_definition);//////////////// - ((block)pr.proc_body).defs = new declarations(); - int start = 0; - int k = where_funcs.Count - 1; - while (k > 0 && ((procedure_definition)where_funcs[k]).proc_header.name.meth_name.name.Contains("__lambda__")) - k--; - int kk = 0; - while (k > 0 && kk < ar.Count - 1 && !((procedure_definition)where_funcs[k]).proc_header.name.meth_name.name.Contains("__lambda__")) - { - k--; - kk++; - } - start = k; - int i = start; - int n = where_funcs.Count; - if (start >= 0) - while (i < n) - { - ((block)pr.proc_body).defs.defs.Add((procedure_definition)where_funcs[start]); - where_funcs.RemoveAt(start); - i++; - } - /////////////////////////////////lambda - if (lambda_stack.Count > 0 && ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count == 0) - lambda_stack.RemoveAt(lambda_stack.Count - 1); - if (lambda_stack.Count > 0) - { - if (((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count > 0) - { - if (((block)pr.proc_body).defs == null) - ((block)pr.proc_body).defs = new declarations(); - for (int ii = 0; ii < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; ii++) - ((block)pr.proc_body).defs.defs.Add((procedure_definition)((ArrayList)lambda_stack[lambda_stack.Count - 1])[ii]); - for (int ii = 0; ii < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; ii++) - _function_lambda_definitions.RemoveAt(_function_lambda_definitions.Count - 1); - } - //lambda_stack.RemoveAt(lambda_stack.Count - 1); - } - ////////////////////////////////// - where_funcs.Add(pr); - //if (let_flag.Count > 0) - //let_func_last.Add(pr); - expression_list el = new expression_list(); - //where_fact_params.Clear(); - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - assign _assign = new assign((addressed_value)new ident("result"), new ident(_procedure_definition.lambda_name), Operators.Assignment); - - statement_list _statement_list1 = new statement_list(); - _statement_list1.subnodes.Add(_assign); - st = _statement_list1; - } - else - { - //////////////////////////////////////////////for guard - st = body_1; - } - ///////////////////////////////////\body - - - ////////////////////////////////////////////////////for let & where - let_where_funcs.Clear(); - while (let_where_funcs_main.Count > 1) - let_where_funcs_main.RemoveAt(let_where_funcs_main.Count - 1); - list_params1.Clear(); - let_flag.Clear(); - int iiii = 0; - while (iiii < func_name.Count && ((ident)func_name[iiii]).name != ((ident)LRParser.GetReductionSyntaxNode(0)).name) - iiii++; - if (iiii == func_name.Count && let_funcs_funcs.Count == 0 || (let_funcs_funcs.Count > 0 && ((string)((ArrayList)let_funcs_funcs[let_funcs_funcs.Count - 1])[0]) != ((ident)LRParser.GetReductionSyntaxNode(0)).name)) - { - ArrayList ar = new ArrayList(); - ar.Add(((ident)LRParser.GetReductionSyntaxNode(0)).name); - if (where_funcs.Count > 0) - { - for (int i = 0; i < let_funcs.Count; i++) - ((block)((procedure_definition)where_funcs[0]).proc_body).defs.defs.Add((procedure_definition)let_funcs[i]); - ar.Add(where_funcs.Clone()); - } - else - ar.Add(let_funcs.Clone()); - let_funcs_funcs.Add(ar); - let_funcs.Clear(); - where_funcs.Clear(); - let_func_last.Clear(); - } - else - { - int r = 0; - while (r < let_funcs_funcs.Count && ((string)((ArrayList)let_funcs_funcs[r])[0]) != - ((ident)LRParser.GetReductionSyntaxNode(0)).name) - r++; - if (r < let_funcs_funcs.Count) - { - if (where_funcs.Count > 0) - { - for (int i = 0; i < let_funcs.Count; i++) - ((block)((procedure_definition)where_funcs[0]).proc_body).defs.defs.Add((procedure_definition)let_funcs[i]); - for (int i = 0; i < where_funcs.Count; i++) - ((ArrayList)((ArrayList)let_funcs_funcs[r])[1]).Add(where_funcs[i]); - } - else - for (int i = 0; i < let_funcs.Count; i++) - ((ArrayList)((ArrayList)let_funcs_funcs[r])[1]).Add(let_funcs[i]); - let_funcs.Clear(); - where_funcs.Clear(); - let_func_last.Clear(); - } - } - - if (iiii == func_name.Count) - { - ///////////////////////////////////////////////////// - ArrayList ar_lambda = new ArrayList(); - ar_lambda.Add(((ident)LRParser.GetReductionSyntaxNode(0)).name); - ar_lambda.Add(_function_lambda_definitions.Clone()); - _function_lambda_definitions_main.Add(ar_lambda.Clone()); - _function_lambda_definitions.Clear(); - ///////////////////////////////////////////////////// - } - else - { - ////////////////////////////////// - ArrayList ar_lambda = (ArrayList)_function_lambda_definitions.Clone(); - for (int i = 0; i < ar_lambda.Count; i++) - ((ArrayList)((ArrayList)_function_lambda_definitions_main[_function_lambda_definitions_main.Count - 1])[1]).Add(ar_lambda[i]); - _function_lambda_definitions.Clear(); - ////////////////////////////////// - } - //////////////////////////////////////////////////// - - if (st/* LRParser.GetReductionSyntaxNode(2)*/ != null) - { - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != ((ident)LRParser.GetReductionSyntaxNode(0)).name) - i++; - if (i == func_name.Count) - { - func_name.Add((ident)LRParser.GetReductionSyntaxNode(0)); - list_return_funcs_main.Add(list_return_funcs.Clone()); - list_return_funcs.Clear(); - if (list_method_calls_main.Count > 0) - for (int iii = 0; iii < ((ArrayList)list_method_calls_main[list_method_calls_main.Count - 1]).Count; iii++) - if (list_method_calls.Count > 0) - list_method_calls.RemoveAt(0); - list_method_calls_main.Add(list_method_calls.Clone()); - if (param_value_list.Count != 0) - { - param_value_list_main.Add(param_value_list.Clone()); - body_variant_list_main.Add(body_variant_list.Clone()); - guard_list_main.Add(guard_list.Clone()); - list_params_main.Add(list_params.Clone()); - } - param_value_list.Clear(); - body_variant_list.Clear(); - guard_list.Clear(); - list_params.Clear(); - param_value_list.Add(LRParser.GetReductionSyntaxNode(1)); - ////////////////Dobavlyaem formalnye parametry - //statement_list st = (statement_list)LRParser.GetReductionSyntaxNode(4); - if (st.subnodes[0] is assign) - { - if (((assign)st.subnodes[0]).from is function_lambda_call) - { - function_lambda_call flc = (function_lambda_call)(((assign)st.subnodes[0]).from); - function_lambda_definition fld = ((function_lambda_call)(((assign)st.subnodes[0]).from)).f_lambda_def; - for (int ind = flc.parameters.expressions.Count; ind < fld.parameters.expressions.Count; ind++) - { - if (param_value_list.Count == 0) - param_value_list.Add(new expression_list()); - if (param_value_list[param_value_list.Count - 1] == null) - param_value_list[param_value_list.Count - 1] = new expression_list(); - ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Add(fld.parameters.expressions[ind]); - } - } - if (((assign)st.subnodes[0]).from is method_call) - { - method_call mc = (method_call)(((assign)st.subnodes[0]).from); - int jjj = 0; - int ind_null = -1; - while (jjj < mc.parameters.expressions.Count) - if (mc.parameters.expressions[jjj] is new_expr && ((new_expr)mc.parameters.expressions[jjj]).params_list.expressions[0] is string_const && - ((string_const)((new_expr)mc.parameters.expressions[jjj]).params_list.expressions[0]).Value == "$null") - { - ind_null = jjj; - jjj = mc.parameters.expressions.Count; - } - else - jjj++; - if (ind_null >= 0) - for (int ind = ind_null; ind < mc.parameters.expressions.Count; ind++) - { - //int j = 0; - //while () - if (param_value_list.Count == 0) - param_value_list.Add(new expression_list()); - if (param_value_list[param_value_list.Count - 1] == null) - param_value_list[param_value_list.Count - 1] = new expression_list(); - ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Add(new ident("$param" + ind)); - ((method_call)(((assign)st.subnodes[0]).from)).parameters.expressions.Insert(ind, new ident("$param" + ind)); - ((method_call)(((assign)st.subnodes[0]).from)).parameters.expressions.RemoveAt(ind + 1); - } - } - } - //////////////// - body_variant_list.Add(st); - //guard_list.Add(LRParser.GetReductionSyntaxNode(2)); - guard_list.Add(((ArrayList)body_list[g_ind])[0]); - if (list_params_temp.Count != 0) - { - list_params.Add(list_params_temp.Clone()); - list_params_temp.Clear(); - } - } - else - { - ArrayList ar = (ArrayList)list_method_calls.Clone(); - for (int iii = 0; iii < list_method_calls.Count; iii++) - ((ArrayList)list_method_calls_main[list_method_calls_main.Count - 1]).Add(ar[iii]); - param_value_list.Add(LRParser.GetReductionSyntaxNode(1)); - ////////////////Dobavlyaem formalnye parametry - //statement_list st = (statement_list)LRParser.GetReductionSyntaxNode(4); - if (st.subnodes[0] is assign) - { - if (((assign)st.subnodes[0]).from is function_lambda_call) - { - function_lambda_call flc = (function_lambda_call)(((assign)st.subnodes[0]).from); - function_lambda_definition fld = ((function_lambda_call)(((assign)st.subnodes[0]).from)).f_lambda_def; - for (int ind = flc.parameters.expressions.Count; ind < fld.parameters.expressions.Count; ind++) - { - if (param_value_list.Count == 0) - param_value_list.Add(new expression_list()); - if (param_value_list[param_value_list.Count - 1] == null) - param_value_list[param_value_list.Count - 1] = new expression_list(); - ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Add(fld.parameters.expressions[ind]); - } - } - if (((assign)st.subnodes[0]).from is method_call) - { - method_call mc = (method_call)(((assign)st.subnodes[0]).from); - int jjj = 0; - int ind_null = -1; - while (jjj < mc.parameters.expressions.Count) - if (mc.parameters.expressions[jjj] is new_expr && ((new_expr)mc.parameters.expressions[jjj]).params_list.expressions[0] is string_const && - ((string_const)((new_expr)mc.parameters.expressions[jjj]).params_list.expressions[0]).Value == "$null") - { - ind_null = jjj; - jjj = mc.parameters.expressions.Count; - } - else - jjj++; - if (ind_null >= 0) - for (int ind = ind_null; ind < mc.parameters.expressions.Count; ind++) - { - if (param_value_list.Count == 0) - param_value_list.Add(new expression_list()); - if (param_value_list[param_value_list.Count - 1] == null) - param_value_list[param_value_list.Count - 1] = new expression_list(); - ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Add(new ident("$param" + ind)); - ((method_call)(((assign)st.subnodes[0]).from)).parameters.expressions.Insert(ind, new ident("$param" + ind)); - ((method_call)(((assign)st.subnodes[0]).from)).parameters.expressions.RemoveAt(ind + 1); - } - } - } - //////////////// - body_variant_list.Add(st); - //guard_list.Add(LRParser.GetReductionSyntaxNode(2)); - guard_list.Add(((ArrayList)body_list[g_ind])[0]); - if (list_params_temp.Count != 0) - { - list_params.Add(list_params_temp.Clone()); - list_params_temp.Clear(); - } - } - } - else - { - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != ((ident)LRParser.GetReductionSyntaxNode(0)).name) - i++; - if (i == func_name.Count) - { - func_name.Add((ident)LRParser.GetReductionSyntaxNode(0)); - } - } - list_params1.Clear(); - //int kk = last_list_method_calls.Count; - //kk = last_function_lambda_definitions.Count; - for (int i = 0; i < last_function_lambda_definitions.Count; i++) - { - for (int j = 0; j < ((function_lambda_definition)last_function_lambda_definitions[i]).formal_parameters.params_list.Count; j++) - { - string name_param = ((function_lambda_definition)last_function_lambda_definitions[i]).formal_parameters.params_list[j].idents.idents[0].name; - int k = 0; - while (k < last_list_method_calls.Count && ((ident)((method_call)last_list_method_calls[k]).dereferencing_value).name != name_param) - k++; - if (k < last_list_method_calls.Count) - { - function_lambda_definition fld = find_func_lambda_after(((function_lambda_definition)last_function_lambda_definitions[i]).lambda_name); - fld.formal_parameters.params_list[j].vars_type = func_type(((method_call)last_list_method_calls[k]).parameters.expressions.Count); - } - } - } - last_list_method_calls.Clear(); - last_function_lambda_definitions.Clear(); - } - return null; -} - case (int)RuleConstants.RULE_VARIANT_TKQUOTE_TKIDENT_TKQUOTE: -// ::= 'tkQuote' 'tkIdent' 'tkQuote' -{ - ArrayList body_list = (ArrayList)LRParser.GetReductionSyntaxNode(5); - for (int g_ind = 0; g_ind < body_list.Count; g_ind++) - { - ///////////////////////////////////body - statement_list st = null; - - statement_list body_1 = (statement_list)((ArrayList)body_list[g_ind])[1]; - - if (LRParser.GetReductionSyntaxNode(6) != null) - { - ArrayList ar = (ArrayList)LRParser.GetReductionSyntaxNode(6); - for (int ii = 0; ii < ar.Count; ii++) - where_funcs.Add(ar[ii]); - - statement_list _statement_list = body_1; - //////////////////////////////////////////////for guard - formal_parameters _formal_parametres = null; - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = null; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = null; - _procedure_definition.lambda_name = "__lam_where__" + lambda_num; - //new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, null, null, null, "lambda_where" + lambda_num); - _procedure_definition.proc_body = _statement_list; - procedure_definition pr = lambda(_procedure_definition); - //_function_lambda_definitions.Add(_procedure_definition);//////////////// - ((block)pr.proc_body).defs = new declarations(); - int start = 0; - int k = where_funcs.Count - 1; - while (k > 0 && ((procedure_definition)where_funcs[k]).proc_header.name.meth_name.name.Contains("__lambda__")) - k--; - int kk = 0; - while (k > 0 && kk < ar.Count - 1 && !((procedure_definition)where_funcs[k]).proc_header.name.meth_name.name.Contains("__lambda__")) - { - k--; - kk++; - } - start = k; - int i = start; - int n = where_funcs.Count; - if (start >= 0) - while (i < n) - { - ((block)pr.proc_body).defs.defs.Add((procedure_definition)where_funcs[start]); - where_funcs.RemoveAt(start); - i++; - } - /////////////////////////////////lambda - if (lambda_stack.Count > 0 && ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count == 0) - lambda_stack.RemoveAt(lambda_stack.Count - 1); - if (lambda_stack.Count > 0) - { - if (((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count > 0) - { - if (((block)pr.proc_body).defs == null) - ((block)pr.proc_body).defs = new declarations(); - for (int ii = 0; ii < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; ii++) - ((block)pr.proc_body).defs.defs.Add((procedure_definition)((ArrayList)lambda_stack[lambda_stack.Count - 1])[ii]); - for (int ii = 0; ii < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; ii++) - _function_lambda_definitions.RemoveAt(_function_lambda_definitions.Count - 1); - } - //lambda_stack.RemoveAt(lambda_stack.Count - 1); - } - ////////////////////////////////// - where_funcs.Add(pr); - //if (let_flag.Count > 0) - //let_func_last.Add(pr); - expression_list el = new expression_list(); - //where_fact_params.Clear(); - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - assign _assign = new assign((addressed_value)new ident("result"), new ident(_procedure_definition.lambda_name), Operators.Assignment); - - statement_list _statement_list1 = new statement_list(); - _statement_list1.subnodes.Add(_assign); - st = _statement_list1; - } - else - { - //////////////////////////////////////////////for guard - st = body_1; - } - ///////////////////////////////////\body - - ident _ident = (ident)LRParser.GetReductionSyntaxNode(2); - expression_list _ex_l1 = (expression_list)LRParser.GetReductionSyntaxNode(0); - expression_list _ex_l2 = (expression_list)LRParser.GetReductionSyntaxNode(4); - for (int i = 0; i < _ex_l2.expressions.Count; i++) - _ex_l1.expressions.Add(_ex_l2.expressions[i]); - - ////////////////////////////////////////////////////for let & where - let_where_funcs.Clear(); - while (let_where_funcs_main.Count > 1) - let_where_funcs_main.RemoveAt(let_where_funcs_main.Count - 1); - list_params1.Clear(); - let_flag.Clear(); - int iiii = 0; - while (iiii < func_name.Count && ((ident)func_name[iiii]).name != _ident.name) - iiii++; - if (iiii == func_name.Count && let_funcs_funcs.Count == 0 || (let_funcs_funcs.Count > 0 && ((string)((ArrayList)let_funcs_funcs[let_funcs_funcs.Count - 1])[0]) != _ident.name)) - { - ArrayList ar = new ArrayList(); - ar.Add(_ident.name); - if (where_funcs.Count > 0) - { - for (int i = 0; i < let_funcs.Count; i++) - ((block)((procedure_definition)where_funcs[0]).proc_body).defs.defs.Add((procedure_definition)let_funcs[i]); - ar.Add(where_funcs.Clone()); - } - else - ar.Add(let_funcs.Clone()); - let_funcs_funcs.Add(ar); - let_funcs.Clear(); - where_funcs.Clear(); - let_func_last.Clear(); - } - else - { - int r = 0; - while (r < let_funcs_funcs.Count && ((string)((ArrayList)let_funcs_funcs[r])[0]) != - _ident.name) - r++; - if (r < let_funcs_funcs.Count) - { - if (where_funcs.Count > 0) - { - for (int i = 0; i < let_funcs.Count; i++) - ((block)((procedure_definition)where_funcs[0]).proc_body).defs.defs.Add((procedure_definition)let_funcs[i]); - for (int i = 0; i < where_funcs.Count; i++) - ((ArrayList)((ArrayList)let_funcs_funcs[r])[1]).Add(where_funcs[i]); - } - else - for (int i = 0; i < let_funcs.Count; i++) - ((ArrayList)((ArrayList)let_funcs_funcs[r])[1]).Add(let_funcs[i]); - let_funcs.Clear(); - where_funcs.Clear(); - let_func_last.Clear(); - } - } - - if (iiii == func_name.Count) - { - ///////////////////////////////////////////////////// - ArrayList ar_lambda = new ArrayList(); - ar_lambda.Add(_ident.name); - ar_lambda.Add(_function_lambda_definitions.Clone()); - _function_lambda_definitions_main.Add(ar_lambda.Clone()); - _function_lambda_definitions.Clear(); - ///////////////////////////////////////////////////// - } - else - { - ////////////////////////////////// - ArrayList ar_lambda = (ArrayList)_function_lambda_definitions.Clone(); - for (int i = 0; i < ar_lambda.Count; i++) - ((ArrayList)((ArrayList)_function_lambda_definitions_main[_function_lambda_definitions_main.Count - 1])[1]).Add(ar_lambda[i]); - _function_lambda_definitions.Clear(); - ////////////////////////////////// - } - //////////////////////////////////////////////////// - - if (st/*LRParser.GetReductionSyntaxNode(7)*/ != null) - { - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != _ident.name) - i++; - if (i == func_name.Count) - { - func_name.Add(_ident); - list_return_funcs_main.Add(list_return_funcs.Clone()); - list_return_funcs.Clear(); - if (list_method_calls_main.Count > 0) - for (int iii = 0; iii < ((ArrayList)list_method_calls_main[list_method_calls_main.Count - 1]).Count; iii++) - if (list_method_calls.Count > 0) - list_method_calls.RemoveAt(0); - list_method_calls_main.Add(list_method_calls.Clone()); - if (param_value_list.Count != 0) - { - param_value_list_main.Add(param_value_list.Clone()); - body_variant_list_main.Add(body_variant_list.Clone()); - guard_list_main.Add(guard_list.Clone()); - list_params_main.Add(list_params.Clone()); - } - param_value_list.Clear(); - body_variant_list.Clear(); - guard_list.Clear(); - list_params.Clear(); - param_value_list.Add(_ex_l1); - ////////////////Dobavlyaem formalnye parametry - //statement_list st = (statement_list)LRParser.GetReductionSyntaxNode(7); - if (st.subnodes[0] is assign) - { - if (((assign)st.subnodes[0]).from is function_lambda_call) - { - function_lambda_call flc = (function_lambda_call)(((assign)st.subnodes[0]).from); - function_lambda_definition fld = ((function_lambda_call)(((assign)st.subnodes[0]).from)).f_lambda_def; - for (int ind = flc.parameters.expressions.Count; ind < fld.parameters.expressions.Count; ind++) - { - if (param_value_list.Count == 0) - param_value_list.Add(new expression_list()); - if (param_value_list[param_value_list.Count - 1] == null) - param_value_list[param_value_list.Count - 1] = new expression_list(); - ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Add(fld.parameters.expressions[ind]); - } - } - if (((assign)st.subnodes[0]).from is method_call) - { - method_call mc = (method_call)(((assign)st.subnodes[0]).from); - int jjj = 0; - int ind_null = -1; - while (jjj < mc.parameters.expressions.Count) - if (mc.parameters.expressions[jjj] is new_expr && ((new_expr)mc.parameters.expressions[jjj]).params_list.expressions[0] is string_const && - ((string_const)((new_expr)mc.parameters.expressions[jjj]).params_list.expressions[0]).Value == "$null") - { - ind_null = jjj; - jjj = mc.parameters.expressions.Count; - } - else - jjj++; - if (ind_null >= 0) - for (int ind = ind_null; ind < mc.parameters.expressions.Count; ind++) - { - //int j = 0; - //while () - if (param_value_list.Count == 0) - param_value_list.Add(new expression_list()); - if (param_value_list[param_value_list.Count - 1] == null) - param_value_list[param_value_list.Count - 1] = new expression_list(); - ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Add(new ident("$param" + ind)); - ((method_call)(((assign)st.subnodes[0]).from)).parameters.expressions.Insert(ind, new ident("$param" + ind)); - ((method_call)(((assign)st.subnodes[0]).from)).parameters.expressions.RemoveAt(ind + 1); - } - } - } - //////////////// - body_variant_list.Add(st); - //guard_list.Add(LRParser.GetReductionSyntaxNode(5)); - guard_list.Add(((ArrayList)body_list[g_ind])[0]); - if (list_params_temp.Count != 0) - { - list_params.Add(list_params_temp.Clone()); - list_params_temp.Clear(); - } - } - else - { - ArrayList ar = (ArrayList)list_method_calls.Clone(); - for (int iii = 0; iii < list_method_calls.Count; iii++) - ((ArrayList)list_method_calls_main[list_method_calls_main.Count - 1]).Add(ar[iii]); - param_value_list.Add(_ex_l1); - ////////////////Dobavlyaem formalnye parametry - //statement_list st = (statement_list)LRParser.GetReductionSyntaxNode(7); - if (st.subnodes[0] is assign) - { - if (((assign)st.subnodes[0]).from is function_lambda_call) - { - function_lambda_call flc = (function_lambda_call)(((assign)st.subnodes[0]).from); - function_lambda_definition fld = ((function_lambda_call)(((assign)st.subnodes[0]).from)).f_lambda_def; - for (int ind = flc.parameters.expressions.Count; ind < fld.parameters.expressions.Count; ind++) - { - if (param_value_list.Count == 0) - param_value_list.Add(new expression_list()); - if (param_value_list[param_value_list.Count - 1] == null) - param_value_list[param_value_list.Count - 1] = new expression_list(); - ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Add(fld.parameters.expressions[ind]); - } - } - if (((assign)st.subnodes[0]).from is method_call) - { - method_call mc = (method_call)(((assign)st.subnodes[0]).from); - int jjj = 0; - int ind_null = -1; - while (jjj < mc.parameters.expressions.Count) - if (mc.parameters.expressions[jjj] is new_expr && ((new_expr)mc.parameters.expressions[jjj]).params_list.expressions[0] is string_const && - ((string_const)((new_expr)mc.parameters.expressions[jjj]).params_list.expressions[0]).Value == "$null") - { - ind_null = jjj; - jjj = mc.parameters.expressions.Count; - } - else - jjj++; - if (ind_null >= 0) - for (int ind = ind_null; ind < mc.parameters.expressions.Count; ind++) - { - if (param_value_list.Count == 0) - param_value_list.Add(new expression_list()); - if (param_value_list[param_value_list.Count - 1] == null) - param_value_list[param_value_list.Count - 1] = new expression_list(); - ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Add(new ident("$param" + ind)); - ((method_call)(((assign)st.subnodes[0]).from)).parameters.expressions.Insert(ind, new ident("$param" + ind)); - ((method_call)(((assign)st.subnodes[0]).from)).parameters.expressions.RemoveAt(ind + 1); - } - } - } - //////////////// - body_variant_list.Add(st); - //guard_list.Add(LRParser.GetReductionSyntaxNode(5)); - guard_list.Add(((ArrayList)body_list[g_ind])[0]); - if (list_params_temp.Count != 0) - { - list_params.Add(list_params_temp.Clone()); - list_params_temp.Clear(); - } - } - } - else - { - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != _ident.name) - i++; - if (i == func_name.Count) - { - func_name.Add(_ident); - } - } - list_params1.Clear(); - //int kk = last_list_method_calls.Count; - //kk = last_function_lambda_definitions.Count; - for (int i = 0; i < last_function_lambda_definitions.Count; i++) - { - for (int j = 0; j < ((function_lambda_definition)last_function_lambda_definitions[i]).formal_parameters.params_list.Count; j++) - { - string name_param = ((function_lambda_definition)last_function_lambda_definitions[i]).formal_parameters.params_list[j].idents.idents[0].name; - int k = 0; - while (k < last_list_method_calls.Count && ((ident)((method_call)last_list_method_calls[k]).dereferencing_value).name != name_param) - k++; - if (k < last_list_method_calls.Count) - { - function_lambda_definition fld = find_func_lambda_after(((function_lambda_definition)last_function_lambda_definitions[i]).lambda_name); - fld.formal_parameters.params_list[j].vars_type = func_type(((method_call)last_list_method_calls[k]).parameters.expressions.Count); - } - } - } - last_list_method_calls.Clear(); - last_function_lambda_definitions.Clear(); - } - return null; -} - case (int)RuleConstants.RULE_LIST_PARAM1: -// ::= -{ - bool b = false; - if (list_param.Count == 1) - { - list_params_temp.Add(new ArrayList()); - let_where_list_params.Add(new ArrayList());// - if (list_param[0] is new_expr && ((string_const)((new_expr)list_param[0]).params_list.expressions[1]).Value == "empty") - b = true; - list_param.Clear(); - } - else - { - list_params_temp.Add(list_param.Clone()); - let_where_list_params.Add(list_param.Clone());// - } - expression_list _expression_list = new expression_list(); - if (list_param.Count == 0) - { - if (b) - { - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - expression_list el = new expression_list(); - el.expressions.Add(new int32_const(0)); - literal lt; - string text = "empty_list"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false, null); - _expression_list.expressions.Add(newexpr); - } - else - { - _expression_list.source_context = ((expression)LRParser.GetReductionSyntaxNode(0)).source_context; - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(0)); - } - } - else - { - ident id = new ident(); - for (int i = 0; i < list_param.Count; i++) - { - if (list_param[i] is ident) - id.name += ((ident)list_param[i]).name; - else - { - errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "èäåíòèôèêàòîð")); - return null; - } - } - _expression_list.source_context = ((expression)id).source_context; - _expression_list.expressions.Add((expression)id); - list_param.Clear(); - } - list_params1.Clear(); - for (int i = 0; i < _expression_list.expressions.Count; i++) - list_params1.Add(_expression_list.expressions[i]); - last_list_method_calls_lambda.Clear(); - return _expression_list; -} - case (int)RuleConstants.RULE_BODY_WHERE: - // ::= -{ - //guard_list.Add(LRParser.GetReductionSyntaxNode(0)); - if (LRParser.GetReductionSyntaxNode(1) != null) - { - ArrayList ar = (ArrayList)LRParser.GetReductionSyntaxNode(1); - for (int ii = 0; ii < ar.Count; ii++) - where_funcs.Add(ar[ii]); - - statement_list _statement_list = (statement_list)LRParser.GetReductionSyntaxNode(0); - //////////////////////////////////////////////for guard - formal_parameters _formal_parametres = null; - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = null; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = null; - _procedure_definition.lambda_name = "__lam_where__" + lambda_num; - //new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, null, null, null, "lambda_where" + lambda_num); - _procedure_definition.proc_body = _statement_list; - procedure_definition pr = lambda(_procedure_definition); - //_function_lambda_definitions.Add(_procedure_definition);//////////////// - ((block)pr.proc_body).defs = new declarations(); - int start = 0; - int k = where_funcs.Count - 1; - while (k > 0 && ((procedure_definition)where_funcs[k]).proc_header.name.meth_name.name.Contains("__lambda__")) - k--; - int kk = 0; - while (k > 0 && kk < ar.Count - 1 && !((procedure_definition)where_funcs[k]).proc_header.name.meth_name.name.Contains("__lambda__")) - { - k--; - kk++; - } - start = k; - int i = start; - int n = where_funcs.Count; - if (start >= 0) - while (i < n) - { - ((block)pr.proc_body).defs.defs.Add((procedure_definition)where_funcs[start]); - where_funcs.RemoveAt(start); - i++; - } - /////////////////////////////////lambda - if (lambda_stack.Count > 0 && ((ArrayList)lambda_stack[lambda_stack.Count-1]).Count==0) - lambda_stack.RemoveAt(lambda_stack.Count - 1); - if (lambda_stack.Count > 0) - { - if (((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count > 0) - { - if (((block)pr.proc_body).defs == null) - ((block)pr.proc_body).defs = new declarations(); - for (int ii = 0; ii < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; ii++) - ((block)pr.proc_body).defs.defs.Add((procedure_definition)((ArrayList)lambda_stack[lambda_stack.Count - 1])[ii]); - for (int ii = 0; ii < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; ii++) - _function_lambda_definitions.RemoveAt(_function_lambda_definitions.Count - 1); - } - //lambda_stack.RemoveAt(lambda_stack.Count - 1); - } - ////////////////////////////////// - where_funcs.Add(pr); - //if (let_flag.Count > 0) - //let_func_last.Add(pr); - expression_list el = new expression_list(); - //where_fact_params.Clear(); - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - assign _assign = new assign((addressed_value)new ident("result"), new ident(_procedure_definition.lambda_name), Operators.Assignment); - - statement_list _statement_list1 = new statement_list(); - _statement_list1.subnodes.Add(_assign); - return _statement_list1; - } - else - { - //////////////////////////////////////////////for guard - statement_list _statement_list = (statement_list)LRParser.GetReductionSyntaxNode(0); - return _statement_list; - } -} - case (int)RuleConstants.RULE_WHERE_VAR : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_WHERE_VAR_TKWHERE: - // ::= 'tkWhere' - { - token_where_count--; - //let_where_funcs_main.RemoveAt(let_where_funcs_main.Count-1); - let_where_funcs.Clear(); - return LRParser.GetReductionSyntaxNode(1); - } - case (int)RuleConstants.RULE_INITS: -// ::= -{ - ArrayList ar = new ArrayList(); - ar.Add(LRParser.GetReductionSyntaxNode(0)); - return ar; -} - case (int)RuleConstants.RULE_INITS_TKSEMICOLON: -// ::= 'tkSemiColon' -{ - ArrayList ar = (ArrayList)LRParser.GetReductionSyntaxNode(0); - ar.Add(LRParser.GetReductionSyntaxNode(2)); - return ar; -} - case (int)RuleConstants.RULE_INIT_TKIDENT: -// ::= 'tkIdent' -{ - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(1); - /*statement_list _statement_list = (statement_list)LRParser.GetReductionSyntaxNode(4);*/ - statement_list _statement_list = new statement_list(); - ArrayList ar_main = (ArrayList)LRParser.GetReductionSyntaxNode(2); - ////////////////////////////for list - statement_list stmt_l = new statement_list(); - int start = let_where_list_params.Count; - if (_expression_list !=null) - start = let_where_list_params.Count - _expression_list.expressions.Count; - int i_ex = 0; - for (int ll = start; ll < let_where_list_params.Count; ll++) - { - for (int l = 0; l < ((ArrayList)let_where_list_params[ll]).Count; l++) - { - ident_list il1 = new ident_list(); - il1.idents.Add(new ident(((ident)((ArrayList)let_where_list_params[ll])[l]).name)); - named_type_reference _n_t_r = new named_type_reference(); - ident it = new ident("datatype"); - _n_t_r.names.Add(it); - - var_def_statement _var_def_statement = new var_def_statement(il1, (type_definition)_n_t_r, null, definition_attribute.None, false); - var_statement _var_statement = new var_statement(_var_def_statement); - stmt_l.subnodes.Add(_var_statement); - } - if (((ArrayList)let_where_list_params[ll]).Count > 0) - { - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - dot_node _dot_node = new dot_node(null, (addressed_value)(new ident("head"))); - ident id = _expression_list.expressions[i_ex] as ident; - /*for (int i1 = 0; i1 < ((ArrayList)let_where_list_params[ll]).Count; i1++) - id.name += ((ident)((ArrayList)let_where_list_params[ll])[i1]).name;*/ - if (id.name != null) - { - _dot_node.left = (addressed_value)(id); - object o = null; - method_call _method_call = new method_call(o as expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_dot_node; - assign _assign1 = new assign(((ident)((ArrayList)let_where_list_params[ll])[((ArrayList)let_where_list_params[ll]).Count - 1]) as addressed_value, _method_call as expression, _op_type_node.type); - stmt_l.subnodes.Add(_assign1); - - /// - for (int i1 = ((ArrayList)let_where_list_params[ll]).Count - 2; i1 > 0; i1--) - { - _dot_node = new dot_node((addressed_value)id, (addressed_value)(new ident("tail"))); - for (int j1 = 0; j1 < ((ArrayList)let_where_list_params[ll]).Count - 2 - i1; j1++) - { - _dot_node = new dot_node(_dot_node, (addressed_value)(new ident("tail"))); - } - _dot_node = new dot_node(_dot_node, (addressed_value)(new ident("head"))); - - _method_call = new method_call(o as expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_dot_node; - _assign1 = new assign(((ident)((ArrayList)let_where_list_params[ll])[i1]) as addressed_value, _method_call as expression, _op_type_node.type); - stmt_l.subnodes.Add(_assign1); - } - - _dot_node = new dot_node((addressed_value)id, (addressed_value)(new ident("tail"))); - - for (int j1 = 0; j1 < ((ArrayList)let_where_list_params[ll]).Count - 2; j1++) - { - _dot_node = new dot_node(_dot_node, (addressed_value)(new ident("tail"))); - } - _method_call = new method_call(o as expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_dot_node; - _assign1 = new assign(((ident)((ArrayList)let_where_list_params[ll])[0]) as addressed_value, _method_call as expression, _op_type_node.type); - stmt_l.subnodes.Add(_assign1); - } - } - i_ex++; - } - for (int ll = 0; ll < let_where_list_params.Count - start; ll++) - list_params_temp.RemoveAt(list_params_temp.Count - 1); - for (int i = stmt_l.subnodes.Count - 1; i >= 0; i--) - _statement_list.subnodes.Insert(0, stmt_l.subnodes[i]); - if (_expression_list != null) - for (int i = 0; i < _expression_list.expressions.Count; i++) - let_where_list_params.RemoveAt(let_where_list_params.Count - 1); - //////////////////////////// - formal_parameters _formal_parametres = null; - ident_list i_l = new ident_list(); - if (_expression_list != null) - { - for (int i = 0; i < _expression_list.expressions.Count; i++) - i_l.idents.Add((ident)_expression_list.expressions[i]); - ///////////////////////////// - _formal_parametres = new formal_parameters(); - for (int i = 0; i < i_l.idents.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = (ident)_expression_list.expressions[i]; - _ident_list.idents.Add(id); - string name_param = id.name; - typed_parameters _typed_parametres = null; - int k = 0; - while (k < last_list_method_calls_lambda.Count && ((ident)((method_call)last_list_method_calls_lambda[k]).dereferencing_value).name != name_param) - k++; - if (k < last_list_method_calls_lambda.Count) - _typed_parametres = new typed_parameters(_ident_list, func_type(((method_call)last_list_method_calls_lambda[k]).parameters.expressions.Count), parametr_kind.none, null); - else - { - named_type_reference _named_type_reference = new named_type_reference(); - - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - - _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference); - } - _formal_parametres.params_list.Add(_typed_parametres); - } - } - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = i_l; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = _expression_list; - _procedure_definition.lambda_name = ((ident)LRParser.GetReductionSyntaxNode(0)).name; - //new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, i_l, null, _expression_list, ((ident)LRParser.GetReductionSyntaxNode(0)).name); - object rt = _expression_list; - ////////////////////////////////////////for guard - for (int i = 0; i < ar_main.Count; i++) - if (((ArrayList)ar_main[i])[0] != null) - { - if_node _if_node = new if_node(); - _if_node.condition = _ob((expression)((ArrayList)ar_main[i])[0]); - _if_node.then_body = new statement_list(); - _if_node.then_body = (statement)((ArrayList)ar_main[i])[1]; - procedure_call _exit = new procedure_call(new ident("exit") as addressed_value); - ((statement_list)_if_node.then_body).subnodes.Add(_exit); - _statement_list.subnodes.Add(_if_node); - } - else - { - _statement_list.subnodes.Add((statement)((ArrayList)ar_main[i])[1]); - procedure_call _exit = new procedure_call(new ident("exit") as addressed_value); - _statement_list.subnodes.Add(_exit); - } - ////////////////////////////////////////// - _procedure_definition.proc_body = _statement_list; - parsertools.create_source_context(_procedure_definition, _expression_list, rt); - procedure_definition pr = lambda(_procedure_definition); - /////////////////////////// - /////////////////////////// - if (LRParser.GetReductionSyntaxNode(3) != null) - { - if (((block)pr.proc_body).defs == null) - ((block)pr.proc_body).defs = new declarations(); - for (int i = 0; i < ((ArrayList)LRParser.GetReductionSyntaxNode(3)).Count; i++) - ((block)pr.proc_body).defs.defs.Add((procedure_definition)((ArrayList)LRParser.GetReductionSyntaxNode(3))[i]); - } - if (let_where_funcs.Count > 0) - { - if (((block)pr.proc_body).defs == null) - ((block)pr.proc_body).defs = new declarations(); - for (int i = 0; i < let_where_funcs.Count; i++) - ((block)pr.proc_body).defs.defs.Add((procedure_definition)let_where_funcs[i]); - if (let_where_funcs_main.Count+1 > token_where_count) - { - if (((block)pr.proc_body).defs == null) - ((block)pr.proc_body).defs = new declarations(); - for (int i = 0; i < last_where_funcs.Count; i++) - ((block)pr.proc_body).defs.defs.Add((procedure_definition)last_where_funcs[i]); - for (int i = 0; i < last_where_funcs.Count; i++) - if (let_funcs.Count > 0) - let_funcs.RemoveAt(let_funcs.Count - 1); - last_where_funcs.Clear(); - } - let_where_funcs.Clear(); - let_func_last.Clear(); - let_flag.Clear(); - } - else - if (let_where_funcs_main.Count > 2 && let_where_funcs_main.Count>token_where_count) - { - ArrayList ar = new ArrayList(); - ar = (let_where_funcs_main[let_where_funcs_main.Count - 1] as ArrayList).Clone() as ArrayList; - - if (((block)pr.proc_body).defs == null) - ((block)pr.proc_body).defs = new declarations(); - for (int i = 0; i < ar.Count; i++) - ((block)pr.proc_body).defs.defs.Add((procedure_definition)ar[i]); - let_where_funcs.Clear(); - let_func_last.Clear(); - let_flag.Clear(); - let_where_funcs_main.RemoveAt(let_where_funcs_main.Count-1); - for (int i = 0; i < ar.Count; i++) - if (let_funcs.Count > 0) - let_funcs.RemoveAt(let_funcs.Count - 1); - } - ///////////////////////////lambda - if (lambda_stack.Count > 0) - { - if (((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count > 0) - { - if (((block)pr.proc_body).defs == null) - ((block)pr.proc_body).defs = new declarations(); - for (int i = 0; i < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; i++) - ((block)pr.proc_body).defs.defs.Add((procedure_definition)((ArrayList)lambda_stack[lambda_stack.Count - 1])[i]); - for (int ii = 0; ii < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; ii++) - _function_lambda_definitions.RemoveAt(_function_lambda_definitions.Count - 1); - } - int number = ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; - for (int i = 0; i < number;i++ ) - lambda_stack.RemoveAt(lambda_stack.Count - 1); - } - /////////////////////////// - return pr; -} - case (int)RuleConstants.RULE_PARAMS_WHERE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS_WHERE2 : - // ::= -{ - bool b = false; - if (list_param.Count == 1) - { - list_params_temp.Add(new ArrayList()); - let_where_list_params.Add(new ArrayList());// - if (list_param[0] is new_expr && ((string_const)((new_expr)list_param[0]).params_list.expressions[1]).Value == "empty") - b = true; - list_param.Clear(); - } - else - { - list_params_temp.Add(list_param.Clone()); - let_where_list_params.Add(list_param.Clone());// - } - expression_list _expression_list = new expression_list(); - if (list_param.Count == 0) - { - if (b) - { - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - expression_list el = new expression_list(); - el.expressions.Add(new int32_const(0)); - literal lt; - string text = "empty_list"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false, null); - _expression_list.expressions.Add(newexpr); - } - else - { - _expression_list.source_context = ((expression)LRParser.GetReductionSyntaxNode(0)).source_context; - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(0)); - } - } - else - { - ident id = new ident(); - for (int i = 0; i < list_param.Count; i++) - { - if (list_param[i] is ident) - id.name += ((ident)list_param[i]).name; - else - { - errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "èäåíòèôèêàòîð")); - return null; - } - } - _expression_list.source_context = ((expression)id).source_context; - _expression_list.expressions.Add((expression)id); - list_param.Clear(); - } - list_params1.Clear(); - for (int i = 0; i < _expression_list.expressions.Count; i++) - list_params1.Add(_expression_list.expressions[i]); - last_list_method_calls_lambda.Clear(); - return _expression_list; - } - case (int)RuleConstants.RULE_PARAMS_WHERE3 : - // ::= - - { - bool b = false; - if (list_param.Count == 1) - { - list_params_temp.Add(new ArrayList()); - let_where_list_params.Add(new ArrayList());// - if (list_param[0] is new_expr && ((string_const)((new_expr)list_param[0]).params_list.expressions[1]).Value == "empty") - b = true; - list_param.Clear(); - } - else - { - list_params_temp.Add(list_param.Clone()); - let_where_list_params.Add(list_param.Clone()); - } - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(0); - if (list_param.Count == 0) - { - if (!b) - { - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(1) as expression); - } - else - { - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - expression_list el = new expression_list(); - el.expressions.Add(new int32_const(0)); - literal lt; - string text = "empty_list"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false, null); - _expression_list.expressions.Add(newexpr); - } - } - else - { - ident id = new ident(); - for (int i = 0; i < list_param.Count; i++) - { - if (list_param[i] is ident) - id.name += ((ident)list_param[i]).name; - else - { - errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "èäåíòèôèêàòîð")); - return null; - } - } - _expression_list.expressions.Add((expression)id); - list_param.Clear(); - } - list_params1.Clear(); - for (int i = 0; i < _expression_list.expressions.Count; i++) - list_params1.Add(_expression_list.expressions[i]); - last_list_method_calls_lambda.Clear(); - return _expression_list; - } - case (int)RuleConstants.RULE_PARAMS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PARAMS2 : - // ::= -{ - //let_flag.Add(1); - bool b = false; - if (list_param.Count == 1) - { - list_params_temp.Add(new ArrayList()); - let_where_list_params.Add(new ArrayList());// - if (list_param[0] is new_expr && ((string_const)((new_expr)list_param[0]).params_list.expressions[1]).Value == "empty") - b = true; - list_param.Clear(); - } - else - { - list_params_temp.Add(list_param.Clone()); - let_where_list_params.Add(list_param.Clone());// - } - expression_list _expression_list = new expression_list(); - if (list_param.Count == 0) - { - if (b) - { - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - expression_list el = new expression_list(); - el.expressions.Add(new int32_const(0)); - literal lt; - string text = "empty_list"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false, null); - _expression_list.expressions.Add(newexpr); - } - else - { - _expression_list.source_context = ((expression)LRParser.GetReductionSyntaxNode(0)).source_context; - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(0)); - } - } - else - { - ident id = new ident(); - for (int i = 0; i < list_param.Count; i++) - { - if (list_param[i] is ident) - id.name += ((ident)list_param[i]).name; - else - { - errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "èäåíòèôèêàòîð")); - return null; - } - } - _expression_list.source_context = ((expression)id).source_context; - _expression_list.expressions.Add((expression)id); - list_param.Clear(); - } - list_params1.Clear(); - for (int i = 0; i < _expression_list.expressions.Count; i++) - list_params1.Add(_expression_list.expressions[i]); - last_list_method_calls_lambda.Clear(); - return _expression_list; - } - case (int)RuleConstants.RULE_PARAMS3 : - // ::= - - { - bool b = false; - if (list_param.Count == 1) - { - list_params_temp.Add(new ArrayList()); - let_where_list_params.Add(new ArrayList());// - if (list_param[0] is new_expr && ((string_const)((new_expr)list_param[0]).params_list.expressions[1]).Value == "empty") - b = true; - list_param.Clear(); - } - else - { - list_params_temp.Add(list_param.Clone()); - let_where_list_params.Add(list_param.Clone());// - } - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(0); - if (list_param.Count == 0) - { - if (!b) - { - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(1) as expression); - } - else - { - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - expression_list el = new expression_list(); - el.expressions.Add(new int32_const(0)); - literal lt; - string text = "empty_list"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false, null); - _expression_list.expressions.Add(newexpr); - } - } - else - { - ident id = new ident(); - for (int i = 0; i < list_param.Count; i++) - { - if (list_param[i] is ident) - id.name += ((ident)list_param[i]).name; - else - { - errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "èäåíòèôèêàòîð")); - return null; - } - } - _expression_list.expressions.Add((expression)id); - list_param.Clear(); - } - list_params1.Clear(); - for (int i = 0; i < _expression_list.expressions.Count; i++) - list_params1.Add(_expression_list.expressions[i]); - last_list_method_calls_lambda.Clear(); - return _expression_list; - } - - case (int)RuleConstants.RULE_PARAM : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIST_PARAM_TKIDENT: -// ::= 'tkIdent' -{ - list_param.Add(LRParser.GetReductionSyntaxNode(0)); - return LRParser.GetReductionSyntaxNode(0); -} - case (int)RuleConstants.RULE_LIST_PARAM : - // ::= -{ - list_param.Add(LRParser.GetReductionSyntaxNode(0)); - return LRParser.GetReductionSyntaxNode(0); -} - case (int)RuleConstants.RULE_LIST_PARAM_TKSQUAREOPEN_TKSQUARECLOSE: -// ::= 'tkSquareOpen' 'tkSquareClose' -{ - ArrayList list_elements = new ArrayList();//(ArrayList)LRParser.GetReductionSyntaxNode(1); - //////////////////////////////////////////////////////////proverka na type - if (list_elements != null) - { - ArrayList types = new ArrayList(); - for (int i = 0; i < list_elements.Count; i++) - { - string tp = ""; - if (list_elements[i] is new_expr) - { - tp = ((string_const)((new_expr)list_elements[i]).params_list.expressions[1]).Value; - if (!types.Contains(tp)) - types.Add(tp); - } - } - if ((types.Count == 2 && !(types.Contains("integer") && types.Contains("real"))) || types.Count > 2) - { - //errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "îäèíàêîâûé òèï ýëåìåíòîâ ñïèñêà")); - errors.Add(new PascalABCCompiler.Errors.Error("ýëåìåíòû ñïèñêà èìåþò ðàçíûé òèï")); - return null; - } - } - ////////////////////////////////////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype_list"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - expression_list el = new expression_list(); - if (list_elements == null) - list_elements = new ArrayList(); - int32_const n = new int32_const(list_elements.Count); - el.expressions.Add(n); - if (list_elements.Count > 0) - { - el.expressions.Add(new string_const("list")); - } - else - el.expressions.Add(new string_const("empty")); - for (int i = 0; i < list_elements.Count; i++) - el.expressions.Add(list_elements[i] as expression); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false, null); - parsertools.create_source_context(newexpr, new ident("new"), parsertools.sc_not_null(el, _named_type_reference1)); - list_param.Add(newexpr); - return newexpr; -} - case (int)RuleConstants.RULE_LIST_PARAM_TKBOTTOMMINUS: -// ::= 'tkBottomMinus' -{ - ident _ident = new ident("$$$" + bottom_num); - list_param.Add(_ident); - bottom_num++; - return _ident; -} - case (int)RuleConstants.RULE_LIST_PARAM_TKIDENT_TKCOLON: -// ::= 'tkIdent' 'tkColon' -{ - list_param.Add(LRParser.GetReductionSyntaxNode(0)); - return LRParser.GetReductionSyntaxNode(0); - } - case (int)RuleConstants.RULE_LIST_PARAM_TKBOTTOMMINUS_TKCOLON: -// ::= 'tkBottomMinus' 'tkColon' -{ - ident _ident = new ident("$$$" + bottom_num); - list_param.Add(_ident); - bottom_num++; - return _ident; -} - case (int)RuleConstants.RULE_LIST_PARAM_TKROUNDOPEN_TKROUNDCLOSE: -// ::= 'tkRoundOpen' 'tkRoundClose' -{ - return LRParser.GetReductionSyntaxNode(1); -} - case (int)RuleConstants.RULE_GUARD : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_GUARD_TKSPLIT : - // ::= 'tkSplit' - return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_GUARD_TKSPLIT_TKOTHERWISE: - // ::= 'tkSplit' 'tkOtherwise' - { - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.names.Add(idtype1); - ///// - expression_list el = new expression_list(); - el.expressions.Add(new ident("true") as expression); - literal lt; - string text = "boolean"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - ///// - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false, null); - parsertools.create_source_context(newexpr, new ident("new"), parsertools.sc_not_null(el, _named_type_reference1)); - return newexpr; - } - case (int)RuleConstants.RULE_MAIN_FUNC_TKMAINIDENT1_TKASSIGN : - // ::= 'tkMainIdent1' 'tkAssign' - { - block _block=new block(null, null); - - statement_list sl=null; - if (LRParser.GetReductionSyntaxNode(2) is statement_list) - { - sl = LRParser.GetReductionSyntaxNode(2) as statement_list; - /////////////////////// - ident_list il = new ident_list(); - il.idents.Add(new ident("result")); - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - - var_def_statement _var_def_statement = new var_def_statement(il, (type_definition)_named_type_reference1, null, definition_attribute.None, false); - parsertools.create_source_context(_var_def_statement, il, _named_type_reference1); - var_statement _var_statement = new var_statement(_var_def_statement); - parsertools.create_source_context(_var_statement, null, _var_def_statement); - sl.subnodes.Insert(0,_var_statement); - ///////////////////////// - } - else - { - sl = new statement_list(); - /////////////////////// - ident_list il = new ident_list(); - il.idents.Add(new ident("result")); - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - - var_def_statement _var_def_statement = new var_def_statement(il, (type_definition)_named_type_reference1, null, definition_attribute.None, false); - parsertools.create_source_context(_var_def_statement, il, _named_type_reference1); - var_statement _var_statement = new var_statement(_var_def_statement); - parsertools.create_source_context(_var_statement, null, _var_def_statement); - sl.subnodes.Add(_var_statement); - ///////////////////////// - sl.subnodes.Add(LRParser.GetReductionSyntaxNode(2) as statement); - if (!(LRParser.GetReductionSyntaxNode(2) is empty_statement)) - parsertools.assign_source_context(sl, LRParser.GetReductionSyntaxNode(2)); - } - _block.program_code=sl; - - return _block; - } - - case (int)RuleConstants.RULE_BODY_FUNC : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_STMTS : - // ::= - - { - statement_list _statement_list=new statement_list(); - - _statement_list.subnodes.Add((statement)LRParser.GetReductionSyntaxNode(0)); - parsertools.assign_source_context(_statement_list,LRParser.GetReductionSyntaxNode(0)); - return _statement_list; - } - - case (int)RuleConstants.RULE_STMTS_TKSEMICOLON : - // ::= 'tkSemiColon' - - { - statement_list _statement_list; - _statement_list=(statement_list)LRParser.GetReductionSyntaxNode(0); - _statement_list.subnodes.Add((statement)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_statement_list,_statement_list,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1))); - return _statement_list; - } - case (int)RuleConstants.RULE_STMTS1: - // ::= - { - statement_list _statement_list = new statement_list(); - - _statement_list.subnodes.Add((statement)LRParser.GetReductionSyntaxNode(0)); - parsertools.assign_source_context(_statement_list, LRParser.GetReductionSyntaxNode(0)); - return _statement_list; - } - case (int)RuleConstants.RULE_STMTS12: - // ::= - { - statement_list _statement_list; - _statement_list = (statement_list)LRParser.GetReductionSyntaxNode(0); - _statement_list.subnodes.Add((statement)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_statement_list, _statement_list, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1), - LRParser.GetReductionSyntaxNode(1))); - return _statement_list; - } - case (int)RuleConstants.RULE_EXPR_TKEQUAL : - // ::= 'tkEqual' - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_EXPR_TKNOTEQUAL: - // ::= 'tkNotEqual' - { - bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_EXPR_TKMORE : - // ::= 'tkMore' - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_EXPR_TKLESS : - // ::= 'tkLess' - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_EXPR_TKMOREEQ : - // ::= 'tkMoreEq' - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_EXPR_TKLESSEQ : - // ::= 'tkLessEq' - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIST_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= 'tkSquareOpen' 'tkSquareClose' -{ - ArrayList list_elements = (ArrayList)LRParser.GetReductionSyntaxNode(1); - //////////////////////////////////////////////////////////proverka na type - if (list_elements != null) - { - ArrayList types = new ArrayList(); - for (int i = 0; i < list_elements.Count; i++) - { - string tp = ""; - if (list_elements[i] is new_expr) - { - tp = ((string_const)((new_expr)list_elements[i]).params_list.expressions[1]).Value; - if (!types.Contains(tp)) - types.Add(tp); - } - } - if ((types.Count == 2 && !(types.Contains("integer") && types.Contains("real"))) || types.Count > 2) - { - //errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "îäèíàêîâûé òèï ýëåìåíòîâ ñïèñêà")); - errors.Add(new PascalABCCompiler.Errors.Error("ýëåìåíòû ñïèñêà èìåþò ðàçíûé òèï")); - return null; - } - } - ////////////////////////////////////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype_list"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - expression_list el = new expression_list(); - if (list_elements == null) - list_elements = new ArrayList(); - int32_const n = new int32_const(list_elements.Count); - el.expressions.Add(n); - if (list_elements.Count > 0) - { - el.expressions.Add(new string_const("list")); - } - else - el.expressions.Add(new string_const("empty")); - for (int i = 0; i < list_elements.Count;i++ ) - el.expressions.Add(list_elements[i] as expression); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false, null); - parsertools.create_source_context(newexpr, new ident("new"), parsertools.sc_not_null(el, _named_type_reference1)); - return newexpr; - } - case (int)RuleConstants.RULE_LIST_TKSQUAREOPEN_TKDOT_TKDOT_TKSQUARECLOSE : - // ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' -{ArrayList list_elements = (ArrayList)LRParser.GetReductionSyntaxNode(1); -//////////////////////////////////////////////////////////proverka na type -ArrayList types = new ArrayList(); -for (int i = 0; i < list_elements.Count; i++) -{ - if (list_elements[i] is new_expr) - { - string tp = ((string_const)((new_expr)list_elements[i]).params_list.expressions[1]).Value; - if (!types.Contains(tp)) - types.Add(tp); - } -} -if (LRParser.GetReductionSyntaxNode(4) is new_expr) -{ - new_expr ex_last = (new_expr)LRParser.GetReductionSyntaxNode(4); - string tp_last = ((string_const)ex_last.params_list.expressions[1]).Value; - if (!types.Contains(tp_last)) - types.Add(tp_last); -} -if ((types.Count == 2 && !(types.Contains("integer") && types.Contains("real"))) || types.Count > 2) -{ - //errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "îäèíàêîâûé òèï ýëåìåíòîâ ñïèñêà")); - errors.Add(new PascalABCCompiler.Errors.Error("ýëåìåíòû ñïèñêà èìåþò ðàçíûé òèï")); - return null; -} -if (list_elements.Count > 2) -{ - errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, ".")); - return null; -} -////////////////////////////////////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype_list"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - expression_list el = new expression_list(); - el.expressions.Add(list_elements[0] as expression); - if (list_elements.Count>1) - el.expressions.Add(list_elements[1] as expression); - el.expressions.Add(LRParser.GetReductionSyntaxNode(4) as expression); - el.expressions.Add(new string_const("list")); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false, null); - parsertools.create_source_context(newexpr, new ident("new"), parsertools.sc_not_null(el, _named_type_reference1)); - return newexpr; - } - case (int)RuleConstants.RULE_LIST_TKSQUAREOPEN_TKDOT_TKDOT_TKSQUARECLOSE2 : - // ::= 'tkSquareOpen' 'tkDot' 'tkDot' 'tkSquareClose' -{ArrayList list_elements = (ArrayList)LRParser.GetReductionSyntaxNode(1); -//////////////////////////////////////////////////////////proverka na type -ArrayList types = new ArrayList(); -for (int i = 0; i < list_elements.Count; i++) -{ - if (list_elements[i] is new_expr) - { - string tp = ((string_const)((new_expr)list_elements[i]).params_list.expressions[1]).Value; - if (!types.Contains(tp)) - types.Add(tp); - } -} -if (types.Count == 2 && !(types.Contains("integer") && types.Contains("real"))) -{ - //errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "îäèíàêîâûé òèï ýëåìåíòîâ ñïèñêà")); - errors.Add(new PascalABCCompiler.Errors.Error("ýëåìåíòû ñïèñêà èìåþò ðàçíûé òèï")); - return null; -} -if (list_elements.Count > 2) -{ - errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, ".")); - return null; -} -////////////////////////////////////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype_list"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - expression_list el = new expression_list(); - el.expressions.Add(list_elements[0] as expression); - el.expressions.Add(list_elements[1] as expression); - named_type_reference _named_type_reference11 = new named_type_reference(); - ident idtype11 = new ident("datatype"); - _named_type_reference11.names.Add(idtype11); - expression_list ell = new expression_list(); - new_expr ee = list_elements[0] as new_expr; - ell.expressions.Add(ee.params_list.expressions[0]); - literal lt; - string text = "nil"; - lt = new string_const(text); - ell.expressions.Add(lt as expression); - named_type_reference ntrr = _named_type_reference11; - new_expr newexprr = new new_expr(ntrr, ell, false, null); - el.expressions.Add(newexprr); - el.expressions.Add(new string_const("list")); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false, null); - parsertools.create_source_context(newexpr, new ident("new"), parsertools.sc_not_null(el, _named_type_reference1)); - return newexpr;} - case (int)RuleConstants.RULE_LIST: - // ::= - return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIST_TKCOLON : - // ::= 'tkColon' -{expression_list el = new expression_list(); - el.expressions.Add(LRParser.GetReductionSyntaxNode(3) as expression); - dot_node _dot_node = new dot_node(null, new ident("colon")); - _dot_node.left = (addressed_value)LRParser.GetReductionSyntaxNode(0); - method_call _method_call = new method_call(el); - _method_call.dereferencing_value = (addressed_value)_dot_node; - return _method_call;} - case (int)RuleConstants.RULE_LIST_CONSTRUCTOR_TKSQUAREOPEN_TKSPLIT_TKSQUARECLOSE: -// ::= 'tkSquareOpen' 'tkSplit' 'tkSquareClose' -{ - ArrayList generators=(ArrayList)LRParser.GetReductionSyntaxNode(3); - ArrayList conditions = (ArrayList)LRParser.GetReductionSyntaxNode(4); - ////////////////////////////////////////////////////////////////////////// - statement_list body = new statement_list(); - rec_num = 0; - for (int i = 0; i < generators.Count; i++) - { - ident id = null; - if (((ArrayList)generators[i])[0] is new_expr) - { - constructor_rec_var(body, ((ArrayList)generators[i])[0] as new_expr); - } - else - { - id = (ident)((ArrayList)generators[i])[0]; - ident_list _ident_list1 = new ident_list(); - _ident_list1.idents.Add(id); - string name_param2 = id.name; - typed_parameters _typed_parametres2 = null; - named_type_reference _named_type_reference3 = new named_type_reference(); - ident idtype3 = new ident("datatype"); - _named_type_reference3.names.Add(idtype3); - var_def_statement _var_def_statement2 = new var_def_statement(_ident_list1, (type_definition)_named_type_reference3, null, definition_attribute.None, false); - var_statement _var_statement2 = new var_statement(_var_def_statement2); - body.subnodes.Add(_var_statement2); - } - } - ///////////////////////////////////////////////////////////////////////result - named_type_reference _named_type_reference2 = new named_type_reference(); - ident idtype2 = new ident("datatype_list"); - _named_type_reference2.names.Add(idtype2); - expression_list el2 = new expression_list(); - int32_const n = new int32_const(0); - el2.expressions.Add(n); - el2.expressions.Add(new string_const("list")); - named_type_reference ntr = _named_type_reference2; - new_expr newexpr = new new_expr(ntr, el2, false, null); - assign _result = new assign(); - _result.operator_type = Operators.Assignment; - _result.to = new ident("result"); - _result.from = newexpr; - body.subnodes.Add(_result); - //////////////////////////////////////////////////////////////////////if - if_node _if_node = new if_node(); - if (conditions != null) - { - expression b_e = (expression)conditions[conditions.Count - 1]; - for (int i = conditions.Count - 2; i >= 0; i--) - { - bin_expr b_e1 = new bin_expr(); - b_e1.operation_type = Operators.LogicalAND; - b_e1.left = (expression)conditions[i]; - b_e1.right = b_e; - b_e = b_e1; - } - _if_node.condition = _ob(b_e); - } - //////////////////////////////////////////////////////////////////////assign - statement_list stmt_list=new statement_list(); - rec_num = 0; - for (int i = 0; i < generators.Count; i++) - { - if (((ArrayList)generators[i])[0] is new_expr) - { - constructor_rec_ass(stmt_list, ((ArrayList)generators[i])[0] as new_expr, _index((expression)((ArrayList)generators[i])[1], new ident("$i" + i))); - } - else - { - assign _assign = new assign(); - _assign.operator_type = Operators.Assignment; - _assign.to = (ident)((ArrayList)generators[i])[0]; - _assign.from = _index((expression)((ArrayList)generators[i])[1], new ident("$i" + i)); - stmt_list.subnodes.Add(_assign); - } - } - if (conditions != null) - { - _if_node.then_body = _add(new ident("result"), (expression)LRParser.GetReductionSyntaxNode(1)); - stmt_list.subnodes.Add(_if_node); - } - else - stmt_list.subnodes.Add(_add(new ident("result"), (expression)LRParser.GetReductionSyntaxNode(1))); - //////////////////////////////////////////////////////////////////////for - statement _for_stmt = stmt_list; - for (int i = generators.Count - 1; i >= 0; i--) - { - for_node _for_node = new for_node(); - _for_node.cycle_type = for_cycle_type.to; - _for_node.loop_variable = new ident("$i"+i); - named_type_reference _named_type_reference = new named_type_reference(); - ident idtype = new ident("integer"); - _named_type_reference.names.Add(idtype); - _for_node.type_name = (type_definition)_named_type_reference; - _for_node.initial_value = new int32_const(0); - _for_node.finish_value = _count((expression)((ArrayList)generators[i])[1]); - _for_node.increment_value = new int32_const(1); - _for_node.statements = _for_stmt; - _for_stmt = _for_node; - } - body.subnodes.Add(_for_stmt); - ///////////////////////////////////////////////////////////////////////////////////////////////////////lambda - formal_parameters _formal_parametres = null; - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = null; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = null; - _procedure_definition.lambda_name = "__lambda__" + lambda_num; - //new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, null, null, null, "lambda" + lambda_num); - _procedure_definition.proc_body = body; - procedure_definition pr = lambda(_procedure_definition); - //_function_lambda_definitions.Add(_procedure_definition);//////////////// - let_funcs.Add(pr); - let_where_funcs.Add(pr); - if (let_flag.Count > 0) - let_func_last.Add(pr); - expression_list el = new expression_list(); - let_fact_params.Clear(); - return new ident(_procedure_definition.lambda_name); -} - case (int)RuleConstants.RULE_GENERATORS: - // ::= - { - ArrayList ar = new ArrayList(); - ar.Add(LRParser.GetReductionSyntaxNode(0)); - return ar; - } - case (int)RuleConstants.RULE_GENERATORS_TKCOMMA: - // ::= 'tkComma' - { - ArrayList ar = (ArrayList)LRParser.GetReductionSyntaxNode(0); - ar.Add(LRParser.GetReductionSyntaxNode(2)); - return ar; - } - case (int)RuleConstants.RULE_GENERATOR_TKARROWGEN: - // ::= 'tkArrowGen' - { - ArrayList ar = new ArrayList(); - ar.Add(LRParser.GetReductionSyntaxNode(0)); - ar.Add(LRParser.GetReductionSyntaxNode(2)); - return ar; - } - case (int)RuleConstants.RULE_CONDITIONS_COMMA: - // ::= - { - return null; - } - case (int)RuleConstants.RULE_CONDITIONS_COMMA_TKCOMMA: - // ::= 'tkComma' - { - return LRParser.GetReductionSyntaxNode(1); - } - case (int)RuleConstants.RULE_CONDITIONS: - // ::= - { - ArrayList ar = new ArrayList(); - ar.Add(LRParser.GetReductionSyntaxNode(0)); - return ar; - } - case (int)RuleConstants.RULE_CONDITIONS_TKCOMMA: - // ::= 'tkComma' - { - ArrayList ar = (ArrayList)LRParser.GetReductionSyntaxNode(0); - ar.Add(LRParser.GetReductionSyntaxNode(2)); - return ar; - } - case (int)RuleConstants.RULE_CONDITION: - // ::= - return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CORTEG_TKROUNDOPEN_TKCOMMA_TKROUNDCLOSE: -// ::= 'tkRoundOpen' 'tkComma' 'tkRoundClose' - { - //new_expr first_el = (new_expr)LRParser.GetReductionSyntaxNode(1); - ArrayList list_elements = (ArrayList)LRParser.GetReductionSyntaxNode(3); - list_elements.Insert(0, LRParser.GetReductionSyntaxNode(1)); - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype_list"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - expression_list el = new expression_list(); - if (list_elements == null) - list_elements = new ArrayList(); - int32_const n = new int32_const(list_elements.Count); - el.expressions.Add(n); - if (list_elements.Count > 0) - { - el.expressions.Add(new string_const("corteg")); - } - else - el.expressions.Add(new string_const("empty")); - for (int i = 0; i < list_elements.Count; i++) - el.expressions.Add(list_elements[i] as expression); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false, null); - parsertools.create_source_context(newexpr, new ident("new"), parsertools.sc_not_null(el, _named_type_reference1)); - return newexpr; - } - case (int)RuleConstants.RULE_LIST_ELEMENTS : - // ::= -return null; - case (int)RuleConstants.RULE_LIST_ELEMENTS2 : - // ::= -{ - ArrayList list_elements = new ArrayList(); - list_elements.Add(LRParser.GetReductionSyntaxNode(0)); - return list_elements; - } - case (int)RuleConstants.RULE_LIST_ELEMENTS_TKCOMMA : - // ::= 'tkComma' -{ - ((ArrayList)LRParser.GetReductionSyntaxNode(0)).Add(LRParser.GetReductionSyntaxNode(2)); - return LRParser.GetReductionSyntaxNode(0); - } - case (int)RuleConstants.RULE_ADD_EXPR_TKAND : - // ::= 'tkAnd' - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_ADD_EXPR : - // ::= - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_ADD_EXPR2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_MULT_EXPR_TKOR : - // ::= 'tkOr' - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_MULT_EXPR : - // ::= - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_MULT_EXPR2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NEGATE_EXPR_TKMINUS : - // ::= 'tkMinus' - - { - un_expr _un_expr=new un_expr(LRParser.GetReductionSyntaxNode(1) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(0)).type); - parsertools.create_source_context(_un_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _un_expr; - } - - case (int)RuleConstants.RULE_NEGATE_EXPR_TKNOT : - // ::= 'tkNot' - - { - un_expr _un_expr=new un_expr(LRParser.GetReductionSyntaxNode(1) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(0)).type); - parsertools.create_source_context(_un_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _un_expr; - } - - case (int)RuleConstants.RULE_NEGATE_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_EXPR: -// ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKINT: -// ::= 'tkInt' - -{ - named_type_reference _named_type_reference1 = new named_type_reference(); - - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - - ///// - expression_list el = new expression_list(); - el.expressions.Add(LRParser.GetReductionSyntaxNode(0) as expression); - literal lt; - string text = "integer"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - ///// - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false,null); - parsertools.create_source_context(newexpr, new ident("new"), parsertools.sc_not_null(el, _named_type_reference1)); - return newexpr; - } - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKDOUBLE: -// ::= 'tkDouble' -{ - named_type_reference _named_type_reference1 = new named_type_reference(); - - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - - ///// - expression_list el = new expression_list(); - el.expressions.Add(LRParser.GetReductionSyntaxNode(0) as expression); - literal lt; - string text = "real"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - ///// - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false,null); - parsertools.create_source_context(newexpr, new ident("new"), parsertools.sc_not_null(el, _named_type_reference1)); - return newexpr; - } - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKBOOL: -// ::= 'tkBool' -{ - named_type_reference _named_type_reference1 = new named_type_reference(); - - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - - ///// - expression_list el = new expression_list(); - el.expressions.Add(LRParser.GetReductionSyntaxNode(0) as expression); - literal lt; - string text = "boolean"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - ///// - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false,null); - parsertools.create_source_context(newexpr, new ident("new"), parsertools.sc_not_null(el, _named_type_reference1)); - return newexpr; - } - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKCHAR: -// ::= 'tkChar' -{ - named_type_reference _named_type_reference1 = new named_type_reference(); - - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - - ///// - expression_list el = new expression_list(); - el.expressions.Add(LRParser.GetReductionSyntaxNode(0) as expression); - literal lt; - string text = "char"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - ///// - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false,null); - parsertools.create_source_context(newexpr, new ident("new"), parsertools.sc_not_null(el, _named_type_reference1)); - return newexpr; - } - case (int)RuleConstants.RULE_SIMPLE_TYPE_EXPR_TKSTRING: -// ::= 'tkString' -{ - named_type_reference _named_type_reference1 = new named_type_reference(); - - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - - ///// - expression_list el = new expression_list(); - el.expressions.Add(LRParser.GetReductionSyntaxNode(0) as expression); - literal lt; - string text = "string"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - ///// - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false,null); - parsertools.create_source_context(newexpr, new ident("new"), parsertools.sc_not_null(el, _named_type_reference1)); - return newexpr; - } - case (int)RuleConstants.RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundClose' -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_SIMPLE_EXPR2: -// ::= -{ - if (LRParser.GetReductionSyntaxNode(0) is ArrayList) - { - ////////////////////////////////////////////////////////ident_params - ArrayList arr = (ArrayList)LRParser.GetReductionSyntaxNode(0); - ident _ident = (ident)arr[0]; - expression_list el = new expression_list(); - for (int ii = 1; ii < arr.Count; ii++) - el.expressions.Add((expression)arr[ii]); - //////////////////////////////////////////////////////// - //expression_list el = LRParser.GetReductionSyntaxNode(2) as expression_list; - ////////////////////////////for curring - int n = el.expressions.Count; - int fld_params_count = find_count_params(_ident.name); - //////////////////////////// - if (fld_params_count - n > 0) - { - expression_list _expression_list = el; - expression_list _params = new expression_list(); - expression_list _params_el = new expression_list(); - for (int i = 0; i < list_params1.Count; i++) - if (list_params1[i] is ident) - { - _params.expressions.Add(new ident(((ident)list_params1[i]).name)); - _params_el.expressions.Add(new ident(((ident)list_params1[i]).name)); - } - for (int i = 1; i <= fld_params_count - n; i++) - _expression_list.expressions.Add(new ident("$$" + i)); - for (int i = 1; i <= fld_params_count - n; i++) - { - _params.expressions.Add(new ident("$$" + i)); - _params_el.expressions.Add(new ident("$$" + i)); - } - method_call _method_call = new method_call(_expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_ident; - - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - assign _assign = new assign((addressed_value)new ident("result"), _method_call as expression, _op_type_node.type); - - statement_list _statement_list = new statement_list(); - _statement_list.subnodes.Add(_assign); - //////////////////////////// - ident_list i_l = new ident_list(); - for (int i = 1; i <= fld_params_count - n; i++) - i_l.idents.Add(new ident("$$" + i)); - ///////////////////////////// - formal_parameters _formal_parametres = new formal_parameters(); - for (int i = 0; i < _params.expressions.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = (ident)_params.expressions[i]; - _ident_list.idents.Add(id); - named_type_reference _named_type_reference = new named_type_reference(); - - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference); - - _formal_parametres.params_list.Add(_typed_parametres); - } - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = i_l; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = _params_el; - _procedure_definition.lambda_name = "__lambda__" + lambda_num; - //new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, i_l, null, _params_el, "lambda" + lambda_num); - object rt = _expression_list; - _procedure_definition.proc_body = _statement_list; - _function_lambda_definitions_after.Add(_procedure_definition); - _function_lambda_definitions_after.Add(_ident.name);//////////////// - last_function_lambda_definitions.Add(_procedure_definition); - return new ident(_procedure_definition.lambda_name); - } - else - { - method_call _method_call = new method_call(el); - - if (_method_call is dereference) - { - ((dereference)_method_call).dereferencing_value = (addressed_value)_ident; - parsertools.create_source_context(_method_call, _ident, _method_call); - } - list_method_calls.Add(_method_call); - last_list_method_calls.Add(_method_call); - last_list_method_calls_lambda.Add(_method_call); - return _method_call; - - } - } - else - return LRParser.GetReductionSyntaxNode(0); -} - case (int)RuleConstants.RULE_SIMPLE_EXPR3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_EXPR_TKLET_TKIN : - // ::= 'tkLet' 'tkIn' -{////////////////////////// - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(1); - statement_list _statement_list = (statement_list)LRParser.GetReductionSyntaxNode(3); - ////////////////////////// - formal_parameters _formal_parametres = null; - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = null; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = _expression_list; - _procedure_definition.lambda_name = "__lambda__" + lambda_num; - //new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, null, null, _expression_list, "lambda" + lambda_num); - object rt = _expression_list; - _procedure_definition.proc_body = _statement_list; - parsertools.create_source_context(_procedure_definition, _expression_list, rt); - procedure_definition pr = lambda(_procedure_definition); - //_function_lambda_definitions.Add(_procedure_definition);//////////////// - ((block)pr.proc_body).defs = new declarations(); - int start=0; - int k = let_funcs.Count-1; - while (k>0 && ((procedure_definition)let_funcs[k]).proc_header.name.meth_name.name.Contains("__lambda__")) - k--; - int kk = 0; - while (k > 0 && kk < _expression_list.expressions.Count-1 && !((procedure_definition)let_funcs[k]).proc_header.name.meth_name.name.Contains("__lambda__")) - { - k--; - kk++; - } - start = k; - int i = start; - int n = let_funcs.Count; - while (i < n) - { - if (let_where_funcs.Count > 0) - if (start - (let_funcs.Count - let_where_funcs.Count) >= 0) - let_where_funcs.RemoveAt(start - (let_funcs.Count - let_where_funcs.Count)); - else - let_where_funcs.RemoveAt(let_where_funcs.Count - 1); - ((block)pr.proc_body).defs.defs.Add((procedure_definition)let_funcs[start]); - let_funcs.RemoveAt(start); - i++; - } - ///////////////////////////lambda - if (((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count > 0) - { - if (((block)pr.proc_body).defs==null) - ((block)pr.proc_body).defs = new declarations(); - for (int ii = 0; ii < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; ii++) - ((block)pr.proc_body).defs.defs.Add((procedure_definition)((ArrayList)lambda_stack[lambda_stack.Count - 1])[ii]); - for (int ii = 0; ii < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; ii++) - _function_lambda_definitions.RemoveAt(_function_lambda_definitions.Count-1); - } - lambda_stack.RemoveAt(lambda_stack.Count - 1); - //lambda_stack.RemoveAt(lambda_stack.Count - 1); - /*if (((block)pr.proc_body).defs == null) - ((block)pr.proc_body).defs = new declarations(); - for (int ii = 0; ii < _function_lambda_definitions.Count; ii++) - ((block)pr.proc_body).defs.defs.Add(lambda((function_lambda_definition)_function_lambda_definitions[ii])); - _function_lambda_definitions.Clear();*/ - /////////////////////////// - let_funcs.Add(pr); - let_where_funcs.Add(pr); - if (let_flag.Count>0) - let_func_last.Add(pr); - expression_list el = new expression_list(); - let_fact_params.Clear(); - ///////////////////// - if (let_stack.Count > 0) - ((ArrayList)let_stack[let_stack.Count - 1]).Add(pr); - /*else - { - let_funcs.Add(pr); - let_where_funcs.Add(pr); - }*/ - ///////////////////// - return new ident(_procedure_definition.lambda_name); -} - case (int)RuleConstants.RULE_SIMPLE_EXPR4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_EXPR5: - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_EXPR6 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - //case (int)RuleConstants.RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDCLOSE_TKROUNDOPEN_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundClose' 'tkRoundOpen' 'tkRoundClose' - case (int)RuleConstants.RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDOPEN_TKROUNDCLOSE_TKROUNDCLOSE: -// ::= 'tkRoundOpen' 'tkRoundOpen' 'tkRoundClose' 'tkRoundClose' -{ - function_lambda_definition fld = find_func_lambda_name(((ident)LRParser.GetReductionSyntaxNode(2)).name); - //function_lambda_definition fld = find_lambda_funcs(((ident)LRParser.GetReductionSyntaxNode(1)).name); - //lambda_funcs.RemoveAt(lambda_funcs.Count-1); - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(4); - function_lambda_definition _lambda_definition = fld; - function_lambda_call _lambda_call = new function_lambda_call(_lambda_definition, _expression_list); - return _lambda_call; - } - /*case (int)RuleConstants.RULE_SIMPLE_EXPR_TKROUNDOPEN_TKROUNDCLOSE2 : - // ::= 'tkRoundOpen' 'tkRoundClose' -{ - if (LRParser.GetReductionSyntaxNode(0) is function_lambda_call) - { - expression_list _expression_list = new expression_list(); - expression_list el_new = (expression_list)LRParser.GetReductionSyntaxNode(2); - function_lambda_call _lambda_definition_call = (function_lambda_call)LRParser.GetReductionSyntaxNode(0); - function_lambda_definition fld = _lambda_definition_call.f_lambda_def; - for (int i = 0; i < _lambda_definition_call.parameters.expressions.Count; i++) - _expression_list.expressions.Add(_lambda_definition_call.parameters.expressions[i]); - for (int i = 0; i < el_new.expressions.Count; i++) - _expression_list.expressions.Add(el_new.expressions[i]); - function_lambda_call _lambda_call = new function_lambda_call(fld, _expression_list); - return _lambda_call; - } - else - return null;}*/ - case (int)RuleConstants.RULE_VARIABLE_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_DEF_VARS : - // ::= -{ - expression_list el=new expression_list(); - el.expressions.Add(LRParser.GetReductionSyntaxNode(0) as expression); - return el; - } - case (int)RuleConstants.RULE_DEF_VARS_TKSEMICOLON : - // ::= 'tkSemiColon' -{ - expression_list el=(expression_list)LRParser.GetReductionSyntaxNode(0); - el.expressions.Add(LRParser.GetReductionSyntaxNode(2) as expression); - return el; - - } - case (int)RuleConstants.RULE_DEF_VAR_TKIDENT: -// ::= 'tkIdent' -{ - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(1); - /*statement_list _statement_list = (statement_list)LRParser.GetReductionSyntaxNode(4);*/ - statement_list _statement_list = new statement_list(); - ArrayList ar_main = (ArrayList)LRParser.GetReductionSyntaxNode(2); - ////////////////////////////for list - statement_list stmt_l = new statement_list(); - int start = let_where_list_params.Count; - if (_expression_list != null) - start = let_where_list_params.Count - _expression_list.expressions.Count; - int i_ex = 0; - for (int ll = start; ll < let_where_list_params.Count; ll++) - { - for (int l = 0; l < ((ArrayList)let_where_list_params[ll]).Count; l++) - { - ident_list il1 = new ident_list(); - il1.idents.Add(new ident(((ident)((ArrayList)let_where_list_params[ll])[l]).name)); - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.names.Add(idtype1); - - var_def_statement _var_def_statement = new var_def_statement(il1, (type_definition)_named_type_reference1, null, definition_attribute.None, false); - var_statement _var_statement = new var_statement(_var_def_statement); - stmt_l.subnodes.Add(_var_statement); - } - if (((ArrayList)let_where_list_params[ll]).Count > 0) - { - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - dot_node _dot_node = new dot_node(null, (addressed_value)(new ident("head"))); - ident id = _expression_list.expressions[i_ex] as ident; - /*for (int i1 = 0; i1 < ((ArrayList)let_where_list_params[ll]).Count; i1++) - id.name += ((ident)((ArrayList)let_where_list_params[ll])[i1]).name;*/ - if (id.name != null) - { - _dot_node.left = (addressed_value)(id); - object o = null; - method_call _method_call = new method_call(o as expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_dot_node; - assign _assign1 = new assign(((ident)((ArrayList)let_where_list_params[ll])[((ArrayList)let_where_list_params[ll]).Count - 1]) as addressed_value, _method_call as expression, _op_type_node.type); - stmt_l.subnodes.Add(_assign1); - - /// - for (int i1 = ((ArrayList)let_where_list_params[ll]).Count - 2; i1 > 0; i1--) - { - _dot_node = new dot_node((addressed_value)id, (addressed_value)(new ident("tail"))); - for (int j1 = 0; j1 < ((ArrayList)let_where_list_params[ll]).Count - 2 - i1; j1++) - { - _dot_node = new dot_node(_dot_node, (addressed_value)(new ident("tail"))); - } - _dot_node = new dot_node(_dot_node, (addressed_value)(new ident("head"))); - - _method_call = new method_call(o as expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_dot_node; - _assign1 = new assign(((ident)((ArrayList)let_where_list_params[ll])[i1]) as addressed_value, _method_call as expression, _op_type_node.type); - stmt_l.subnodes.Add(_assign1); - } - - _dot_node = new dot_node((addressed_value)id, (addressed_value)(new ident("tail"))); - - for (int j1 = 0; j1 < ((ArrayList)let_where_list_params[ll]).Count - 2; j1++) - { - _dot_node = new dot_node(_dot_node, (addressed_value)(new ident("tail"))); - } - _method_call = new method_call(o as expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_dot_node; - _assign1 = new assign(((ident)((ArrayList)let_where_list_params[ll])[0]) as addressed_value, _method_call as expression, _op_type_node.type); - stmt_l.subnodes.Add(_assign1); - } - } - i_ex++; - } - for (int ll = 0; ll < let_where_list_params.Count - start; ll++) - list_params_temp.RemoveAt(list_params_temp.Count - 1); - for (int i = stmt_l.subnodes.Count - 1; i >= 0; i--) - _statement_list.subnodes.Insert(0, stmt_l.subnodes[i]); - if (_expression_list != null) - for (int i = 0; i < _expression_list.expressions.Count; i++) - let_where_list_params.RemoveAt(let_where_list_params.Count - 1); - //////////////////////////// - formal_parameters _formal_parametres = null; - ident_list i_l = new ident_list(); - if (_expression_list != null) - { - for (int i = 0; i < _expression_list.expressions.Count; i++) - i_l.idents.Add((ident)_expression_list.expressions[i]); - ///////////////////////////// - _formal_parametres = new formal_parameters(); - for (int i = 0; i < i_l.idents.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = (ident)_expression_list.expressions[i]; - _ident_list.idents.Add(id); - string name_param = id.name; - typed_parameters _typed_parametres = null; - int k = 0; - while (k < last_list_method_calls_lambda.Count && ((ident)((method_call)last_list_method_calls_lambda[k]).dereferencing_value).name != name_param) - k++; - if (k < last_list_method_calls_lambda.Count) - _typed_parametres = new typed_parameters(_ident_list, func_type(((method_call)last_list_method_calls_lambda[k]).parameters.expressions.Count), parametr_kind.none, null); - else - { - named_type_reference _named_type_reference = new named_type_reference(); - - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - - _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference); - } - _formal_parametres.params_list.Add(_typed_parametres); - } - } - ////////////////////////// - named_type_reference _n_t_r = new named_type_reference(); - ident it = new ident("datatype"); - _n_t_r.names.Add(it); - ///////////////////////////// - //lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_n_t_r; - _procedure_definition.ident_list = i_l; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = _expression_list; - _procedure_definition.lambda_name = ((ident)LRParser.GetReductionSyntaxNode(0)).name; - //new function_lambda_definition(_formal_parametres, (type_definition)_n_t_r, i_l, null, _expression_list, ((ident)LRParser.GetReductionSyntaxNode(0)).name); - object rt = _expression_list; - ////////////////////////////////////////////////for guard - for (int i = 0; i < ar_main.Count;i++ ) - if (((ArrayList)ar_main[i])[0] != null) - { - if_node _if_node = new if_node(); - _if_node.condition = _ob((expression)((ArrayList)ar_main[i])[0]); - _if_node.then_body = new statement_list(); - _if_node.then_body = (statement)((ArrayList)ar_main[i])[1]; - procedure_call _exit = new procedure_call(new ident("exit") as addressed_value); - ((statement_list)_if_node.then_body).subnodes.Add(_exit); - _statement_list.subnodes.Add(_if_node); - } - else - { - _statement_list.subnodes.Add((statement)((ArrayList)ar_main[i])[1]); - procedure_call _exit = new procedure_call(new ident("exit") as addressed_value); - _statement_list.subnodes.Add(_exit); - } - //////////////////////////////////////////////// - _procedure_definition.proc_body = _statement_list; - parsertools.create_source_context(_procedure_definition, _expression_list, rt); - procedure_definition pr = lambda(_procedure_definition); - /////////////////////////// - /*if (let_func_last.Count > 0) - { - ((block)pr.proc_body).defs = new declarations(); - for (int i = 0; i < let_func_last.Count; i++) - ((block)pr.proc_body).defs.defs.Add((procedure_definition)let_func_last[i]); - for (int i = 0; i < let_func_last.Count; i++) - if (let_where_funcs.Count > 0) - let_where_funcs.RemoveAt(let_where_funcs.Count - 1); - for (int i = 0; i < let_func_last.Count; i++) - let_funcs.RemoveAt(let_funcs.Count - 1); - let_func_last.Clear(); - let_flag.RemoveAt(let_flag.Count - 1); - } - else - if ((let_flag.Count > 0 && _expression_list != null) || let_funcs.Count == 0) - let_flag.Clear();*/ - if (((ArrayList)let_stack[let_stack.Count - 1]).Count > 0) - { - ((block)pr.proc_body).defs = new declarations(); - for (int i = 0; i < ((ArrayList)let_stack[let_stack.Count - 1]).Count; i++) - ((block)pr.proc_body).defs.defs.Add((procedure_definition)((ArrayList)let_stack[let_stack.Count - 1])[i]); - for (int i = 0; i < ((ArrayList)let_stack[let_stack.Count - 1]).Count; i++) - if (let_where_funcs.Count > 0) - let_where_funcs.RemoveAt(let_where_funcs.Count - 1); - for (int i = 0; i < ((ArrayList)let_stack[let_stack.Count - 1]).Count; i++) - if (let_funcs.Count > 0) - let_funcs.RemoveAt(let_funcs.Count - 1); - let_func_last.Clear(); - if (let_flag.Count>0) - let_flag.RemoveAt(let_flag.Count - 1); - } - let_stack.RemoveAt(let_stack.Count - 1); - /////////////////////////////////////////////////////////////////// - if (LRParser.GetReductionSyntaxNode(3) != null) - { - if (((block)pr.proc_body).defs == null) - ((block)pr.proc_body).defs = new declarations(); - for (int j = 0; j < ((ArrayList)LRParser.GetReductionSyntaxNode(3)).Count; j++) - ((block)pr.proc_body).defs.defs.Add((procedure_definition)((ArrayList)LRParser.GetReductionSyntaxNode(3))[j]); - ArrayList ar = ((ArrayList)let_where_funcs_main[let_where_funcs_main.Count - 1]).Clone() as ArrayList; - for (int j = 0; j < ar.Count; j++) - last_where_funcs.Add(ar[j]); - let_where_funcs_main.RemoveAt(let_where_funcs_main.Count - 1); - } - ///////////////////////////lambda - if (((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count > 0) - { - if (((block)pr.proc_body).defs == null) - ((block)pr.proc_body).defs = new declarations(); - for (int i = 0; i < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; i++) - ((block)pr.proc_body).defs.defs.Add((procedure_definition)((ArrayList)lambda_stack[lambda_stack.Count - 1])[i]); - for (int ii = 0; ii < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; ii++) - _function_lambda_definitions.RemoveAt(_function_lambda_definitions.Count - 1); - } - lambda_stack.RemoveAt(lambda_stack.Count - 1); - /////////////////////////// - let_funcs.Add(pr); - let_where_funcs.Add(pr); - //let_funcs1.Add(_procedure_definition); - //_function_lambda_definitions.Add(_procedure_definition);//////////////// - let_fact_params.Add(_procedure_definition.lambda_name); - return new ident(((ident)LRParser.GetReductionSyntaxNode(0)).name); -} - case (int)RuleConstants.RULE_GUARD_BODY_LIST: - // ::= - { - ArrayList ar = (ArrayList)LRParser.GetReductionSyntaxNode(0); - ArrayList ar_main = new ArrayList(); - ar_main.Add(ar); - return ar_main; - } - case (int)RuleConstants.RULE_GUARD_BODY_LIST2: - // ::= - { - ArrayList ar_main = (ArrayList)LRParser.GetReductionSyntaxNode(0); - ar_main.Add(LRParser.GetReductionSyntaxNode(1)); - return ar_main; - } - case (int)RuleConstants.RULE_GUARD_BODY_TKASSIGN: - // ::= 'tkAssign' - { - ArrayList ar = new ArrayList(); - ar.Add(LRParser.GetReductionSyntaxNode(0)); - ar.Add(LRParser.GetReductionSyntaxNode(2)); - return ar; - } - case (int)RuleConstants.RULE_VARIABLE_TKIDENT: -// ::= 'tkIdent' -{ - if (token_where==1) - token_where = 2; - if (((ident)LRParser.GetReductionSyntaxNode(0)).name=="pi") - { - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.names.Add(idtype1); - expression_list ell = new expression_list(); - ell.expressions.Add(LRParser.GetReductionSyntaxNode(0) as expression); - ell.expressions.Add(new string_const("real") as expression); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, ell, false, null); - return newexpr; - } - else - return LRParser.GetReductionSyntaxNode(0); -} - case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKIDENT_TKROUNDCLOSE: -// ::= 'tkRoundOpen' 'tkIdent' 'tkRoundClose' -{ - expression_list el = LRParser.GetReductionSyntaxNode(2) as expression_list; - ////////////////////////////for curring - int n = el.expressions.Count; - int fld_params_count = find_count_params(((ident)LRParser.GetReductionSyntaxNode(1)).name); - //////////////////////////// - if (fld_params_count - n > 0) - { - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(2); - expression_list _params = new expression_list(); - expression_list _params_el = new expression_list(); - for (int i = 0; i < list_params1.Count; i++) - if (list_params1[i] is ident) - { - _params.expressions.Add(new ident(((ident)list_params1[i]).name)); - _params_el.expressions.Add(new ident(((ident)list_params1[i]).name)); - } - for (int i = 1; i <= fld_params_count - n; i++) - _expression_list.expressions.Add(new ident("$$" + i)); - for (int i = 1; i <= fld_params_count - n; i++) - { - _params.expressions.Add(new ident("$$" + i)); - _params_el.expressions.Add(new ident("$$" + i)); - } - method_call _method_call = new method_call(_expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)LRParser.GetReductionSyntaxNode(1); - - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - assign _assign = new assign((addressed_value)new ident("result"), _method_call as expression, _op_type_node.type); - - statement_list _statement_list = new statement_list(); - _statement_list.subnodes.Add(_assign); - //////////////////////////// - ident_list i_l = new ident_list(); - for (int i = 1; i <= fld_params_count - n; i++) - i_l.idents.Add(new ident("$$" + i)); - ///////////////////////////// - formal_parameters _formal_parametres = new formal_parameters(); - for (int i = 0; i < _params.expressions.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = (ident)_params.expressions[i]; - _ident_list.idents.Add(id); - named_type_reference _named_type_reference = new named_type_reference(); - - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference); - - _formal_parametres.params_list.Add(_typed_parametres); - } - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = i_l; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = _params_el; - _procedure_definition.lambda_name = "__lambda__" + lambda_num; - //new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, i_l, null, _params_el, "lambda" + lambda_num); - object rt = _expression_list; - _procedure_definition.proc_body = _statement_list; - _function_lambda_definitions_after.Add(_procedure_definition); - _function_lambda_definitions_after.Add(((ident)LRParser.GetReductionSyntaxNode(1)).name);//////////////// - last_function_lambda_definitions.Add(_procedure_definition); - return new ident(_procedure_definition.lambda_name); - } - else - { - method_call _method_call = null; - string name = ((ident)LRParser.GetReductionSyntaxNode(1)).name; - if (name == "cos" || name == "sin" || name == "tan") - { - bin_expr b_e = new bin_expr(); - b_e.operation_type = Operators.Plus; - b_e.left = el.expressions[0]; - named_type_reference _named_type_reference2 = new named_type_reference(); - ident idtype2 = new ident("datatype"); - _named_type_reference2.names.Add(idtype2); - expression_list ell2 = new expression_list(); - ell2.expressions.Add(new double_const(0.0)); - ell2.expressions.Add(new string_const("real") as expression); - named_type_reference ntr2 = _named_type_reference2; - b_e.right = new new_expr(ntr2, ell2, false, null); - ////////////////////////////////// - dot_node d_n = new dot_node(); - d_n.left = (addressed_value)b_e; - d_n.right = new ident("ob"); - expression_list el1 = new expression_list(); - el1.expressions.Add(d_n); - method_call m_c = new method_call(el1); - m_c.dereferencing_value = new ident("real"); - /////////////////////////////////// - expression_list el2 = new expression_list(); - el2.expressions.Add(m_c); - _method_call = new method_call(el2); - _method_call.dereferencing_value = (addressed_value)LRParser.GetReductionSyntaxNode(1); - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.names.Add(idtype1); - expression_list ell = new expression_list(); - ell.expressions.Add(_method_call as expression); - ell.expressions.Add(new string_const("real") as expression); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, ell, false, null); - return newexpr; - } - else - { - _method_call = new method_call(el); - - if (_method_call is dereference) - { - ((dereference)_method_call).dereferencing_value = (addressed_value)LRParser.GetReductionSyntaxNode(1); - parsertools.create_source_context(_method_call, LRParser.GetReductionSyntaxNode(1), _method_call); - } - list_method_calls.Add(_method_call); - last_list_method_calls.Add(_method_call); - last_list_method_calls_lambda.Add(_method_call); - return _method_call; - } - - } - } - //case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKROUNDCLOSE_TKROUNDOPEN_TKROUNDCLOSE: -// ::= 'tkRoundOpen' 'tkRoundClose' 'tkRoundOpen' 'tkRoundClose' - case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKROUNDCLOSE: -// ::= 'tkRoundOpen' 'tkRoundClose' -{ - if (LRParser.GetReductionSyntaxNode(1) is ident) - { - expression_list el = LRParser.GetReductionSyntaxNode(2) as expression_list; - int n = el.expressions.Count; - int fld_params_count = find_count_params_lambda(((ident)LRParser.GetReductionSyntaxNode(1)).name); - if (_function_lambda_definitions_after.Count > 0) - { - function_lambda_definition fld = (function_lambda_definition)_function_lambda_definitions_after[_function_lambda_definitions_after.Count - 2]; - for (int i = 0; i < fld.formal_parameters.params_list.Count; i++) - if (!fld.formal_parameters.params_list[i].idents.idents[0].name.Contains("$")) - n++; - } - //////////////////////////// - if (fld_params_count - n > 0) - { - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(2); - expression_list _params = new expression_list(); - expression_list _params_el = new expression_list(); - for (int i = 0; i < list_params1.Count; i++) - if (list_params1[i] is ident) - { - _params.expressions.Add(new ident(((ident)list_params1[i]).name)); - _params_el.expressions.Add(new ident(((ident)list_params1[i]).name)); - } - for (int i = 1; i <= fld_params_count - n; i++) - _expression_list.expressions.Add(new ident("$$" + i)); - for (int i = 1; i <= fld_params_count - n; i++) - { - _params.expressions.Add(new ident("$$" + i)); - _params_el.expressions.Add(new ident("$$" + i)); - } - method_call _method_call = new method_call(_expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)LRParser.GetReductionSyntaxNode(1); - - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - assign _assign = new assign((addressed_value)new ident("result"), _method_call as expression, _op_type_node.type); - - statement_list _statement_list = new statement_list(); - _statement_list.subnodes.Add(_assign); - //////////////////////////// - ident_list i_l = new ident_list(); - for (int i = 1; i <= fld_params_count - n; i++) - i_l.idents.Add(new ident("$$" + i)); - ///////////////////////////// - formal_parameters _formal_parametres = new formal_parameters(); - for (int i = 0; i < _params.expressions.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = (ident)_params.expressions[i]; - _ident_list.idents.Add(id); - named_type_reference _named_type_reference = new named_type_reference(); - - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference); - - _formal_parametres.params_list.Add(_typed_parametres); - } - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = i_l; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = _params_el; - _procedure_definition.lambda_name = "__lambda__" + lambda_num; - //new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, i_l, null, _params_el, "lambda" + lambda_num); - object rt = _expression_list; - _procedure_definition.proc_body = _statement_list; - _function_lambda_definitions_after.Add(_procedure_definition); - _function_lambda_definitions_after.Add(((ident)LRParser.GetReductionSyntaxNode(1)).name);//////////////// - last_function_lambda_definitions.Add(_procedure_definition); - return new ident(_procedure_definition.lambda_name); - } - else - { - for (int i = list_params1.Count - 1; i >= 0; i--) - if (list_params1[i] is ident) - { - el.expressions.Insert(0, (new ident(((ident)list_params1[i]).name))); - } - - method_call _method_call = new method_call(el); - if (_method_call is dereference) - { - ((dereference)_method_call).dereferencing_value = (addressed_value)LRParser.GetReductionSyntaxNode(1); - } - list_method_calls.Add(_method_call); - last_list_method_calls.Add(_method_call); - last_list_method_calls_lambda.Add(_method_call); - return _method_call; - } - } - else - { - if (LRParser.GetReductionSyntaxNode(1) is method_call) - { - method_call mc = LRParser.GetReductionSyntaxNode(1) as method_call; - expression_list el = LRParser.GetReductionSyntaxNode(2) as expression_list; - expression_list _expression_list = new expression_list(); - for (int i = 0; i < mc.parameters.expressions.Count; i++) - _expression_list.expressions.Add(mc.parameters.expressions[i]); - for (int i = 0; i < el.expressions.Count; i++) - _expression_list.expressions.Add(el.expressions[i]); - method_call _method_call = new method_call(_expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)(new ident(((ident)mc.dereferencing_value).name)); - list_method_calls.RemoveAt(list_method_calls.Count - 1); - list_method_calls.Add(_method_call); - last_list_method_calls.Add(_method_call); - last_list_method_calls_lambda.RemoveAt(last_list_method_calls_lambda.Count - 1); - last_list_method_calls_lambda.Add(_method_call); - return _method_call; - } - else - return null; - } -} - case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE: -// ::= 'tkRoundtkOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' -{ - expression_list el = LRParser.GetReductionSyntaxNode(4) as expression_list; - ////////////////////////////for curring - int n = el.expressions.Count; - int fld_params_count = find_count_params(((ident)LRParser.GetReductionSyntaxNode(2)).name); - //////////////////////////// - if (fld_params_count - n > 0) - { - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(4); - expression_list _params = new expression_list(); - expression_list _params_el = new expression_list(); - for (int i = 0; i < list_params1.Count; i++) - if (list_params1[i] is ident) - { - _params.expressions.Add(new ident(((ident)list_params1[i]).name)); - _params_el.expressions.Add(new ident(((ident)list_params1[i]).name)); - } - for (int i = 1; i <= fld_params_count - n; i++) - _expression_list.expressions.Insert(0,new ident("$$" + i)); - for (int i = 1; i <= fld_params_count - n; i++) - { - _params.expressions.Add(new ident("$$" + i)); - _params_el.expressions.Add(new ident("$$" + i)); - } - method_call _method_call = new method_call(_expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)LRParser.GetReductionSyntaxNode(2); - - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - assign _assign = new assign((addressed_value)new ident("result"), _method_call as expression, _op_type_node.type); - - statement_list _statement_list = new statement_list(); - _statement_list.subnodes.Add(_assign); - //////////////////////////// - ident_list i_l = new ident_list(); - for (int i = 1; i <= fld_params_count - n; i++) - i_l.idents.Add(new ident("$$" + i)); - ///////////////////////////// - formal_parameters _formal_parametres = new formal_parameters(); - for (int i = 0; i < _params.expressions.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = (ident)_params.expressions[i]; - _ident_list.idents.Add(id); - named_type_reference _named_type_reference = new named_type_reference(); - - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference); - - _formal_parametres.params_list.Add(_typed_parametres); - } - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = i_l; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = _params_el; - _procedure_definition.lambda_name = "__lambda__" + lambda_num; - //new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, i_l, null, _params_el, "lambda" + lambda_num); - object rt = _expression_list; - _procedure_definition.proc_body = _statement_list; - _function_lambda_definitions_after.Add(_procedure_definition); - _function_lambda_definitions_after.Add(((ident)LRParser.GetReductionSyntaxNode(2)).name);//////////////// - last_function_lambda_definitions.Add(_procedure_definition); - return new ident(_procedure_definition.lambda_name); - } - else - { - method_call _method_call = null; - string name = ((ident)LRParser.GetReductionSyntaxNode(2)).name; - _method_call = new method_call(el); - if (_method_call is dereference) - { - ((dereference)_method_call).dereferencing_value = (addressed_value)LRParser.GetReductionSyntaxNode(2); - parsertools.create_source_context(_method_call, LRParser.GetReductionSyntaxNode(2), _method_call); - } - list_method_calls.Add(_method_call); - last_list_method_calls.Add(_method_call); - last_list_method_calls_lambda.Add(_method_call); - return _method_call; - } -} - //case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE_TKROUNDOPEN_TKROUNDCLOSE: -// ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' 'tkRoundOpen' 'tkRoundClose' - /*case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE2: -// ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' -{ - ////////////////////////////////////////////////////////ident_params - ident _ident = (ident)LRParser.GetReductionSyntaxNode(2); - expression_list el = new expression_list(); - el.expressions.Add(((expression_list)LRParser.GetReductionSyntaxNode(6)).expressions[0]); - el.expressions.Add(((expression_list)LRParser.GetReductionSyntaxNode(4)).expressions[0]); - //////////////////////////////////////////////////////// - //expression_list el = LRParser.GetReductionSyntaxNode(2) as expression_list; - ////////////////////////////for curring - int n = el.expressions.Count; - int fld_params_count = find_count_params(_ident.name); - //////////////////////////// - if (fld_params_count - n > 0) - { - expression_list _expression_list = el; - expression_list _params = new expression_list(); - expression_list _params_el = new expression_list(); - for (int i = 0; i < list_params1.Count; i++) - if (list_params1[i] is ident) - { - _params.expressions.Add(new ident(((ident)list_params1[i]).name)); - _params_el.expressions.Add(new ident(((ident)list_params1[i]).name)); - } - for (int i = 1; i <= fld_params_count - n; i++) - _expression_list.expressions.Add(new ident("$$" + i)); - for (int i = 1; i <= fld_params_count - n; i++) - { - _params.expressions.Add(new ident("$$" + i)); - _params_el.expressions.Add(new ident("$$" + i)); - } - method_call _method_call = new method_call(_expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_ident; - - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - assign _assign = new assign((addressed_value)new ident("result"), _method_call as expression, _op_type_node.type); - - statement_list _statement_list = new statement_list(); - _statement_list.subnodes.Add(_assign); - //////////////////////////// - ident_list i_l = new ident_list(); - for (int i = 1; i <= fld_params_count - n; i++) - i_l.idents.Add(new ident("$$" + i)); - ///////////////////////////// - formal_parameters _formal_parametres = new formal_parameters(); - for (int i = 0; i < _params.expressions.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = (ident)_params.expressions[i]; - _ident_list.idents.Add(id); - named_type_reference _named_type_reference = new named_type_reference(); - - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference); - - _formal_parametres.params_list.Add(_typed_parametres); - } - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = i_l; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = _params_el; - _procedure_definition.lambda_name = "__lambda__" + lambda_num; - //new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, i_l, null, _params_el, "lambda" + lambda_num); - object rt = _expression_list; - _procedure_definition.proc_body = _statement_list; - _function_lambda_definitions_after.Add(_procedure_definition); - _function_lambda_definitions_after.Add(_ident.name);//////////////// - last_function_lambda_definitions.Add(_procedure_definition); - return new ident(_procedure_definition.lambda_name); - } - else - { - method_call _method_call = new method_call(el); - - if (_method_call is dereference) - { - ((dereference)_method_call).dereferencing_value = (addressed_value)_ident; - parsertools.create_source_context(_method_call, _ident, _method_call); - } - list_method_calls.Add(_method_call); - last_list_method_calls.Add(_method_call); - last_list_method_calls_lambda.Add(_method_call); - return _method_call; - - } -}*/ - /*case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE: -// ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' -{ - expression_list el = LRParser.GetReductionSyntaxNode(1) as expression_list; - ////////////////////////////for curring - int n = el.expressions.Count; - int fld_params_count = find_count_params(((ident)LRParser.GetReductionSyntaxNode(3)).name); - //////////////////////////// - if (fld_params_count - n > 0) - { - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(1); - expression_list _params = new expression_list(); - expression_list _params_el = new expression_list(); - for (int i = 0; i < list_params1.Count; i++) - if (list_params1[i] is ident) - { - _params.expressions.Add(new ident(((ident)list_params1[i]).name)); - _params_el.expressions.Add(new ident(((ident)list_params1[i]).name)); - } - for (int i = 1; i <= fld_params_count - n; i++) - _expression_list.expressions.Add(new ident("$$" + i)); - for (int i = 1; i <= fld_params_count - n; i++) - { - _params.expressions.Add(new ident("$$" + i)); - _params_el.expressions.Add(new ident("$$" + i)); - } - method_call _method_call = new method_call(_expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)LRParser.GetReductionSyntaxNode(3); - - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - assign _assign = new assign((addressed_value)new ident("result"), _method_call as expression, _op_type_node.type); - - statement_list _statement_list = new statement_list(); - _statement_list.subnodes.Add(_assign); - //////////////////////////// - ident_list i_l = new ident_list(); - for (int i = 1; i <= fld_params_count - n; i++) - i_l.idents.Add(new ident("$$" + i)); - ///////////////////////////// - formal_parameters _formal_parametres = new formal_parameters(); - for (int i = 0; i < _params.expressions.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = (ident)_params.expressions[i]; - _ident_list.idents.Add(id); - named_type_reference _named_type_reference = new named_type_reference(); - - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference); - - _formal_parametres.params_list.Add(_typed_parametres); - } - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, i_l, null, _params_el, "lambda" + lambda_num); - object rt = _expression_list; - _procedure_definition.proc_body = _statement_list; - _function_lambda_definitions_after.Add(_procedure_definition); - _function_lambda_definitions_after.Add(((ident)LRParser.GetReductionSyntaxNode(3)).name);//////////////// - last_function_lambda_definitions.Add(_procedure_definition); - return new ident(_procedure_definition.lambda_name); - } - else - { - method_call _method_call = null; - string name = ((ident)LRParser.GetReductionSyntaxNode(3)).name; - _method_call = new method_call(el); - if (_method_call is dereference) - { - ((dereference)_method_call).dereferencing_value = (addressed_value)LRParser.GetReductionSyntaxNode(3); - parsertools.create_source_context(_method_call, LRParser.GetReductionSyntaxNode(3), _method_call); - } - list_method_calls.Add(_method_call); - last_list_method_calls.Add(_method_call); - last_list_method_calls_lambda.Add(_method_call); - return _method_call; - } -} - case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE_TKROUNDOPEN_TKROUNDCLOSE: -// ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' 'tkRoundOpen' 'tkRoundClose' -{ - ////////////////////////////////////////////////////////ident_params - ident _ident = (ident)LRParser.GetReductionSyntaxNode(3); - expression_list el = new expression_list(); - el.expressions.Add(((expression_list)LRParser.GetReductionSyntaxNode(1)).expressions[0]); - el.expressions.Add(((expression_list)LRParser.GetReductionSyntaxNode(7)).expressions[0]); - //////////////////////////////////////////////////////// - //expression_list el = LRParser.GetReductionSyntaxNode(2) as expression_list; - ////////////////////////////for curring - int n = el.expressions.Count; - int fld_params_count = find_count_params(_ident.name); - //////////////////////////// - if (fld_params_count - n > 0) - { - expression_list _expression_list = el; - expression_list _params = new expression_list(); - expression_list _params_el = new expression_list(); - for (int i = 0; i < list_params1.Count; i++) - if (list_params1[i] is ident) - { - _params.expressions.Add(new ident(((ident)list_params1[i]).name)); - _params_el.expressions.Add(new ident(((ident)list_params1[i]).name)); - } - for (int i = 1; i <= fld_params_count - n; i++) - _expression_list.expressions.Add(new ident("$$" + i)); - for (int i = 1; i <= fld_params_count - n; i++) - { - _params.expressions.Add(new ident("$$" + i)); - _params_el.expressions.Add(new ident("$$" + i)); - } - method_call _method_call = new method_call(_expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_ident; - - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - assign _assign = new assign((addressed_value)new ident("result"), _method_call as expression, _op_type_node.type); - - statement_list _statement_list = new statement_list(); - _statement_list.subnodes.Add(_assign); - //////////////////////////// - ident_list i_l = new ident_list(); - for (int i = 1; i <= fld_params_count - n; i++) - i_l.idents.Add(new ident("$$" + i)); - ///////////////////////////// - formal_parameters _formal_parametres = new formal_parameters(); - for (int i = 0; i < _params.expressions.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = (ident)_params.expressions[i]; - _ident_list.idents.Add(id); - named_type_reference _named_type_reference = new named_type_reference(); - - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference); - - _formal_parametres.params_list.Add(_typed_parametres); - } - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, i_l, null, _params_el, "lambda" + lambda_num); - object rt = _expression_list; - _procedure_definition.proc_body = _statement_list; - _function_lambda_definitions_after.Add(_procedure_definition); - _function_lambda_definitions_after.Add(_ident.name);//////////////// - last_function_lambda_definitions.Add(_procedure_definition); - return new ident(_procedure_definition.lambda_name); - } - else - { - method_call _method_call = new method_call(el); - - if (_method_call is dereference) - { - ((dereference)_method_call).dereferencing_value = (addressed_value)_ident; - parsertools.create_source_context(_method_call, _ident, _method_call); - } - list_method_calls.Add(_method_call); - last_list_method_calls.Add(_method_call); - last_list_method_calls_lambda.Add(_method_call); - return _method_call; - - } -}*/ - /*case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE: - // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - return null; - case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE_TKROUNDOPEN_TKROUNDCLOSE: - // ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' 'tkRoundOpen' 'tkRoundClose' - return null;*/ - case (int)RuleConstants.RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE: -// ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' -{ - ArrayList ar = new ArrayList(); - ar.Add(LRParser.GetReductionSyntaxNode(3)); - ar.Add(LRParser.GetReductionSyntaxNode(1)); - ar.Add(LRParser.GetReductionSyntaxNode(5)); - return ar; -} - case (int)RuleConstants.RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE2: -// ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' -{ - expression_list el = new expression_list(); - el.expressions.Add((expression)LRParser.GetReductionSyntaxNode(1)); - ////////////////////////////for curring - int n = el.expressions.Count; - int fld_params_count = find_count_params(((ident)LRParser.GetReductionSyntaxNode(3)).name); - //////////////////////////// - if (fld_params_count - n > 0) - { - expression_list _expression_list = new expression_list(); - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(1)); - expression_list _params = new expression_list(); - expression_list _params_el = new expression_list(); - for (int i = 0; i < list_params1.Count; i++) - if (list_params1[i] is ident) - { - _params.expressions.Add(new ident(((ident)list_params1[i]).name)); - _params_el.expressions.Add(new ident(((ident)list_params1[i]).name)); - } - for (int i = 1; i <= fld_params_count - n; i++) - _expression_list.expressions.Add(new ident("$$" + i)); - for (int i = 1; i <= fld_params_count - n; i++) - { - _params.expressions.Add(new ident("$$" + i)); - _params_el.expressions.Add(new ident("$$" + i)); - } - method_call _method_call = new method_call(_expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)LRParser.GetReductionSyntaxNode(3); - - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - assign _assign = new assign((addressed_value)new ident("result"), _method_call as expression, _op_type_node.type); - - statement_list _statement_list = new statement_list(); - _statement_list.subnodes.Add(_assign); - //////////////////////////// - ident_list i_l = new ident_list(); - for (int i = 1; i <= fld_params_count - n; i++) - i_l.idents.Add(new ident("$$" + i)); - ///////////////////////////// - formal_parameters _formal_parametres = new formal_parameters(); - for (int i = 0; i < _params.expressions.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = (ident)_params.expressions[i]; - _ident_list.idents.Add(id); - named_type_reference _named_type_reference = new named_type_reference(); - - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference); - - _formal_parametres.params_list.Add(_typed_parametres); - } - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = i_l; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = _params_el; - _procedure_definition.lambda_name = "__lambda__" + lambda_num; - //new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, i_l, null, _params_el, "lambda" + lambda_num); - object rt = _expression_list; - _procedure_definition.proc_body = _statement_list; - _function_lambda_definitions_after.Add(_procedure_definition); - _function_lambda_definitions_after.Add(((ident)LRParser.GetReductionSyntaxNode(3)).name);//////////////// - last_function_lambda_definitions.Add(_procedure_definition); - return new ident(_procedure_definition.lambda_name); - } - else - { - method_call _method_call = null; - string name = ((ident)LRParser.GetReductionSyntaxNode(3)).name; - _method_call = new method_call(el); - if (_method_call is dereference) - { - ((dereference)_method_call).dereferencing_value = (addressed_value)LRParser.GetReductionSyntaxNode(3); - parsertools.create_source_context(_method_call, LRParser.GetReductionSyntaxNode(3), _method_call); - } - list_method_calls.Add(_method_call); - last_list_method_calls.Add(_method_call); - last_list_method_calls_lambda.Add(_method_call); - return _method_call; - } -} - //case (int)RuleConstants.RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE_TKROUNDOPEN_TKROUNDCLOSE: -// ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' 'tkRoundOpen' 'tkRoundClose' - //case (int)RuleConstants.RULE_INFIX_EXPR_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE3: -// ::= 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' - case (int)RuleConstants.RULE_INFIX_EXPR_TKROUNDOPEN_TKROUNDOPEN_TKQUOTE_TKIDENT_TKQUOTE_TKROUNDCLOSE_TKROUNDCLOSE: -// ::= 'tkRoundOpen' 'tkRoundOpen' 'tkQuote' 'tkIdent' 'tkQuote' 'tkRoundClose' 'tkRoundClose' -{ - ////////////////////////////////////////////////////////ident_params - ident _ident = (ident)LRParser.GetReductionSyntaxNode(4); - expression_list el = new expression_list(); - el.expressions.Add((expression)LRParser.GetReductionSyntaxNode(2)); - el.expressions.Add(((expression_list)LRParser.GetReductionSyntaxNode(7)).expressions[0]); - //////////////////////////////////////////////////////// - //expression_list el = LRParser.GetReductionSyntaxNode(2) as expression_list; - ////////////////////////////for curring - int n = el.expressions.Count; - int fld_params_count = find_count_params(_ident.name); - //////////////////////////// - if (fld_params_count - n > 0) - { - expression_list _expression_list = el; - expression_list _params = new expression_list(); - expression_list _params_el = new expression_list(); - for (int i = 0; i < list_params1.Count; i++) - if (list_params1[i] is ident) - { - _params.expressions.Add(new ident(((ident)list_params1[i]).name)); - _params_el.expressions.Add(new ident(((ident)list_params1[i]).name)); - } - for (int i = 1; i <= fld_params_count - n; i++) - _expression_list.expressions.Add(new ident("$$" + i)); - for (int i = 1; i <= fld_params_count - n; i++) - { - _params.expressions.Add(new ident("$$" + i)); - _params_el.expressions.Add(new ident("$$" + i)); - } - method_call _method_call = new method_call(_expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_ident; - - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - assign _assign = new assign((addressed_value)new ident("result"), _method_call as expression, _op_type_node.type); - - statement_list _statement_list = new statement_list(); - _statement_list.subnodes.Add(_assign); - //////////////////////////// - ident_list i_l = new ident_list(); - for (int i = 1; i <= fld_params_count - n; i++) - i_l.idents.Add(new ident("$$" + i)); - ///////////////////////////// - formal_parameters _formal_parametres = new formal_parameters(); - for (int i = 0; i < _params.expressions.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = (ident)_params.expressions[i]; - _ident_list.idents.Add(id); - named_type_reference _named_type_reference = new named_type_reference(); - - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference); - - _formal_parametres.params_list.Add(_typed_parametres); - } - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = i_l; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = _params_el; - _procedure_definition.lambda_name = "__lambda__" + lambda_num; - //new function_lambda_definition(_formal_parametres, (type_definition)_named_type_reference1, i_l, null, _params_el, "lambda" + lambda_num); - object rt = _expression_list; - _procedure_definition.proc_body = _statement_list; - _function_lambda_definitions_after.Add(_procedure_definition); - _function_lambda_definitions_after.Add(_ident.name);//////////////// - last_function_lambda_definitions.Add(_procedure_definition); - return new ident(_procedure_definition.lambda_name); - } - else - { - method_call _method_call = new method_call(el); - - if (_method_call is dereference) - { - ((dereference)_method_call).dereferencing_value = (addressed_value)_ident; - parsertools.create_source_context(_method_call, _ident, _method_call); - } - list_method_calls.Add(_method_call); - last_list_method_calls.Add(_method_call); - last_list_method_calls_lambda.Add(_method_call); - return _method_call; - - } -} - case (int)RuleConstants.RULE_MULTOP_TKSTAR: - // ::= 'tkStar' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_MULTOP_TKSLASH : - // ::= 'tkSlash' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ADDOP_TKPLUS : - // ::= 'tkPlus' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ADDOP_TKMINUS : - // ::= 'tkMinus' -return LRParser.GetReductionSyntaxNode(0); - /*case (int)RuleConstants.RULE_STMT_TKPRINT : - // ::= 'tkPrint' -{ - if (!(LRParser.GetReductionSyntaxNode(1) is function_lambda_call)) - { - dot_node _dot_node = new dot_node(null, (addressed_value)(new ident("print"))); - _dot_node.left = (addressed_value)LRParser.GetReductionSyntaxNode(1); - object o = null; - method_call _method_call = new method_call(o as expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_dot_node; - procedure_call _procedure_call = new procedure_call(_method_call as addressed_value); - return _procedure_call; - } - else - { - function_lambda_call flc = LRParser.GetReductionSyntaxNode(1) as function_lambda_call; - method_call _method_call1 = new SyntaxTree.method_call(flc.parameters); - ((dereference)_method_call1).dereferencing_value = (addressed_value)(new ident(flc.f_lambda_def.lambda_name)); - - dot_node _dot_node = new dot_node(null, (addressed_value)(new ident("print"))); - _dot_node.left = (addressed_value)_method_call1; - object o = null; - method_call _method_call = new method_call(o as expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_dot_node; - procedure_call _procedure_call = new procedure_call(_method_call as addressed_value); - return _procedure_call; - } -}*/ - case (int)RuleConstants.RULE_STMT_TKIDENT_TKARROWGEN_TKIDENT: -// ::= 'tkIdent' 'tkArrowGen' 'tkIdent' -{ - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ident_list il = new ident_list(); - il.idents.Add((ident)LRParser.GetReductionSyntaxNode(0)); - //////////////////////////////////////// - named_type_reference _named_type_reference2 = new named_type_reference(); - _named_type_reference2.names.Add(new SyntaxTree.ident("datatype")); - expression_list ell = new expression_list(); - //////////////////////////////////////// - dot_node _dot_node = new dot_node(null, (addressed_value)LRParser.GetReductionSyntaxNode(2)/*(new ident("getChar"))*/); - /////***************** - named_type_reference _named_type_reference3 = new named_type_reference(); - _named_type_reference3.names.Add(new SyntaxTree.ident("datatype")); - expression_list ell3 = new expression_list(); - ell3.expressions.Add(new string_const("$null")); - ell3.expressions.Add(new string_const("string") as expression); - named_type_reference ntr3 = _named_type_reference2; - new_expr ne3= new new_expr(ntr3, ell3, false, null); - /////***************** - _dot_node.left = (addressed_value)ne3; - object o = null; - method_call _method_call = new method_call(o as expression_list); - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)_dot_node;//LRParser.GetReductionSyntaxNode(2); - ///////////////////////////////// - /*ell.expressions.Add(_method_call); - ell.expressions.Add(new string_const("string") as expression); - named_type_reference ntr = _named_type_reference2; - new_expr ne = new new_expr(ntr, ell, false, null);*/ - //////////////////////////////////////// - var_def_statement _var_def_statement = new var_def_statement(il, (type_definition)_named_type_reference1, _method_call, definition_attribute.None, false); - var_statement _var_statement = new var_statement(_var_def_statement); - - return _var_statement; -} - case (int)RuleConstants.RULE_STMT_TKIF_TKTHEN_TKELSE: - // ::= 'tkIf' 'tkThen' 'tkElse' -{ - if_node _if_node = new if_node(null, (statement)LRParser.GetReductionSyntaxNode(3), (statement)LRParser.GetReductionSyntaxNode(5)); - parsertools.create_source_context(_if_node, LRParser.GetReductionSyntaxNode(4), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(5), LRParser.GetReductionSyntaxNode(4))); - - _if_node.condition = _ob((expression)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_if_node, LRParser.GetReductionSyntaxNode(0), _if_node); - statement_list sl = new statement_list(); - sl.subnodes.Add(_if_node); - return sl; - } - case (int)RuleConstants.RULE_STMT_TKCASE_TKROUNDOPEN_TKROUNDCLOSE_TKOF : - // ::= 'tkCase' 'tkRoundOpen' 'tkRoundClose' 'tkOf' -return null; - case (int)RuleConstants.RULE_STMT_TKDO_TKFIGUREOPEN_TKSEMICOLON_TKFIGURECLOSE : - // ::= 'tkDo' 'tkFigureOpen' 'tkSemiColon' 'tkFigureClose' -return LRParser.GetReductionSyntaxNode(2); - case (int)RuleConstants.RULE_STMT_TKDO: -// ::= 'tkDo' -{ - return LRParser.GetReductionSyntaxNode(1); -} - case (int)RuleConstants.RULE_STMT_TKRETURN : - // ::= 'tkReturn' -{ - statement_list _statement_list = new statement_list(); - - ident id = new ident("result"); - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - assign _assign = new assign((addressed_value)id, LRParser.GetReductionSyntaxNode(1) as expression, _op_type_node.type); - parsertools.create_source_context(_assign, id, LRParser.GetReductionSyntaxNode(1)); - - _statement_list.subnodes.Add((statement)_assign); - parsertools.assign_source_context(_statement_list, _assign); - return _statement_list; - } - case (int)RuleConstants.RULE_STMT : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CASE_VARIANTS : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CASE_VARIANTS_TKSPLIT: -// ::= tkSplit - return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CASE_VARIANT_TKROUNDOPEN_TKROUNDCLOSE_TKARROW : - // ::= 'tkRoundOpen' 'tkRoundClose' 'tkArrow' -{ - param_value_list.Add(LRParser.GetReductionSyntaxNode(1)); - body_variant_list.Add(LRParser.GetReductionSyntaxNode(4)); - return null; - } - case (int)RuleConstants.RULE_PARAMS1: -// ::= -{ - //let_flag.Add(1); - bool b = false; - if (list_param.Count == 1) - { - list_params_temp.Add(new ArrayList()); - let_where_list_params.Add(new ArrayList());// - if (list_param[0] is new_expr && ((string_const)((new_expr)list_param[0]).params_list.expressions[1]).Value == "empty") - b = true; - list_param.Clear(); - } - else - { - list_params_temp.Add(list_param.Clone()); - let_where_list_params.Add(list_param.Clone());// - } - expression_list _expression_list = new expression_list(); - if (list_param.Count == 0) - { - if (b) - { - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - expression_list el = new expression_list(); - el.expressions.Add(new int32_const(0)); - literal lt; - string text = "empty_list"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false, null); - _expression_list.expressions.Add(newexpr); - } - else - { - _expression_list.source_context = ((expression)LRParser.GetReductionSyntaxNode(0)).source_context; - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(0)); - } - } - else - { - ident id = new ident(); - for (int i = 0; i < list_param.Count; i++) - { - if (list_param[i] is ident) - id.name += ((ident)list_param[i]).name; - else - { - errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "èäåíòèôèêàòîð")); - return null; - } - } - _expression_list.source_context = ((expression)id).source_context; - _expression_list.expressions.Add((expression)id); - list_param.Clear(); - } - list_params1.Clear(); - for (int i = 0; i < _expression_list.expressions.Count; i++) - list_params1.Add(_expression_list.expressions[i]); - last_list_method_calls_lambda.Clear(); - return _expression_list; -} - case (int)RuleConstants.RULE_PARAMS1_TKCOMMA: -// ::= 'tkComma' -{ - bool b = false; - if (list_param.Count == 1) - { - list_params_temp.Add(new ArrayList()); - let_where_list_params.Add(new ArrayList());// - if (list_param[0] is new_expr && ((string_const)((new_expr)list_param[0]).params_list.expressions[1]).Value == "empty") - b = true; - list_param.Clear(); - } - else - { - list_params_temp.Add(list_param.Clone()); - let_where_list_params.Add(list_param.Clone());// - } - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(0); - if (list_param.Count == 0) - { - if (!b) - { - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(2) as expression); - } - else - { - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - expression_list el = new expression_list(); - el.expressions.Add(new int32_const(0)); - literal lt; - string text = "empty_list"; - lt = new string_const(text); - el.expressions.Add(lt as expression); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, el, false, null); - _expression_list.expressions.Add(newexpr); - } - } - else - { - ident id = new ident(); - for (int i = 0; i < list_param.Count; i++) - { - if (list_param[i] is ident) - id.name += ((ident)list_param[i]).name; - else - { - errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "èäåíòèôèêàòîð")); - return null; - } - } - _expression_list.expressions.Add((expression)id); - list_param.Clear(); - } - list_params1.Clear(); - for (int i = 0; i < _expression_list.expressions.Count; i++) - list_params1.Add(_expression_list.expressions[i]); - last_list_method_calls_lambda.Clear(); - return _expression_list; -} - - case (int)RuleConstants.RULE_FUNC_CALL : - // ::= -{ - statement_list _statement_list = new statement_list(); - - ident id = new ident("result"); - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - expression from = (expression)LRParser.GetReductionSyntaxNode(0); - if (LRParser.GetReductionSyntaxNode(0) is ident && - (find_func_name(((ident)LRParser.GetReductionSyntaxNode(0)).name) || find_count_params_lambda(((ident)LRParser.GetReductionSyntaxNode(0)).name) >= 0)) - { - //expression_list el = LRParser.GetReductionSyntaxNode(2) as expression_list; - //int n = el.expressions.Count; - expression_list el = new expression_list(); - int fld_params_count = 0; - if (find_func_name(((ident)LRParser.GetReductionSyntaxNode(0)).name)) - fld_params_count = find_count_params(((ident)LRParser.GetReductionSyntaxNode(0)).name); - else - fld_params_count = find_count_params_lambda(((ident)LRParser.GetReductionSyntaxNode(0)).name); - if (fld_params_count != 0) - for (int i = 0; i < fld_params_count; i++) - { - string param_name = find_name_params_lambda(((ident)LRParser.GetReductionSyntaxNode(0)).name, i); - if (param_name.Contains("$")) - { - named_type_reference _named_type_reference1 = new named_type_reference(); - _named_type_reference1.names.Add(new SyntaxTree.ident("datatype")); - expression_list ell = new expression_list(); - ell.expressions.Add(new string_const("$null") as expression); - ell.expressions.Add(new string_const("string") as expression); - named_type_reference ntr = _named_type_reference1; - new_expr newexpr = new new_expr(ntr, ell, false, null); - el.expressions.Add(newexpr); - } - else - { - el.expressions.Add(new ident(param_name)); - } - } - method_call _method_call = new method_call(el); - - if (_method_call is dereference) - ((dereference)_method_call).dereferencing_value = (addressed_value)LRParser.GetReductionSyntaxNode(0); - from = _method_call; - } - if (LRParser.GetReductionSyntaxNode(0) is ident) - { - function_lambda_definition fld = find_func_lambda_name(((ident)LRParser.GetReductionSyntaxNode(0)).name); - if (fld != null) - { - expression_list _expression_list1 = new expression_list(); - function_lambda_call _lambda_call = new function_lambda_call(fld, _expression_list1); - from = _lambda_call; - } - } - - assign _assign = new assign((addressed_value)id, from, _op_type_node.type); - parsertools.create_source_context(_assign, id, LRParser.GetReductionSyntaxNode(0)); - - _statement_list.subnodes.Add((statement)_assign); - parsertools.assign_source_context(_statement_list, _assign); - //////////////////////////// - if (LRParser.GetReductionSyntaxNode(0) is ident) - { - list_return_funcs.Add(find_count_params(((ident)LRParser.GetReductionSyntaxNode(0)).name)); - } - //////////////////////////// - return _statement_list; - } - case (int)RuleConstants.RULE_PARAMS_VALUE : - // ::= -{ - expression_list _expression_list = new expression_list(); - if (LRParser.GetReductionSyntaxNode(0) != null) - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(0)); - else - _expression_list.expressions.Add(null); - return _expression_list; - } - case (int)RuleConstants.RULE_PARAMS_VALUE2 : - // ::= -{ - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_expression_list, _expression_list, LRParser.GetReductionSyntaxNode(1)); - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(1) as expression); - return _expression_list; - } - case (int)RuleConstants.RULE_PARAM_VALUE: -// ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LAMBDA_FUNC_TKLEFTSLASH_TKARROW : - // ::= 'tkLeftSlash' 'tkArrow' - -{ - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(1); - statement_list _statement_list = (statement_list)LRParser.GetReductionSyntaxNode(3); - //////////////////////////// - ident_list i_l = new ident_list(); - for (int i = 0; i < _expression_list.expressions.Count; i++) - i_l.idents.Add((ident)_expression_list.expressions[i]); - ///////////////////////////// - formal_parameters _formal_parametres = new formal_parameters(); - for (int i = 0; i < _expression_list.expressions.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = (ident)_expression_list.expressions[i]; - _ident_list.idents.Add(id); - string name_param = id.name; - typed_parameters _typed_parametres = null; - int k = 0; - while (k < last_list_method_calls_lambda.Count && ((ident)((method_call)last_list_method_calls_lambda[k]).dereferencing_value).name != name_param) - k++; - if (k < last_list_method_calls_lambda.Count) - _typed_parametres = new typed_parameters(_ident_list, func_type(((method_call)last_list_method_calls_lambda[k]).parameters.expressions.Count), parametr_kind.none, null); - else - { - named_type_reference _named_type_reference = new named_type_reference(); - - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - - _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference, parametr_kind.none, null); - parsertools.create_source_context(_typed_parametres, _ident_list, _named_type_reference); - } - _formal_parametres.params_list.Add(_typed_parametres); - } - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parametres; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = i_l; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = _expression_list; - _procedure_definition.lambda_name = "__lambda__" + lambda_num; - //new function_lambda_definition(_formal_parametres,(type_definition)_named_type_reference1,i_l, null,_expression_list, "lambda"+lambda_num); - object rt = _expression_list; - _procedure_definition.proc_body = _statement_list; - //////////////////////let & where - if (let_stack.Count>0 && ((ArrayList)let_stack[let_stack.Count - 1]).Count > 0) - { - _procedure_definition.defs = new List(); - for (int i = 0; i < ((ArrayList)let_stack[let_stack.Count - 1]).Count; i++) - _procedure_definition.defs.Add((procedure_definition)((ArrayList)let_stack[let_stack.Count - 1])[i]); - if (let_where_funcs_main.Count + 1 > token_where_count) - { - for (int i = 0; i < last_where_funcs.Count; i++) - //if (((procedure_definition)last_where_funcs[i]).proc_header.name.meth_name.name.Contains("lambda")) - _procedure_definition.defs.Add((procedure_definition)last_where_funcs[i]); - for (int i = 0; i < last_where_funcs.Count; i++) - if (let_funcs.Count > 0) - let_funcs.RemoveAt(let_funcs.Count - 1); - last_where_funcs.Clear(); - } - for (int i = 0; i < ((ArrayList)let_stack[let_stack.Count - 1]).Count; i++) - if (let_where_funcs.Count > 0) - let_where_funcs.RemoveAt(let_where_funcs.Count - 1); - for (int i = 0; i < ((ArrayList)let_stack[let_stack.Count - 1]).Count; i++) - if (let_funcs.Count > 0) - let_funcs.RemoveAt(let_funcs.Count - 1); - let_func_last.Clear(); - if (let_flag.Count > 0) - let_flag.RemoveAt(let_flag.Count - 1); - } - if (let_stack.Count>0) - let_stack.RemoveAt(let_stack.Count - 1); - /*if (let_where_funcs.Count > 0) - { - _procedure_definition.defs = new ArrayList(); - for (int i = 0; i < let_where_funcs.Count; i++) - if (((procedure_definition)let_where_funcs[i]).proc_header.name.meth_name.name.Contains("lambda")) - _procedure_definition.defs.Add(let_where_funcs[i]); - if (let_where_funcs_main.Count + 1 > token_where_count) - { - for (int i = 0; i < last_where_funcs.Count; i++) - //if (((procedure_definition)last_where_funcs[i]).proc_header.name.meth_name.name.Contains("lambda")) - _procedure_definition.defs.Add((procedure_definition)last_where_funcs[i]); - for (int i = 0; i < last_where_funcs.Count; i++) - if (let_funcs.Count > 0) - let_funcs.RemoveAt(let_funcs.Count - 1); - last_where_funcs.Clear(); - } - int j=0; - while (j < let_where_funcs.Count) - if (((procedure_definition)let_where_funcs[j]).proc_header.name.meth_name.name.Contains("lambda")) - let_where_funcs.RemoveAt(j); - else - j++; - //let_where_funcs.Clear(); - let_func_last.Clear(); - let_flag.Clear(); - }*/ - ////////////////////// - parsertools.create_source_context(_procedure_definition, _expression_list, rt); - _function_lambda_definitions.Add(_procedure_definition);//////////////// - if (lambda_stack.Count > 0) - { - if (((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count > 0) - { - if (_procedure_definition.defs == null) - _procedure_definition.defs = new List(); - for (int i = 0; i < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; i++) - { - _procedure_definition.defs.Add((procedure_definition)((ArrayList)lambda_stack[lambda_stack.Count - 1])[i]); - int j = 0; - while (j < _function_lambda_definitions.Count && ((function_lambda_definition)_function_lambda_definitions[j]).lambda_name != - ((procedure_definition)((ArrayList)lambda_stack[lambda_stack.Count - 1])[i]).proc_header.name.meth_name.name) - j++; - if (j < _function_lambda_definitions.Count) - _function_lambda_definitions.RemoveAt(j); - } - //for (int i = 0; i < ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Count; i++) - //_function_lambda_definitions.RemoveAt(_function_lambda_definitions.Count-1); - lambda_stack.RemoveAt(lambda_stack.Count - 1); - } - if (lambda_stack.Count > 1 && ((ArrayList)lambda_stack[lambda_stack.Count - 2]).Count > 0) - { - ((ArrayList)lambda_stack[lambda_stack.Count - 2]).Add(lambda(_procedure_definition)); - lambda_stack.RemoveAt(lambda_stack.Count - 1); - } - else - ((ArrayList)lambda_stack[lambda_stack.Count - 1]).Add(lambda(_procedure_definition)); - } - //lambda_funcs.Add(_procedure_definition); - - //let_funcs.Add(lambda(_procedure_definition)); - //let_where_funcs.Add(lambda(_procedure_definition)); - - return new ident(_procedure_definition.lambda_name); -} - case (int)RuleConstants.RULE_EMPTY : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL -} -throw new RuleException("Unknown rule"); -} - -public method_call _ob(object dt) - { - token_info _token_info = new token_info("."); - _token_info.source_context = parsertools.GetTokenSourceContext(); - /////////// - ident id = new ident("ob"); - dot_node _dot_node = new dot_node(null, (addressed_value)id); - parsertools.create_source_context(_dot_node, _token_info, id); - _dot_node.left = (addressed_value)dt; - parsertools.create_source_context(_dot_node, dt, _dot_node.right); - ///////////////////////// - expression_list el = new expression_list(); - el.expressions.Add(_dot_node); - method_call _method_call = new method_call(el); - parsertools.create_source_context(_method_call, null, null); - ///////////////////////// - ident id1 = new ident("boolean"); - ///////////////////////// - if (_method_call is dereference) - { - ((dereference)_method_call).dereferencing_value = (addressed_value)id1; - parsertools.create_source_context(_method_call, id1, _method_call); - } - return _method_call; - } - -public method_call _count(expression dt) -{ - ident id = new ident("count"); - dot_node _dot_node = new dot_node(null, (addressed_value)id); - _dot_node.left = (addressed_value)dt; - method_call _method_call = new method_call(); - _method_call.dereferencing_value = _dot_node; - return _method_call; -} - -public method_call _add(expression dt, expression param) -{ - ident id = new ident("add"); - dot_node _dot_node = new dot_node(null, null); - expression_list el = new expression_list(); - el.expressions.Add(param); - //method_call _method_call = new method_call(el); - //_method_call.dereferencing_value = id; - _dot_node.left = (addressed_value)dt; - _dot_node.right = id; - method_call _method_call = new method_call(el); - _method_call.dereferencing_value = _dot_node; - return _method_call; -} - -public method_call _index(expression dt, expression param) -{ - token_info _token_info = new token_info("."); - ident id = new ident("index"); - dot_node _dot_node = new dot_node(null, null); - expression_list el = new expression_list(); - el.expressions.Add(param); - _dot_node.left = (addressed_value)dt; - _dot_node.right = id; - method_call _method_call = new method_call(el); - _method_call.dereferencing_value = _dot_node; - return _method_call; -} - -public procedure_definition lambda(function_lambda_definition _function_lambda_definition) -{ - SyntaxTree.procedure_definition _func_def = new PascalABCCompiler.SyntaxTree.procedure_definition(); - SyntaxTree.method_name _method_name1 = new SyntaxTree.method_name(null, new SyntaxTree.ident(_function_lambda_definition.lambda_name), null); - SyntaxTree.function_header _function_header1 = new SyntaxTree.function_header(); - - object rt1 = new object(); - _function_header1.name = _method_name1; - SyntaxTree.formal_parameters fps = new PascalABCCompiler.SyntaxTree.formal_parameters(); - _function_header1.parameters = _function_lambda_definition.formal_parameters;//fps; - SyntaxTree.named_type_reference _named_type_reference = new SyntaxTree.named_type_reference(); - SyntaxTree.ident idtype = new SyntaxTree.ident("datatype"); - _named_type_reference.source_context = idtype.source_context; - _named_type_reference.names.Add(idtype); - - rt1 = _named_type_reference; - _function_header1.return_type = (SyntaxTree.type_definition)_named_type_reference; - - _function_header1.of_object = false; - _function_header1.class_keyword = false; - SyntaxTree.block _block1 = new SyntaxTree.block(null, null); - SyntaxTree.statement_list sl1 = new SyntaxTree.statement_list(); - sl1.subnodes.Add(_function_lambda_definition.proc_body); - _block1.program_code = sl1; - _func_def.proc_header = _function_header1; - _func_def.proc_body = (SyntaxTree.proc_block)_block1; - if (_function_lambda_definition.defs != null) - { - if (((block)_func_def.proc_body).defs == null) - ((block)_func_def.proc_body).defs = new declarations(); - for (int l = 0; l < _function_lambda_definition.defs.Count; l++) - ((block)_func_def.proc_body).defs.defs.Add(_function_lambda_definition.defs[l] as procedure_definition); - } - _function_lambda_definition.proc_definition = _func_def; - return _func_def; -} - -public procedure_definition find_function1(string name) -{ - int i = 0; - while (i < _functions.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != name) - i++; - if (i < _functions.Count) - return (procedure_definition)_functions[i]; - else - return null; -} - -public int find_count_params(string name) -{ - if (param_value_list_main.Count == 0 && param_value_list.Count == 0) - { - int i = 0; - while (i < _functions.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != name) - i++; - if (i < _functions.Count) - { - if (((procedure_definition)_functions[i]).proc_header.parameters == null) - return 0; - else - return ((procedure_definition)_functions[i]).proc_header.parameters.params_list.Count; - } - else - return 0; - } - else - { - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != name) - i++; - if (i < func_name.Count) - { - if (i >= param_value_list_main.Count) - { - if (i >= param_value_list_main.Count) - //if (param_value_list_main.Count==0) - { - if (param_value_list[param_value_list.Count - 1] == null) - return 0; - else - return ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Count; - } - else - return 0; - } - else - { - if (((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1] == null) - return 0; - else - return ((expression_list)((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1]).expressions.Count; - } - } - else - return 0; - } -} - -public int find_count_params_lambda(string name) -{ - int i = 0; - while (i < _function_lambda_definitions_after.Count && ((function_lambda_definition)_function_lambda_definitions_after[i]).lambda_name != name) - i += 2; - if (i < _function_lambda_definitions_after.Count) - return ((function_lambda_definition)_function_lambda_definitions_after[i]).formal_parameters.params_list.Count; - else - return -1; -} - -public string find_name_params_lambda(string name, int ind) -{ - int i = 0; - while (i < _function_lambda_definitions_after.Count && ((function_lambda_definition)_function_lambda_definitions_after[i]).lambda_name != name) - i += 2; - if (i < _function_lambda_definitions_after.Count) - { - formal_parameters fp = ((function_lambda_definition)_function_lambda_definitions_after[i]).formal_parameters; - if (ind < fp.params_list.Count) - return fp.params_list[ind].idents.idents[0].name; - else - return ""; - } - else - return ""; -} - -public bool find_func_name(string name) -{ - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != name) - i++; - if (i < func_name.Count) - return true; - else - return false; -} - -public function_lambda_definition find_func_lambda_name(string name) -{ - int i = 0; - while (i < _function_lambda_definitions.Count && ((function_lambda_definition)_function_lambda_definitions[i]).lambda_name != name) - i++; - if (i < _function_lambda_definitions.Count) - return (function_lambda_definition)_function_lambda_definitions[i]; - else - return null; -} - -/*public procedure_definition find_let_lambda_name(string name) -{ - int i = 0; - while (i < let_funcs.Count && ((procedure_definition)let_funcs[i]).proc_header.name.meth_name.name != name) - i++; - if (i < let_funcs.Count) - return (procedure_definition)let_funcs[i]; - else - return null; -}*/ - -public type_definition func_type(int count) -{ - //int count = mc.parameters.expressions.Count; - - formal_parameters _formal_parametres = new formal_parameters(); - for (int i = 0; i < count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = new ident("$a" + i.ToString()); - _ident_list.idents.Add(id); - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("datatype"); - _named_type_reference1.names.Add(idtype1); - typed_parameters _typed_parametres = new typed_parameters(_ident_list, (type_definition)_named_type_reference1, parametr_kind.none, null); - _formal_parametres.params_list.Add(_typed_parametres); - } - named_type_reference _named_type_reference = new named_type_reference(); - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - function_header _function_header = new function_header(); - _function_header.parameters = _formal_parametres; - _function_header.return_type = (type_definition)_named_type_reference; - _function_header.of_object = false; - _function_header.class_keyword = false; - return (type_definition)_function_header; -} - -public var_statement var_st(string name, type_definition td) -{ - ident_list il = new ident_list(); - il.idents.Add(new ident(name)); - var_def_statement _var_def_statement = new var_def_statement(il, td, null, definition_attribute.None, false); - return new var_statement(_var_def_statement); -} - -public method_call find_method_call(string name, int k) -{ - int i = 0; - while (i < ((ArrayList)list_method_calls_main[k]).Count && - ((ident)((method_call)((ArrayList)list_method_calls_main[k])[i]).dereferencing_value).name != name) - i++; - if (i < ((ArrayList)list_method_calls_main[k]).Count) - return (method_call)((ArrayList)list_method_calls_main[k])[i]; - else - return null; -} - -public method_call find_method_call_lambda(string name) -{ - int i = 0; - while (i < list_method_calls_lambda.Count && - ((ident)((method_call)list_method_calls_lambda[i]).dereferencing_value).name != name) - i++; - if (i < list_method_calls_lambda.Count) - return (method_call)list_method_calls_lambda[i]; - else - return null; -} -public function_lambda_definition find_func_lambda_after(string name) -{ - int i = 0; - while (i < _function_lambda_definitions_after.Count && - ((function_lambda_definition)_function_lambda_definitions_after[i]).lambda_name != name) - i += 2; - if (i < _function_lambda_definitions_after.Count) - return _function_lambda_definitions_after[i] as function_lambda_definition; - else - return null; -} -public ArrayList find_params(string name) -{ - ArrayList _params = new ArrayList(); - if (param_value_list_main.Count == 0 && param_value_list.Count == 0) - { - int i = 0; - while (i < _functions.Count && ((procedure_definition)_functions[i]).proc_header.name.meth_name.name != name) - i++; - if (i < _functions.Count) - { - if (((procedure_definition)_functions[i]).proc_header.parameters == null) - return _params; - else - { - for (int j = 0; j < ((procedure_definition)_functions[i]).proc_header.parameters.params_list.Count; j++) - _params.Add(((procedure_definition)_functions[i]).proc_header.parameters.params_list[j]); - return _params; - } - } - else - return _params; - } - else - { - int i = 0; - while (i < func_name.Count && ((ident)func_name[i]).name != name) - i++; - if (i < func_name.Count) - { - if (i >= param_value_list_main.Count) - { - if (i >= param_value_list_main.Count) - //if (param_value_list_main.Count==0) - { - if (param_value_list[param_value_list.Count - 1] == null) - return _params; - else - { - for (int j = 0; j < ((expression_list)param_value_list[param_value_list.Count - 1]).expressions.Count; j++) - _params.Add(((expression_list)param_value_list[param_value_list.Count - 1]).expressions[j]); - return _params; - } - } - else - return _params; - } - else - { - if (((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1] == null) - return _params; - else - { - for (int j = 0; j < ((expression_list)((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1]).expressions.Count; j++) - _params.Add(((expression_list)((ArrayList)param_value_list_main[i])[((ArrayList)param_value_list_main[i]).Count - 1]).expressions[j]); - return _params; - } - } - } - else - return _params; - } -} -public void Error_Clear() -{ - param_value_list.Clear(); - body_variant_list.Clear(); - param_value_list_main.Clear(); - body_variant_list_main.Clear(); - guard_list.Clear(); - guard_list_main.Clear(); - func_name.Clear(); - decls_counts = 0; - where_flag = false; - list_param.Clear(); - list_params.Clear(); - list_params_temp.Clear(); - list_params_main.Clear(); - _function_lambda_definitions.Clear(); - _function_lambda_definitions_after.Clear(); - lambda_num = 0; - _functions.Clear(); - list_method_calls.Clear(); - list_method_calls_main.Clear(); - list_return_funcs.Clear(); - list_return_funcs_main.Clear(); - list_params1.Clear(); - last_function_lambda_definitions.Clear(); - last_list_method_calls.Clear(); - last_list_method_calls_lambda.Clear(); - let_fact_params.Clear(); - let_funcs.Clear(); - let_funcs_funcs.Clear(); - let_func_last.Clear(); - let_funcs1.Clear(); - let_flag.Clear(); - where_funcs.Clear(); - let_where_funcs.Clear(); - let_where_funcs_main.Clear(); - token_where = 0; - token_where_count = 0; - last_where_funcs.Clear(); - list_method_calls_lambda.Clear(); - let_where_list_params.Clear(); - _function_lambda_definitions_main.Clear(); - let_stack.Clear(); - token_let = 0; - lambda_stack.Clear(); -} - -/*public function_lambda_definition find_lambda_funcs(string name) -{ - int i = 0; - while (i < lambda_funcs.Count && ((function_lambda_definition)lambda_funcs[i]).lambda_name != name) - i++; - if (i < lambda_funcs.Count) - return (function_lambda_definition)lambda_funcs[i]; - else - return null; -}*/ -public ArrayList find_lambda_funcs_main(string name) -{ - int i = 0; - while (i < _function_lambda_definitions_main.Count && ((ArrayList)_function_lambda_definitions_main[i])[0].ToString() != name) - i++; - if (i < _function_lambda_definitions_main.Count) - return ((ArrayList)_function_lambda_definitions_main[i])[1] as ArrayList; - else - return null; -} -public void constructor_rec_var(statement_list body, new_expr n_e) -{ - ident id = null; - string name_corteg = ""; - for (int ii = 2; ii < n_e.params_list.expressions.Count; ii++) - if (n_e.params_list.expressions[ii] is ident) - name_corteg += ((ident)n_e.params_list.expressions[ii]).name; - if (name_corteg=="") - name_corteg = "$$"; - name_corteg+=rec_num; - rec_num++; - id = new ident(name_corteg); - ident_list _ident_list1 = new ident_list(); - _ident_list1.idents.Add(id); - string name_param2 = id.name; - typed_parameters _typed_parametres2 = null; - named_type_reference _named_type_reference3 = new named_type_reference(); - ident idtype3 = new ident("datatype"); - _named_type_reference3.names.Add(idtype3); - var_def_statement _var_def_statement2 = new var_def_statement(_ident_list1, (type_definition)_named_type_reference3, null, definition_attribute.None, false); - var_statement _var_statement2 = new var_statement(_var_def_statement2); - body.subnodes.Add(_var_statement2); - for (int ii = 2; ii < n_e.params_list.expressions.Count; ii++) - { - if (n_e.params_list.expressions[ii] is ident) - { - ident id1 = (ident)n_e.params_list.expressions[ii]; - ident_list _ident_list = new ident_list(); - _ident_list.idents.Add(id1); - typed_parameters _typed_parametres = null; - named_type_reference _named_type_reference = new named_type_reference(); - ident idtype = new ident("datatype"); - _named_type_reference.names.Add(idtype); - var_def_statement _var_def_statement = new var_def_statement(_ident_list, (type_definition)_named_type_reference, null, definition_attribute.None, false); - var_statement _var_statement = new var_statement(_var_def_statement); - body.subnodes.Add(_var_statement); - } - else - constructor_rec_var(body, (new_expr)n_e.params_list.expressions[ii]); - } -} -public void constructor_rec_ass(statement_list stmt_list, new_expr n_e, method_call _method_call) -{ - string name_corteg = ""; - for (int ii = 2; ii < n_e.params_list.expressions.Count; ii++) - if (n_e.params_list.expressions[ii] is ident) - name_corteg += ((ident)n_e.params_list.expressions[ii]).name; - if (name_corteg == "") - name_corteg = "$$"; - name_corteg += rec_num; - rec_num++; - assign _assign = new assign(); - _assign.operator_type = Operators.Assignment; - _assign.to = new ident(name_corteg); - _assign.from = _method_call; - stmt_list.subnodes.Add(_assign); - for (int ii = 2; ii < n_e.params_list.expressions.Count; ii++) - { - assign _assign1 = new assign(); - _assign1.operator_type = Operators.Assignment; - if (n_e.params_list.expressions[ii] is ident) - { - _assign1.to = (ident)n_e.params_list.expressions[ii]; - _assign1.from = _index(new ident(name_corteg), new int32_const(ii - 2)); - stmt_list.subnodes.Add(_assign1); - } - else - constructor_rec_ass(stmt_list, (new_expr)n_e.params_list.expressions[ii], _index(_method_call, new int32_const(ii - 2))); - } -} - - -} -} diff --git a/Parsers/HaskellParser/Parser.cs b/Parsers/HaskellParser/Parser.cs deleted file mode 100644 index 8fba7419b..000000000 --- a/Parsers/HaskellParser/Parser.cs +++ /dev/null @@ -1,171 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Parsers; -using System.Resources; -using System.Reflection; -using PascalABCCompiler.Errors; -using System.IO; - -namespace PascalABCCompiler.HaskellParser -{ - public class HaskellLanguageParser : IParser - { - GPBParser_Haskell parser; - - public HaskellLanguageParser() - { - filesExtensions = new string[1]; - filesExtensions[0] = ".hs"; - } - - string[] filesExtensions; - public string[] FilesExtensions - { - get - { - return filesExtensions; - } - } - - ILanguageInformation languageInformation; - public ILanguageInformation LanguageInformation - { - get - { - if (languageInformation == null) - languageInformation = new DefaultLanguageInformation(this); - return languageInformation; - } - } - - Keyword[] _keywords; - void initKeywords() - { - List key_words = new List(); - key_words.Add(new Keyword("module")); - key_words.Add(new Keyword("where")); - _keywords = key_words.ToArray(); - } - public Keyword[] Keywords - { - get - { - return _keywords; - } - } - - public void Reset() - { - ResourceManager rm = new ResourceManager("HaskellParser.HaskellLang", Assembly.GetExecutingAssembly()); - parser = new GPBParser_Haskell(CGTResourceExtractor.Extract(rm, "HaskellLanguage")); - parser.max_errors = 30; - } - - public bool CaseSensitive - { - get - { - return parser.LanguageGrammar.CaseSensitive; - } - } - - SourceFilesProviderDelegate sourceFilesProvider = null; - public SourceFilesProviderDelegate SourceFilesProvider - { - get - { - return sourceFilesProvider; - } - set - { - sourceFilesProvider = value; - } - } - - public List compilerDirectives = new List(); - public List CompilerDirectives - { - get - { - return new List(); - } - } - - List errors = new List(); - public List Errors - { - get - { - return errors; - } - set - { - errors = value; - } - } - public syntax_tree_node BuildTree(string FileName, string Text, string[] SearchPatchs, ParseMode ParseMode) - { - if (parser == null) - Reset(); - compilerDirectives = new System.Collections.Generic.List(); - parser.CompilerDirectives = compilerDirectives; - parser.errors = Errors; - parser.current_file_name = FileName; - parser.parsertools.LineCorrection = 0; - syntax_tree_node cu = null; - switch (ParseMode) - { - case ParseMode.Normal: - cu = (syntax_tree_node)parser.Parse(Text); - break; - case ParseMode.Expression: - case ParseMode.Statement: - return null; - } - if (cu != null && cu is compilation_unit) - { - (cu as compilation_unit).file_name = FileName; - (cu as compilation_unit).compiler_directives = parser.CompilerDirectives; - } - return cu; - } - - public string Name - { - get - { - return "Haskell"; - } - } - public string Version - { - get - { - return "1.0"; - } - } - public string Copyright - { - get - { - return "(c) Бушманова Ð�. 2007"; - } - } - - public override string ToString() - { - return "Haskell Language Parser v1.0"; - } - public IPreprocessor Preprocessor - { - get - { - return null; - } - } - - } -} diff --git a/Parsers/HaskellParser/Properties/AssemblyInfo.cs b/Parsers/HaskellParser/Properties/AssemblyInfo.cs deleted file mode 100644 index d65711706..000000000 --- a/Parsers/HaskellParser/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("HaskellParser")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("HaskellParser")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("5de18530-3349-4d82-ab06-b0a984196848")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Parsers/KuMirParser/Errors.cs b/Parsers/KuMirParser/Errors.cs deleted file mode 100644 index 6c7f049f1..000000000 --- a/Parsers/KuMirParser/Errors.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -//using com.calitha.goldparser; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.Errors; -using System.Collections.Generic; -using PascalABCCompiler.KuMirParser; - - -namespace PascalABCCompiler.KuMirParser.Errors -{ - public class nonterminal_token_return_null : SyntaxError - { - public nonterminal_token_return_null(string _file_name, SourceContext _source_context, syntax_tree_node _node, string nonterminal_token_name) - : - base(string.Format(StringResources.Get("NONTERMINALTOKEN_{0}_RETURN_NULL"), nonterminal_token_name), - _file_name, _source_context, _node) - { - } - } - - public class UnexpectedToken : SyntaxError - { - private string _message; - public UnexpectedToken(PascalABCCompiler.ParserTools.GPBParser parser) - : base("", parser.current_file_name, parser.parsertools.GetTokenSourceContext(parser.LRParser), (syntax_tree_node)parser.prev_node) - { - List Symbols = parser.parsertools.GetPrioritySymbols(parser.LRParser.GetExpectedTokens()); - if (Symbols.Count == 1) - { - string OneSybmolText = "ONE_" + Symbols[0].Name.ToUpper(); - string LocOneSybmolText = StringResources.Get(OneSybmolText); - if (LocOneSybmolText != OneSybmolText) - { - _message = string.Format(LocOneSybmolText); - return; - } - } - _message = string.Format(StringResources.Get("EXPECTED{0}"), PascalABCCompiler.FormatTools.ObjectsToString(parser.parsertools.SymbolsToStrings(Symbols.ToArray()), ",")); - } - public UnexpectedToken(string _file_name, string expected, SourceContext _source_context, syntax_tree_node _node) - : base("", _file_name, _source_context, _node) - { - _message = string.Format(StringResources.Get("EXPECTED{0}"), expected); - } - public override string Message - { - get - { - return _message; - } - } - - - } - -} diff --git a/Parsers/KuMirParser/KuMirLang.resources b/Parsers/KuMirParser/KuMirLang.resources deleted file mode 100644 index 3a13f1ef9..000000000 Binary files a/Parsers/KuMirParser/KuMirLang.resources and /dev/null differ diff --git a/Parsers/KuMirParser/KuMirParser.csproj b/Parsers/KuMirParser/KuMirParser.csproj deleted file mode 100644 index accd7b591..000000000 --- a/Parsers/KuMirParser/KuMirParser.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {6C945895-BCE2-4522-8E35-F93B4661B2DA} - Library - Properties - KuMirParser - KuMirParser - - - - - 4.0 - - - v4.0 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - ..\..\bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - ..\..\bin\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\bin\Errors.dll - - - False - ..\..\bin\Localization.dll - - - False - ..\..\bin\ParserTools.dll - - - False - ..\..\bin\SyntaxTree.dll - - - - - - - - - - - - - - - - - - - False - КлиентÑ�кий профиль .NET Framework 3.5 SP1 - false - - - False - .NET Framework 3.5 SP1 - true - - - False - УÑ�тановщик Windows 3.1 - true - - - - - \ No newline at end of file diff --git a/Parsers/KuMirParser/KuMirParserTools.cs b/Parsers/KuMirParser/KuMirParserTools.cs deleted file mode 100644 index aa0b2fd2f..000000000 --- a/Parsers/KuMirParser/KuMirParserTools.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Text; -//using com.calitha.goldparser; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.ParserTools; -using GoldParser; - - -namespace PascalABCCompiler.KuMirParser -{ - public static class StringResources - { - private static string prefix = "KUMIRPARSER_"; - public static string Get(string Id) - { - string ret = PascalABCCompiler.StringResources.Get(prefix + Id); - if (ret == prefix + Id) - return Id; - else - return ret; - } - } - - public class KuMir_parsertools : parser_tools - { - public override string symbol_to_string(Symbol symbol) - { - switch (symbol.Index) - { - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_MINUS: - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_DIV: - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_MULT: - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_GREATER: - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_GREATEREQUAL: - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_LOWER: - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_LOWEREQUAL: - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_NOTEQUAL: - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_POWER: - return StringResources.Get("OPERATOR"); - } - string res = StringResources.Get(symbol.Name); - /*if (res.IndexOf("TK_") == 0) - return res.Remove(0, 3).ToLower(); - return res;*/ - - return res; - } - - public override int symbol_priority(Symbol symbol) - { - - switch (symbol.Index) - { - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_END: - return 8; - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_BEGIN: - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_INTEGER: - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_ROUNDCLOSE: - return 9; - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_IDENTIFIER: - return 10; - - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_ASSIGN: - return 25; - - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_EQUAL: - return 25; - - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_EXPRESSION: - return 100; - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_STATEMENT: - return 110; - case (int)GPBParser_KuMir.SymbolConstants.SYMBOL_TK_SEMICOLON: - return 1000; - } - if (symbol.SymbolType == SymbolType.Terminal) - return 1; - return 0; - } - - - } -} diff --git a/Parsers/KuMirParser/KuMir_lrparser.cs b/Parsers/KuMirParser/KuMir_lrparser.cs deleted file mode 100644 index ffb5d4fac..000000000 --- a/Parsers/KuMirParser/KuMir_lrparser.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.KuMirParser.Errors; - -namespace PascalABCCompiler.KuMirParser -{ - public partial class GPBParser_KuMir : GPBParser - { - private Stack NodesStack; - private SyntaxError error; - private int unit_number; - public ArrayList _units; - - Stream GrammarStream; - - public GPBParser_KuMir(Stream stream) - : base(stream) - { - GrammarStream = stream; - parsertools = new KuMir_parsertools(); - unit_number = 0; - _units = new ArrayList(); - } - - public object Parse(string source) - { - _units.Add(new unit_data()); - unit_number++; - - NodesStack = new Stack(); - LRParser = new GoldParser.Parser(new StringReader(source), LanguageGrammar); - parsertools.parser = LRParser; - LRParser.TrimReductions = true; - try - { - while (true) - { - switch (LRParser.Parse()) - { - case GoldParser.ParseMessage.LexicalError: - errors.Add(new TokenReadError(this)); - LRParser.PopInputToken(); - if (errors.Count >= max_errors) - return null; - break; - - //sdes nugno vesti chtoto vrode steka poslednix oshibok. podumat - case GoldParser.ParseMessage.SyntaxError: - GoldParser.Symbol sym = LRParser.PopInputToken(); - error = new KuMirParser.Errors.UnexpectedToken(this); - //error = new UnexpectedToken(this, parsertools.symbol_collection_to_string(this.LRParser.GetExpectedTokens())); - if (sym.SymbolType == GoldParser.SymbolType.End && errors.Count > 0) - return null; - errors.Add(error); - if (errors.Count >= max_errors) - return null; - break; - case GoldParser.ParseMessage.Reduction: - LRParser.TokenSyntaxNode = CreateNonTerminalObject(LRParser.ReductionRule.Index); - if ((LRParser.TokenSyntaxNode as syntax_tree_node) != null) - prev_node = LRParser.TokenSyntaxNode; - break; - - case GoldParser.ParseMessage.Accept: - return LRParser.TokenSyntaxNode; - - case GoldParser.ParseMessage.TokenRead: - LRParser.TokenSyntaxNode = CreateTerminalObject(LRParser.TokenSymbol.Index); - break; - - case GoldParser.ParseMessage.InternalError: - errors.Add(new CompilerInternalError("KuMirParser", new Exception("ParseMessage.InternalError"))); - return null; - - case GoldParser.ParseMessage.NotLoadedError: - errors.Add(new CompilerInternalError("KuMirParser", new Exception("ParseMessage.NotLoadedError"))); - return null; - - case GoldParser.ParseMessage.CommentError: - errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "(EOF)")); - return null; - - /*case ParseMessage.CommentBlockRead: - break; - - case ParseMessage.CommentLineRead: - break;*/ - } - } - } - catch (Exception e) - { - if (errors.Count > 0) - return null; - else - throw; - } - - } - } - -} \ No newline at end of file diff --git a/Parsers/KuMirParser/KuMir_lrparser_rules.cs b/Parsers/KuMirParser/KuMir_lrparser_rules.cs deleted file mode 100644 index 92e78f243..000000000 --- a/Parsers/KuMirParser/KuMir_lrparser_rules.cs +++ /dev/null @@ -1,2697 +0,0 @@ - -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.KuMirParser.Errors; -using PascalABCCompiler.ParserTools; -using GoldParser; - -namespace PascalABCCompiler.KuMirParser -{ - public partial class GPBParser_KuMir : GPBParser - { - - - - - - - - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - //SymbolConstants - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - - public enum SymbolConstants : int - { - SYMBOL_EOF = 0, // (EOF) - SYMBOL_ERROR = 1, // (Error) - SYMBOL_WHITESPACE = 2, // (Whitespace) - SYMBOL_COMMENTLINE = 3, // (Comment Line) - SYMBOL_TK_ALG = 4, // 'tk_alg' - SYMBOL_TK_AND = 5, // 'tk_and' - SYMBOL_TK_ARG = 6, // 'tk_arg' - SYMBOL_TK_ARRAY = 7, // 'tk_array' - SYMBOL_TK_ASSERT = 8, // 'tk_assert' - SYMBOL_TK_ASSIGN = 9, // 'tk_Assign' - SYMBOL_TK_BEGIN = 10, // 'tk_begin' - SYMBOL_TK_BEGIN_CYCLE = 11, // 'tk_begin_cycle' - SYMBOL_TK_BOOLEAN_TYPE = 12, // 'tk_boolean_type' - SYMBOL_TK_CASE = 13, // 'tk_case' - SYMBOL_TK_CASE_V = 14, // 'tk_case_v' - SYMBOL_TK_CHAR = 15, // 'tk_char' - SYMBOL_TK_CHAR_TYPE = 16, // 'tk_char_type' - SYMBOL_TK_COLON = 17, // 'tk_Colon' - SYMBOL_TK_COMMA = 18, // 'tk_Comma' - SYMBOL_TK_DIV = 19, // 'tk_Div' - SYMBOL_TK_DOT = 20, // 'tk_Dot' - SYMBOL_TK_ELSE = 21, // 'tk_else' - SYMBOL_TK_END = 22, // 'tk_end' - SYMBOL_TK_END_ALL = 23, // 'tk_end_all' - SYMBOL_TK_END_CYCLE = 24, // 'tk_end_cycle' - SYMBOL_TK_EOL = 25, // 'tk_eol' - SYMBOL_TK_EQUAL = 26, // 'tk_Equal' - SYMBOL_TK_FALSE = 27, // 'tk_false' - SYMBOL_TK_FOR = 28, // 'tk_for' - SYMBOL_TK_FROM = 29, // 'tk_from' - SYMBOL_TK_FUNC_VAL = 30, // 'tk_func_val' - SYMBOL_TK_GREATER = 31, // 'tk_Greater' - SYMBOL_TK_GREATEREQUAL = 32, // 'tk_GreaterEqual' - SYMBOL_TK_IDENTIFIER = 33, // 'tk_Identifier' - SYMBOL_TK_IF = 34, // 'tk_if' - SYMBOL_TK_INTEGER = 35, // 'tk_integer' - SYMBOL_TK_INTEGER_TYPE = 36, // 'tk_integer_type' - SYMBOL_TK_ISP = 37, // 'tk_isp' - SYMBOL_TK_LOWER = 38, // 'tk_Lower' - SYMBOL_TK_LOWEREQUAL = 39, // 'tk_LowerEqual' - SYMBOL_TK_MINUS = 40, // 'tk_Minus' - SYMBOL_TK_MULT = 41, // 'tk_Mult' - SYMBOL_TK_NEWLINE = 42, // 'tk_NewLine' - SYMBOL_TK_NOT = 43, // 'tk_not' - SYMBOL_TK_NOTEQUAL = 44, // 'tk_NotEqual' - SYMBOL_TK_OR = 45, // 'tk_or' - SYMBOL_TK_PLUS = 46, // 'tk_Plus' - SYMBOL_TK_POWER = 47, // 'tk_Power' - SYMBOL_TK_RAZ = 48, // 'tk_raz' - SYMBOL_TK_READ = 49, // 'tk_read' - SYMBOL_TK_REAL = 50, // 'tk_real' - SYMBOL_TK_REAL_TYPE = 51, // 'tk_real_type' - SYMBOL_TK_ROUNDCLOSE = 52, // 'tk_RoundClose' - SYMBOL_TK_ROUNDOPEN = 53, // 'tk_RoundOpen' - SYMBOL_TK_SEMICOLON = 54, // 'tk_SemiColon' - SYMBOL_TK_SQUARECLOSE = 55, // 'tk_SquareClose' - SYMBOL_TK_SQUAREOPEN = 56, // 'tk_SquareOpen' - SYMBOL_TK_STRING_TYPE = 57, // 'tk_string_type' - SYMBOL_TK_STRINGLITERAL = 58, // 'tk_StringLiteral' - SYMBOL_TK_THEN = 59, // 'tk_then' - SYMBOL_TK_TO = 60, // 'tk_to' - SYMBOL_TK_TRUE = 61, // 'tk_true' - SYMBOL_TK_USES = 62, // 'tk_uses' - SYMBOL_TK_VAR = 63, // 'tk_var' - SYMBOL_TK_WHILE = 64, // 'tk_while' - SYMBOL_TK_WRITE = 65, // 'tk_write' - SYMBOL_ADDEXP = 66, // - SYMBOL_ARRAY_LIST1 = 67, // - SYMBOL_ARRAY_LIST2 = 68, // - SYMBOL_CASE_VARIANT = 69, // - SYMBOL_CASE_VARIANT_LIST = 70, // - SYMBOL_DECLARATIONS = 71, // - SYMBOL_DIAP = 72, // - SYMBOL_DIAP_LIST = 73, // - SYMBOL_EXPRESSION = 74, // - SYMBOL_FACT_LIST = 75, // - SYMBOL_FORMAL_LIST = 76, // - SYMBOL_FORMAL_PARAMETER1 = 77, // - SYMBOL_FORMAL_PARAMETER2 = 78, // - SYMBOL_FORMAL_TYPE_LIST1 = 79, // - SYMBOL_FORMAL_TYPE_LIST2 = 80, // - SYMBOL_FREE_OPERATOR = 81, // - SYMBOL_FUNCTION = 82, // - SYMBOL_GLOBAL_DECL_LIST = 83, // - SYMBOL_GLOBAL_PART = 84, // - SYMBOL_GLOBAL_VARS = 85, // - SYMBOL_ID_LIST1 = 86, // - SYMBOL_ID_LIST2 = 87, // - SYMBOL_INITIALIZATION = 88, // - SYMBOL_LIST_OF_EXPRESSIONS = 89, // - SYMBOL_MULTEXP = 90, // - SYMBOL_NEGATEEXP = 91, // - SYMBOL_POWEREXP = 92, // - SYMBOL_PROCEDURE = 93, // - SYMBOL_PROGRAM = 94, // - SYMBOL_SEPARATOR = 95, // - SYMBOL_SEPARATORS = 96, // - SYMBOL_SEPARATORSOPT = 97, // - SYMBOL_STATEMENT = 98, // - SYMBOL_STATEMENTS = 99, // - SYMBOL_SUB_DECLARATIONS = 100, // - SYMBOL_TYPE = 101, // - SYMBOL_USES_UNITS = 102, // - SYMBOL_VALUE = 103, // - SYMBOL_VAR_DECL_LIST1 = 104, // - SYMBOL_VAR_DECL_LIST2 = 105, // - SYMBOL_VAR_DECLARATIONS1 = 106, // - SYMBOL_VAR_DECLARATIONS2 = 107 // - }; - - - - - - - - - - - - - - - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - //RuleConstants - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - - public enum RuleConstants : int - { - RULE_SEPARATOR_TK_SEMICOLON = 0, // ::= 'tk_SemiColon' - RULE_SEPARATOR_TK_NEWLINE = 1, // ::= 'tk_NewLine' - RULE_SEPARATORS = 2, // ::= - RULE_SEPARATORS2 = 3, // ::= - RULE_SEPARATORSOPT = 4, // ::= - RULE_SEPARATORSOPT2 = 5, // ::= - RULE_PROGRAM_TK_ALG_TK_IDENTIFIER_TK_BEGIN_TK_END = 6, // ::= 'tk_alg' 'tk_Identifier' 'tk_begin' 'tk_end' - RULE_PROGRAM_TK_ISP_TK_IDENTIFIER_TK_END = 7, // ::= 'tk_isp' 'tk_Identifier' 'tk_end' - RULE_PROCEDURE_TK_ALG_TK_IDENTIFIER_TK_ROUNDOPEN_TK_ROUNDCLOSE_TK_BEGIN_TK_END = 8, // ::= 'tk_alg' 'tk_Identifier' 'tk_RoundOpen' 'tk_RoundClose' 'tk_begin' 'tk_end' - RULE_PROCEDURE_TK_ALG_TK_IDENTIFIER_TK_BEGIN_TK_END = 9, // ::= 'tk_alg' 'tk_Identifier' 'tk_begin' 'tk_end' - RULE_FUNCTION_TK_ALG_TK_IDENTIFIER_TK_ROUNDOPEN_TK_ROUNDCLOSE_TK_BEGIN_TK_END = 10, // ::= 'tk_alg' 'tk_Identifier' 'tk_RoundOpen' 'tk_RoundClose' 'tk_begin' 'tk_end' - RULE_FUNCTION_TK_ALG_TK_IDENTIFIER_TK_BEGIN_TK_END = 11, // ::= 'tk_alg' 'tk_Identifier' 'tk_begin' 'tk_end' - RULE_SUB_DECLARATIONS = 12, // ::= - RULE_SUB_DECLARATIONS2 = 13, // ::= - RULE_SUB_DECLARATIONS3 = 14, // ::= - RULE_SUB_DECLARATIONS4 = 15, // ::= - RULE_TYPE_TK_INTEGER_TYPE = 16, // ::= 'tk_integer_type' - RULE_TYPE_TK_REAL_TYPE = 17, // ::= 'tk_real_type' - RULE_TYPE_TK_BOOLEAN_TYPE = 18, // ::= 'tk_boolean_type' - RULE_TYPE_TK_CHAR_TYPE = 19, // ::= 'tk_char_type' - RULE_TYPE_TK_STRING_TYPE = 20, // ::= 'tk_string_type' - RULE_DIAP_TK_COLON = 21, // ::= 'tk_Colon' - RULE_DIAP_LIST_TK_COMMA = 22, // ::= 'tk_Comma' - RULE_DIAP_LIST = 23, // ::= - RULE_LIST_OF_EXPRESSIONS_TK_COMMA = 24, // ::= 'tk_Comma' - RULE_LIST_OF_EXPRESSIONS = 25, // ::= - RULE_ID_LIST1_TK_IDENTIFIER = 26, // ::= 'tk_Identifier' - RULE_ID_LIST1_TK_IDENTIFIER_TK_COMMA = 27, // ::= 'tk_Identifier' 'tk_Comma' - RULE_ARRAY_LIST1_TK_IDENTIFIER_TK_SQUAREOPEN_TK_SQUARECLOSE = 28, // ::= 'tk_Identifier' 'tk_SquareOpen' 'tk_SquareClose' - RULE_ARRAY_LIST1_TK_IDENTIFIER_TK_SQUAREOPEN_TK_SQUARECLOSE_TK_COMMA = 29, // ::= 'tk_Identifier' 'tk_SquareOpen' 'tk_SquareClose' 'tk_Comma' - RULE_ID_LIST2_TK_IDENTIFIER_TK_COMMA = 30, // ::= 'tk_Identifier' 'tk_Comma' - RULE_ID_LIST2_TK_IDENTIFIER_TK_COMMA2 = 31, // ::= 'tk_Identifier' 'tk_Comma' - RULE_ARRAY_LIST2_TK_IDENTIFIER_TK_SQUAREOPEN_TK_SQUARECLOSE_TK_COMMA = 32, // ::= 'tk_Identifier' 'tk_SquareOpen' 'tk_SquareClose' 'tk_Comma' - RULE_ARRAY_LIST2_TK_IDENTIFIER_TK_SQUAREOPEN_TK_SQUARECLOSE_TK_COMMA2 = 33, // ::= 'tk_Identifier' 'tk_SquareOpen' 'tk_SquareClose' 'tk_Comma' - RULE_VAR_DECLARATIONS1 = 34, // ::= - RULE_VAR_DECLARATIONS1_TK_ARRAY = 35, // ::= 'tk_array' - RULE_VAR_DECLARATIONS2 = 36, // ::= - RULE_VAR_DECLARATIONS2_TK_ARRAY = 37, // ::= 'tk_array' - RULE_VAR_DECL_LIST1 = 38, // ::= - RULE_VAR_DECL_LIST12 = 39, // ::= - RULE_VAR_DECL_LIST2 = 40, // ::= - RULE_VAR_DECL_LIST22 = 41, // ::= - RULE_DECLARATIONS = 42, // ::= - RULE_USES_UNITS_TK_USES = 43, // ::= 'tk_uses' - RULE_GLOBAL_DECL_LIST = 44, // ::= - RULE_GLOBAL_DECL_LIST2 = 45, // ::= - RULE_INITIALIZATION_TK_ASSIGN = 46, // ::= 'tk_Assign' - RULE_INITIALIZATION_TK_ASSIGN2 = 47, // ::= 'tk_Assign' - RULE_GLOBAL_VARS = 48, // ::= - RULE_GLOBAL_VARS2 = 49, // ::= - RULE_GLOBAL_PART = 50, // ::= - RULE_GLOBAL_PART2 = 51, // ::= - RULE_GLOBAL_PART3 = 52, // ::= - RULE_GLOBAL_PART4 = 53, // ::= - RULE_FORMAL_PARAMETER1 = 54, // ::= - RULE_FORMAL_PARAMETER1_TK_VAR = 55, // ::= 'tk_var' - RULE_FORMAL_PARAMETER1_TK_ARRAY = 56, // ::= 'tk_array' - RULE_FORMAL_PARAMETER1_TK_VAR_TK_ARRAY = 57, // ::= 'tk_var' 'tk_array' - RULE_FORMAL_PARAMETER2 = 58, // ::= - RULE_FORMAL_PARAMETER2_TK_VAR = 59, // ::= 'tk_var' - RULE_FORMAL_PARAMETER2_TK_ARRAY = 60, // ::= 'tk_array' - RULE_FORMAL_PARAMETER2_TK_VAR_TK_ARRAY = 61, // ::= 'tk_var' 'tk_array' - RULE_FORMAL_TYPE_LIST1 = 62, // ::= - RULE_FORMAL_TYPE_LIST12 = 63, // ::= - RULE_FORMAL_TYPE_LIST2 = 64, // ::= - RULE_FORMAL_TYPE_LIST22 = 65, // ::= - RULE_FORMAL_LIST = 66, // ::= - RULE_FORMAL_LIST2 = 67, // ::= - RULE_FACT_LIST = 68, // ::= - RULE_FACT_LIST2 = 69, // ::= - RULE_FREE_OPERATOR = 70, // ::= - RULE_CASE_VARIANT_LIST = 71, // ::= - RULE_CASE_VARIANT_LIST2 = 72, // ::= - RULE_CASE_VARIANT_TK_CASE_V_TK_COLON = 73, // ::= 'tk_case_v' 'tk_Colon' - RULE_STATEMENTS = 74, // ::= - RULE_STATEMENTS2 = 75, // ::= - RULE_STATEMENT = 76, // ::= - RULE_STATEMENT2 = 77, // ::= - RULE_STATEMENT_TK_ASSIGN = 78, // ::= 'tk_Assign' - RULE_STATEMENT_TK_IF_TK_THEN_TK_END_ALL = 79, // ::= 'tk_if' 'tk_then' 'tk_end_all' - RULE_STATEMENT_TK_IF_TK_THEN_TK_ELSE_TK_END_ALL = 80, // ::= 'tk_if' 'tk_then' 'tk_else' 'tk_end_all' - RULE_STATEMENT_TK_BEGIN_CYCLE_TK_RAZ_TK_END_CYCLE = 81, // ::= 'tk_begin_cycle' 'tk_raz' 'tk_end_cycle' - RULE_STATEMENT_TK_BEGIN_CYCLE_TK_FOR_TK_IDENTIFIER_TK_FROM_TK_TO_TK_END_CYCLE = 82, // ::= 'tk_begin_cycle' 'tk_for' 'tk_Identifier' 'tk_from' 'tk_to' 'tk_end_cycle' - RULE_STATEMENT_TK_BEGIN_CYCLE_TK_WHILE_TK_END_CYCLE = 83, // ::= 'tk_begin_cycle' 'tk_while' 'tk_end_cycle' - RULE_STATEMENT_TK_CASE_TK_END_ALL = 84, // ::= 'tk_case' 'tk_end_all' - RULE_STATEMENT_TK_CASE_TK_ELSE_TK_END_ALL = 85, // ::= 'tk_case' 'tk_else' 'tk_end_all' - RULE_STATEMENT_TK_ASSERT = 86, // ::= 'tk_assert' - RULE_STATEMENT_TK_READ = 87, // ::= 'tk_read' - RULE_STATEMENT_TK_WRITE = 88, // ::= 'tk_write' - RULE_STATEMENT_TK_IDENTIFIER_TK_ROUNDOPEN_TK_ROUNDCLOSE = 89, // ::= 'tk_Identifier' 'tk_RoundOpen' 'tk_RoundClose' - RULE_STATEMENT_TK_IDENTIFIER = 90, // ::= 'tk_Identifier' - RULE_EXPRESSION_TK_GREATER = 91, // ::= 'tk_Greater' - RULE_EXPRESSION_TK_LOWER = 92, // ::= 'tk_Lower' - RULE_EXPRESSION_TK_LOWEREQUAL = 93, // ::= 'tk_LowerEqual' - RULE_EXPRESSION_TK_GREATEREQUAL = 94, // ::= 'tk_GreaterEqual' - RULE_EXPRESSION_TK_EQUAL = 95, // ::= 'tk_Equal' - RULE_EXPRESSION_TK_NOTEQUAL = 96, // ::= 'tk_NotEqual' - RULE_EXPRESSION = 97, // ::= - RULE_ADDEXP_TK_OR = 98, // ::= 'tk_or' - RULE_ADDEXP_TK_PLUS = 99, // ::= 'tk_Plus' - RULE_ADDEXP_TK_MINUS = 100, // ::= 'tk_Minus' - RULE_ADDEXP = 101, // ::= - RULE_MULTEXP_TK_AND = 102, // ::= 'tk_and' - RULE_MULTEXP_TK_MULT = 103, // ::= 'tk_Mult' - RULE_MULTEXP_TK_DIV = 104, // ::= 'tk_Div' - RULE_MULTEXP = 105, // ::= - RULE_POWEREXP_TK_POWER = 106, // ::= 'tk_Power' - RULE_POWEREXP = 107, // ::= - RULE_NEGATEEXP_TK_MINUS = 108, // ::= 'tk_Minus' - RULE_NEGATEEXP_TK_NOT = 109, // ::= 'tk_not' - RULE_NEGATEEXP = 110, // ::= - RULE_VALUE_TK_IDENTIFIER = 111, // ::= 'tk_Identifier' - RULE_VALUE_TK_FUNC_VAL = 112, // ::= 'tk_func_val' - RULE_VALUE_TK_INTEGER = 113, // ::= 'tk_integer' - RULE_VALUE_TK_REAL = 114, // ::= 'tk_real' - RULE_VALUE_TK_TRUE = 115, // ::= 'tk_true' - RULE_VALUE_TK_FALSE = 116, // ::= 'tk_false' - RULE_VALUE_TK_STRINGLITERAL = 117, // ::= 'tk_StringLiteral' - RULE_VALUE_TK_CHAR = 118, // ::= 'tk_char' - RULE_VALUE_TK_EOL = 119, // ::= 'tk_eol' - RULE_VALUE_TK_IDENTIFIER_TK_SQUAREOPEN_TK_SQUARECLOSE_TK_SQUAREOPEN_TK_SQUARECLOSE = 120, // ::= 'tk_Identifier' 'tk_SquareOpen' 'tk_SquareClose' 'tk_SquareOpen' 'tk_SquareClose' - RULE_VALUE_TK_IDENTIFIER_TK_SQUAREOPEN_TK_SQUARECLOSE = 121, // ::= 'tk_Identifier' 'tk_SquareOpen' 'tk_SquareClose' - RULE_VALUE_TK_IDENTIFIER_TK_ROUNDOPEN_TK_ROUNDCLOSE = 122, // ::= 'tk_Identifier' 'tk_RoundOpen' 'tk_RoundClose' - RULE_VALUE_TK_ROUNDOPEN_TK_ROUNDCLOSE = 123 // ::= 'tk_RoundOpen' 'tk_RoundClose' - }; - - - - - - - - - - - - - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - //CreateTerminalObject - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - - private Object CreateTerminalObject(int TokenSymbolIndex) - { - switch (TokenSymbolIndex) - { - case (int)SymbolConstants.SYMBOL_EOF: - //(EOF) - return null; - - case (int)SymbolConstants.SYMBOL_ERROR: - //(Error) - return null; - - case (int)SymbolConstants.SYMBOL_WHITESPACE: - //(Whitespace) - return null; - - case (int)SymbolConstants.SYMBOL_COMMENTLINE: - //(Comment Line) - return null; - - case (int)SymbolConstants.SYMBOL_TK_ALG: - //'tk_alg' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_AND: - //'tk_and' - { - op_type_node _op_type_node = new op_type_node(Operators.LogicalAND); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_ARG: - //'tk_arg' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_ARRAY: - //'tk_array' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_ASSERT: - //'tk_assert' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_ASSIGN: - //'tk_Assign' - { - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_BEGIN: - //'tk_begin' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_BEGIN_CYCLE: - //'tk_begin_cycle' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_BOOLEAN_TYPE: - //'tk_boolean_type' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_CASE: - //'tk_case' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_CASE_V: - //'tk_case_v' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_CHAR: - //'tk_char' - return parsertools.create_char_const(this); - - case (int)SymbolConstants.SYMBOL_TK_CHAR_TYPE: - //'tk_char_type' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_COLON: - //'tk_Colon' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_COMMA: - //'tk_Comma' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_DIV: - //'tk_Div' - { - op_type_node _op_type_node = new op_type_node(Operators.Division); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_DOT: - //'tk_Dot' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_ELSE: - //'tk_else' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_END: - //'tk_end' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_END_ALL: - //'tk_end_all' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_END_CYCLE: - //'tk_end_cycle' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_EOL: - //'tk_eol' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_EQUAL: - //'tk_Equal' - { - op_type_node _op_type_node = new op_type_node(Operators.Equal); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_FALSE: - //'tk_false' - bool_const _bool_const = new bool_const(false); - _bool_const.source_context = parsertools.GetTokenSourceContext(); - return _bool_const; - - case (int)SymbolConstants.SYMBOL_TK_FOR: - //'tk_for' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_FROM: - //'tk_from' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_FUNC_VAL: - //'tk_func_val' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_GREATER: - //'tk_Greater' - { - op_type_node _op_type_node = new op_type_node(Operators.Greater); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_GREATEREQUAL: - //'tk_GreaterEqual' - { - op_type_node _op_type_node = new op_type_node(Operators.GreaterEqual); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_IDENTIFIER: - //'tk_Identifier' - return parsertools.create_ident(this); - - case (int)SymbolConstants.SYMBOL_TK_IF: - //'tk_if' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_INTEGER: - //'tk_integer' - return parsertools.create_int_const(this); - - case (int)SymbolConstants.SYMBOL_TK_INTEGER_TYPE: - //'tk_integer_type' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_ISP: - //'tk_isp' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_LOWER: - //'tk_Lower' - { - op_type_node _op_type_node = new op_type_node(Operators.Less); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_LOWEREQUAL: - //'tk_LowerEqual' - { - op_type_node _op_type_node = new op_type_node(Operators.LessEqual); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_MINUS: - //'tk_Minus' - { - op_type_node _op_type_node = new op_type_node(Operators.Minus); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_MULT: - //'tk_Mult' - { - op_type_node _op_type_node = new op_type_node(Operators.Multiplication); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_NEWLINE: - //'tk_NewLine' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_NOT: - //'tk_not' - { - op_type_node _op_type_node = new op_type_node(Operators.LogicalNOT); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_NOTEQUAL: - //'tk_NotEqual' - { - op_type_node _op_type_node = new op_type_node(Operators.NotEqual); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_OR: - //'tk_or' - { - op_type_node _op_type_node = new op_type_node(Operators.LogicalOR); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_PLUS: - //'tk_Plus' - { - op_type_node _op_type_node = new op_type_node(Operators.Plus); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_POWER: - //'tk_Power' - { // make it! - op_type_node _op_type_node = new op_type_node(Operators.Undefined); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TK_RAZ: - //'tk_raz' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_READ: - //'tk_read' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_REAL: - //'tk_real' - return parsertools.create_double_const(this); - - case (int)SymbolConstants.SYMBOL_TK_REAL_TYPE: - //'tk_real_type' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_ROUNDCLOSE: - //'tk_RoundClose' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_ROUNDOPEN: - //'tk_RoundOpen' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_SEMICOLON: - //'tk_SemiColon' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_SQUARECLOSE: - //'tk_SquareClose' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_SQUAREOPEN: - //'tk_SquareOpen' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_STRING_TYPE: - //'tk_string_type' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_STRINGLITERAL: - //'tk_StringLiteral' - return parsertools.create_string_const(this); - - case (int)SymbolConstants.SYMBOL_TK_THEN: - //'tk_then' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_TO: - //'tk_to' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_TRUE: - //'tk_true' - bool_const _true_const = new bool_const(true); - _true_const.source_context = parsertools.GetTokenSourceContext(); - return _true_const; - case (int)SymbolConstants.SYMBOL_TK_USES: - //'tk_uses' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_VAR: - //'tk_var' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_WHILE: - //'tk_while' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TK_WRITE: - //'tk_write' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_ADDEXP: - // - //TERMINAL:Add Exp - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_ARRAY_LIST1: - // - //TERMINAL:Array_list1 - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_ARRAY_LIST2: - // - //TERMINAL:Array_list2 - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_CASE_VARIANT: - // - //TERMINAL:Case_variant - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_CASE_VARIANT_LIST: - // - //TERMINAL:Case_variant_list - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_DECLARATIONS: - // - //TERMINAL:Declarations - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_DIAP: - // - //TERMINAL:Diap - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_DIAP_LIST: - // - //TERMINAL:Diap_list - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_EXPRESSION: - // - //TERMINAL:Expression - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_FACT_LIST: - // - //TERMINAL:Fact_list - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_FORMAL_LIST: - // - //TERMINAL:Formal_list - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_FORMAL_PARAMETER1: - // - //TERMINAL:Formal_parameter1 - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_FORMAL_PARAMETER2: - // - //TERMINAL:Formal_Parameter2 - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_FORMAL_TYPE_LIST1: - // - //TERMINAL:Formal_type_list1 - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_FORMAL_TYPE_LIST2: - // - //TERMINAL:Formal_type_list2 - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_FREE_OPERATOR: - // - //TERMINAL:Free_operator - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_FUNCTION: - // - //TERMINAL:Function - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_GLOBAL_DECL_LIST: - // - //TERMINAL:Global_decl_list - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_GLOBAL_PART: - // - //TERMINAL:Global_part - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_GLOBAL_VARS: - // - //TERMINAL:Global_vars - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_ID_LIST1: - // - //TERMINAL:Id_list1 - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_ID_LIST2: - // - //TERMINAL:Id_list2 - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_INITIALIZATION: - // - //TERMINAL:Initialization - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_LIST_OF_EXPRESSIONS: - // - //TERMINAL:List_of_expressions - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_MULTEXP: - // - //TERMINAL:Mult Exp - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_NEGATEEXP: - // - //TERMINAL:Negate Exp - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_POWEREXP: - // - //TERMINAL:Power Exp - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_PROCEDURE: - // - //TERMINAL:Procedure - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_PROGRAM: - // - //TERMINAL:Program - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_SEPARATOR: - // - //TERMINAL:Separator - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_SEPARATORS: - // - //TERMINAL:Separators - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_SEPARATORSOPT: - // - //TERMINAL:Separators Opt - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_STATEMENT: - // - //TERMINAL:Statement - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_STATEMENTS: - // - //TERMINAL:Statements - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_SUB_DECLARATIONS: - // - //TERMINAL:Sub_declarations - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_TYPE: - // - //TERMINAL:Type - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_USES_UNITS: - // - //TERMINAL:Uses_units - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_VALUE: - // - //TERMINAL:Value - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_VAR_DECL_LIST1: - // - //TERMINAL:Var_decl_list1 - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_VAR_DECL_LIST2: - // - //TERMINAL:Var_decl_list2 - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_VAR_DECLARATIONS1: - // - //TERMINAL:Var_declarations1 - return null; - //ENDTERMINAL - - case (int)SymbolConstants.SYMBOL_VAR_DECLARATIONS2: - // - //TERMINAL:Var_declarations2 - return null; - //ENDTERMINAL - - } - throw new SymbolException("Unknown symbol"); - } - - - - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - //Some methods - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - - public class unit_data - { - public declarations sub_progs; - public statement_list initialization; - public ident_list used_units; - - public unit_data() - { - sub_progs = new declarations(); - used_units = new ident_list(); - initialization = new statement_list(); - initialization.subnodes.Add(new empty_statement()); - } - - public void ClearData() - { - sub_progs.defs.Clear(); - used_units.idents.Clear(); - initialization.subnodes.Clear(); - initialization.subnodes.Add(new empty_statement()); - } - } - - public statement_list GetStatements(object _object) - { - statement_list _statement_list; - if (_object is statement_list) - _statement_list = _object as statement_list; - else - { - _statement_list = new statement_list(); - if (_object is statement) - _statement_list.subnodes.Add(_object as statement); - else - _statement_list.subnodes.Add(new empty_statement()); - } - return _statement_list; - } - - public expression_list GetExpressions(object _object) - { - expression_list _expression_list; - if (_object is expression_list) - _expression_list = _object as expression_list; - else - { - _expression_list = new expression_list(); - _expression_list.expressions.Add(_object as expression); - } - return _expression_list; - } - - public ident_list GetIdents(object _object) - { - ident_list _ident_list; - if (_object is ident_list) - _ident_list = _object as ident_list; - else - { - _ident_list = new ident_list(); - _ident_list.idents.Add(_object as ident); - } - return _ident_list; - } - - public indexers_types GetIndexers(object _object) - { - indexers_types _indexers_types; - if (_object is indexers_types) - _indexers_types = _object as indexers_types; - else - { - _indexers_types = new indexers_types(); - _indexers_types.indexers.Add(_object as diapason); - - } - return _indexers_types; - } - - public formal_parameters GetFormals(object _object) - { - if (_object == null) - return null; - formal_parameters _formal_parametres; - if (_object is formal_parameters) - _formal_parametres = _object as formal_parameters; - else - { - _formal_parametres = new formal_parameters(); - _formal_parametres.params_list.Add(_object as typed_parameters); - } - return _formal_parametres; - } - - public named_type_reference GetType(string name) - { //case ? - named_type_reference _named_type_reference = new named_type_reference(); - if (name == StringResources.Get("tk_integer_type")) _named_type_reference.names.Add(new ident("integer")); - if (name == StringResources.Get("tk_real_type")) _named_type_reference.names.Add(new ident("real")); - if (name == StringResources.Get("tk_boolean_type")) _named_type_reference.names.Add(new ident("boolean")); - if (name == StringResources.Get("tk_char_type")) _named_type_reference.names.Add(new ident("char")); - if (name == StringResources.Get("tk_string_type")) _named_type_reference.names.Add(new ident("string")); - return _named_type_reference; - } - - - - - - - - - - - - - - - - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - //CreateNonTerminalObject - /////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - - public Object CreateNonTerminalObject(int ReductionRuleIndex) - { - switch (ReductionRuleIndex) - { - case (int)RuleConstants.RULE_SEPARATOR_TK_SEMICOLON: - // ::= 'tk_SemiColon' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_SEPARATOR_TK_NEWLINE: - // ::= 'tk_NewLine' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_SEPARATORS: - // ::= - return LRParser.GetReductionSyntaxNode(1); - - case (int)RuleConstants.RULE_SEPARATORS2: - // ::= - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_SEPARATORSOPT: - // ::= - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_SEPARATORSOPT2: - // ::= - return null; - - case (int)RuleConstants.RULE_PROGRAM_TK_ALG_TK_IDENTIFIER_TK_BEGIN_TK_END: - // ::= 'tk_alg' 'tk_Identifier' 'tk_begin' 'tk_end' - { - program_module _program_module; - block _block; - statement_list _statement_list = GetStatements(LRParser.GetReductionSyntaxNode(6)); - program_name _program_name = new program_name((ident)LRParser.GetReductionSyntaxNode(3)); - - if ((_units[this.unit_number - 1] as unit_data).initialization.subnodes.Count != 0) - _statement_list.subnodes.InsertRange(0, (_units[this.unit_number - 1] as unit_data).initialization.subnodes); - - if ((_units[this.unit_number - 1] as unit_data).sub_progs.defs.Count != 0) - _block = new block((_units[this.unit_number - 1] as unit_data).sub_progs, _statement_list); - else - _block = new block(null, _statement_list); - - (_units[this.unit_number - 1] as unit_data).used_units.idents.Add(new ident("MathForKumir")); - - if ((_units[this.unit_number - 1] as unit_data).used_units.idents.Count != 0) - { - unit_or_namespace _unit_or_namespace; - uses_list _uses_list = new uses_list(); - - for (int i = 0; i < (_units[this.unit_number - 1] as unit_data).used_units.idents.Count; i++) - { - ident_list _ident_list = new ident_list(); - _ident_list.idents.Add((_units[this.unit_number - 1] as unit_data).used_units.idents[i]); - _unit_or_namespace = new unit_or_namespace(_ident_list); - _uses_list.units.Add(_unit_or_namespace); - } - _program_module = new program_module(_program_name, _uses_list, _block, null); - - } - else - _program_module = new program_module(_program_name, null, _block, null); - declarations _declarations = new declarations(); - _program_module.Language = LanguageId.PascalABCNET; - parsertools.create_source_context(_program_module, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(3)), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(8), LRParser.GetReductionSyntaxNode(7), LRParser.GetReductionSyntaxNode(6))); - parsertools.create_source_context(_block, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(2)), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(8), LRParser.GetReductionSyntaxNode(7))); - parsertools.create_source_context(_program_name, LRParser.GetReductionSyntaxNode(3), LRParser.GetReductionSyntaxNode(3)); - return _program_module; - } - - case (int)RuleConstants.RULE_PROGRAM_TK_ISP_TK_IDENTIFIER_TK_END: - // ::= 'tk_isp' 'tk_Identifier' 'tk_end' - { - interface_node _interface_node; - (_units[this.unit_number - 1] as unit_data).used_units.idents.Add(new ident("MathForKumir")); - if ((_units[this.unit_number - 1] as unit_data).used_units.idents.Count > 0) - { - unit_or_namespace _unit_or_namespace; - uses_list _uses_list = new uses_list(); - for (int i = 0; i < (_units[this.unit_number - 1] as unit_data).used_units.idents.Count; i++) - { - ident_list _ident_list = new ident_list(); - _ident_list.idents.Add((_units[this.unit_number - 1] as unit_data).used_units.idents[i]); - _unit_or_namespace = new unit_or_namespace(_ident_list); - _uses_list.units.Add(_unit_or_namespace); - } - _interface_node = new interface_node((_units[this.unit_number - 1] as unit_data).sub_progs, _uses_list, null); - } - else - _interface_node = new interface_node((_units[this.unit_number - 1] as unit_data).sub_progs, null, null); - unit_module _unit_module = new unit_module(new unit_name((ident)LRParser.GetReductionSyntaxNode(2), 0), _interface_node, null, (_units[this.unit_number - 1] as unit_data).initialization, null); - _unit_module.Language = LanguageId.PascalABCNET; - unit_name _unit_name = new unit_name((ident)LRParser.GetReductionSyntaxNode(2), 0); - parsertools.create_source_context(_unit_module, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(3)), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(6), LRParser.GetReductionSyntaxNode(5))); - parsertools.create_source_context(_unit_name, LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(2)); - - return _unit_module; - } - - case (int)RuleConstants.RULE_PROCEDURE_TK_ALG_TK_IDENTIFIER_TK_ROUNDOPEN_TK_ROUNDCLOSE_TK_BEGIN_TK_END: - // ::= 'tk_alg' 'tk_Identifier' 'tk_RoundOpen' 'tk_RoundClose' 'tk_begin' 'tk_end' - { - method_name _method_name = new method_name(null, (ident)LRParser.GetReductionSyntaxNode(1), null); - procedure_header _procedure_header = new procedure_header(GetFormals(LRParser.GetReductionSyntaxNode(3)), null, _method_name, false, false, null,null); - statement_list _statement_list = GetStatements(LRParser.GetReductionSyntaxNode(7)); - block _block = new block(null, _statement_list); - - procedure_definition _procedure_definition = new procedure_definition(_procedure_header, _block); - parsertools.create_source_context(_method_name, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_procedure_header, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(4)); - parsertools.create_source_context(_procedure_definition, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(8)); - parsertools.create_source_context(_block, LRParser.GetReductionSyntaxNode(6), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(8), LRParser.GetReductionSyntaxNode(7))); - (_units[this.unit_number - 1] as unit_data).sub_progs.defs.Add(_procedure_definition); - - return _procedure_definition; - } - - case (int)RuleConstants.RULE_PROCEDURE_TK_ALG_TK_IDENTIFIER_TK_BEGIN_TK_END: - // ::= 'tk_alg' 'tk_Identifier' 'tk_begin' 'tk_end' - { - method_name _method_name = new method_name(null, (ident)LRParser.GetReductionSyntaxNode(1), null); - procedure_header _procedure_header = new procedure_header(null, null, _method_name, false, false, null,null); - statement_list _statement_list = GetStatements(LRParser.GetReductionSyntaxNode(4)); - block _block = new block(null, _statement_list); - - procedure_definition _procedure_definition = new procedure_definition(_procedure_header, _block); - - parsertools.create_source_context(_method_name, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_procedure_header, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_procedure_definition, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(5)); - parsertools.create_source_context(_block, LRParser.GetReductionSyntaxNode(3), LRParser.GetReductionSyntaxNode(5)); - (_units[this.unit_number - 1] as unit_data).sub_progs.defs.Add(_procedure_definition); - declarations _declarations = new declarations(); - _declarations.defs.Add(_procedure_definition); - parsertools.create_source_context(_declarations, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(5), LRParser.GetReductionSyntaxNode(4))); - - return _procedure_definition; - } - - case (int)RuleConstants.RULE_FUNCTION_TK_ALG_TK_IDENTIFIER_TK_ROUNDOPEN_TK_ROUNDCLOSE_TK_BEGIN_TK_END: - // ::= 'tk_alg' 'tk_Identifier' 'tk_RoundOpen' 'tk_RoundClose' 'tk_begin' 'tk_end' - { - method_name _method_name = new method_name(null, LRParser.GetReductionSyntaxNode(2) as ident, null); - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(1)).text.ToLower()); - - function_header _function_header = new function_header(_named_type_reference); - _function_header.of_object = false; - _function_header.name = _method_name; - _function_header.parameters = GetFormals(LRParser.GetReductionSyntaxNode(4)); - - statement_list _statement_list = GetStatements(LRParser.GetReductionSyntaxNode(8)); - block _block = new block(null, _statement_list); - - procedure_definition _procedure_definition = new procedure_definition(_function_header, _block); - parsertools.create_source_context(_method_name, LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_function_header, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(5)); - parsertools.create_source_context(_procedure_definition, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(9)); - parsertools.create_source_context(_block, LRParser.GetReductionSyntaxNode(7), LRParser.GetReductionSyntaxNode(9)); - (_units[this.unit_number - 1] as unit_data).sub_progs.defs.Add(_procedure_definition); - declarations _declarations = new declarations(); - _declarations.defs.Add(_procedure_definition); - parsertools.create_source_context(_declarations, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(9)); - return _procedure_definition; - } - - case (int)RuleConstants.RULE_FUNCTION_TK_ALG_TK_IDENTIFIER_TK_BEGIN_TK_END: - // ::= 'tk_alg' 'tk_Identifier' 'tk_begin' 'tk_end' - { - method_name _method_name = new method_name(null, LRParser.GetReductionSyntaxNode(2) as ident, null); - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(1)).text.ToLower()); - - function_header _function_header = new function_header(_named_type_reference); - _function_header.of_object = false; - _function_header.name = _method_name; - - statement_list _statement_list = GetStatements(LRParser.GetReductionSyntaxNode(5)); - block _block = new block(null, _statement_list); - - procedure_definition _procedure_definition = new procedure_definition(_function_header, _block); - parsertools.create_source_context(_method_name, LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_function_header, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_procedure_definition, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(6)); - parsertools.create_source_context(_block, LRParser.GetReductionSyntaxNode(4), LRParser.GetReductionSyntaxNode(6)); - (_units[this.unit_number - 1] as unit_data).sub_progs.defs.Add(_procedure_definition); - return _procedure_definition; - } - - case (int)RuleConstants.RULE_SUB_DECLARATIONS: - // ::= - return null; - - case (int)RuleConstants.RULE_SUB_DECLARATIONS2: - // ::= - { - declarations _declarations; - if (LRParser.GetReductionSyntaxNode(0) != null) - { - _declarations = (declarations)LRParser.GetReductionSyntaxNode(0); - _declarations.defs.Add((declaration)LRParser.GetReductionSyntaxNode(1)); - } - else - { - _declarations = new declarations(); - _declarations.defs.Add((declaration)LRParser.GetReductionSyntaxNode(1)); - } - // - parsertools.create_source_context(_declarations, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)), LRParser.GetReductionSyntaxNode(1)); - return _declarations; - } - - case (int)RuleConstants.RULE_SUB_DECLARATIONS3: - // ::= - { - declarations _declarations; - if (LRParser.GetReductionSyntaxNode(0) != null) - { - _declarations = (declarations)LRParser.GetReductionSyntaxNode(0); - _declarations.defs.Add((declaration)LRParser.GetReductionSyntaxNode(1)); - } - else - { - _declarations = new declarations(); - _declarations.defs.Add((declaration)LRParser.GetReductionSyntaxNode(1)); - } - parsertools.create_source_context(_declarations, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)), LRParser.GetReductionSyntaxNode(1)); - return _declarations; - } - - case (int)RuleConstants.RULE_SUB_DECLARATIONS4: - // ::= - { - declarations _declarations; - if (LRParser.GetReductionSyntaxNode(0) != null) - { - _declarations = (declarations)LRParser.GetReductionSyntaxNode(0); - } - else - { - _declarations = new declarations(); - - } - parsertools.create_source_context(_declarations, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(0))); - return _declarations; - } - - - case (int)RuleConstants.RULE_TYPE_TK_INTEGER_TYPE: - // ::= 'tk_integer_type' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_TYPE_TK_REAL_TYPE: - // ::= 'tk_real_type' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_TYPE_TK_BOOLEAN_TYPE: - // ::= 'tk_boolean_type' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_TYPE_TK_CHAR_TYPE: - // ::= 'tk_char_type' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_TYPE_TK_STRING_TYPE: - // ::= 'tk_string_type' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_DIAP_TK_COLON: - // ::= 'tk_Colon' - { - diapason _diapason = new diapason(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression); - - parsertools.create_source_context(_diapason, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - return _diapason; - } - - case (int)RuleConstants.RULE_DIAP_LIST_TK_COMMA: - // ::= 'tk_Comma' - { - indexers_types _indexers_types = GetIndexers(LRParser.GetReductionSyntaxNode(0)); - _indexers_types.indexers.Add(LRParser.GetReductionSyntaxNode(2) as diapason); - - parsertools.create_source_context(_indexers_types, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - return _indexers_types; - } - - case (int)RuleConstants.RULE_DIAP_LIST: - // ::= - { - indexers_types _indexers_types = new indexers_types(); - _indexers_types.indexers.Add(LRParser.GetReductionSyntaxNode(0) as diapason); - - parsertools.create_source_context(_indexers_types, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - return _indexers_types; - } - - case (int)RuleConstants.RULE_LIST_OF_EXPRESSIONS_TK_COMMA: - // ::= 'tk_Comma' - { - expression_list _expression_list = GetExpressions(LRParser.GetReductionSyntaxNode(0)); - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(2) as expression); - - parsertools.create_source_context(_expression_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - return _expression_list; - } - - case (int)RuleConstants.RULE_LIST_OF_EXPRESSIONS: - // ::= - { - expression_list _expression_list = new expression_list(); - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(0) as expression); - - _expression_list.source_context = ((expression)LRParser.GetReductionSyntaxNode(0)).source_context; - return _expression_list; - } - - case (int)RuleConstants.RULE_ID_LIST1_TK_IDENTIFIER: - // ::= 'tk_Identifier' - { - ident_list _ident_list = new ident_list(); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(0) as ident); - - _ident_list.source_context = ((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - return _ident_list; - } - - case (int)RuleConstants.RULE_ID_LIST1_TK_IDENTIFIER_TK_COMMA: - // ::= 'tk_Identifier' 'tk_Comma' - { - ident_list _ident_list = GetIdents(LRParser.GetReductionSyntaxNode(2)); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(0) as ident); - - parsertools.create_source_context(_ident_list, LRParser.GetReductionSyntaxNode(0), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(0))); - return _ident_list; - } - - case (int)RuleConstants.RULE_ARRAY_LIST1_TK_IDENTIFIER_TK_SQUAREOPEN_TK_SQUARECLOSE: - // ::= 'tk_Identifier' 'tk_SquareOpen' 'tk_SquareClose' - { - ident_list _ident_list = new ident_list(); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(0) as ident); - - indexers_types _indexers_types = GetIndexers(LRParser.GetReductionSyntaxNode(2)); - array_type _array_type = new array_type(_indexers_types, null); - - var_def_statement _var_def_statement = new var_def_statement(_ident_list, _array_type, null, definition_attribute.None, false); - variable_definitions _variable_definitions = new variable_definitions(); - _variable_definitions.var_definitions.Add(_var_def_statement); - - //_ident_list.source_context = ((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - parsertools.create_source_context(_array_type, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(3)); - //parsertools.create_source_context(LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_ident_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_indexers_types, LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_variable_definitions, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_var_def_statement, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(3)); - return _variable_definitions; - } - - case (int)RuleConstants.RULE_ARRAY_LIST1_TK_IDENTIFIER_TK_SQUAREOPEN_TK_SQUARECLOSE_TK_COMMA: - // ::= 'tk_Identifier' 'tk_SquareOpen' 'tk_SquareClose' 'tk_Comma' - { - ident_list _ident_list = new ident_list(); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(0) as ident); - - indexers_types _indexers_types = GetIndexers(LRParser.GetReductionSyntaxNode(2)); - array_type _array_type = new array_type(_indexers_types, null); - - var_def_statement _var_def_statement = new var_def_statement(_ident_list, _array_type, null, definition_attribute.None, false); - variable_definitions _variable_definitions = (LRParser.GetReductionSyntaxNode(5) as variable_definitions); - _variable_definitions.var_definitions.Add(_var_def_statement); - - //_ident_list.source_context = ((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - parsertools.create_source_context(_array_type, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_ident_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - //parsertools.create_source_context(LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_indexers_types, LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_variable_definitions, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(5)); - parsertools.create_source_context(_var_def_statement, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(3)); - return _variable_definitions; - } - - case (int)RuleConstants.RULE_ID_LIST2_TK_IDENTIFIER_TK_COMMA: - // ::= 'tk_Identifier' 'tk_Comma' - { - ident_list _ident_list = new ident_list(); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(0) as ident); - - _ident_list.source_context = ((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - return _ident_list; - } - - case (int)RuleConstants.RULE_ID_LIST2_TK_IDENTIFIER_TK_COMMA2: - // ::= 'tk_Identifier' 'tk_Comma' - { - ident_list _ident_list = GetIdents(LRParser.GetReductionSyntaxNode(2)); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(0) as ident); - - parsertools.create_source_context(_ident_list, LRParser.GetReductionSyntaxNode(0), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(0))); - return _ident_list; - } - - case (int)RuleConstants.RULE_ARRAY_LIST2_TK_IDENTIFIER_TK_SQUAREOPEN_TK_SQUARECLOSE_TK_COMMA: - // ::= 'tk_Identifier' 'tk_SquareOpen' 'tk_SquareClose' 'tk_Comma' - { - ident_list _ident_list = new ident_list(); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(0) as ident); - - indexers_types _indexers_types = GetIndexers(LRParser.GetReductionSyntaxNode(2)); - array_type _array_type = new array_type(_indexers_types, null); - - var_def_statement _var_def_statement = new var_def_statement(_ident_list, _array_type, null, definition_attribute.None, false); - variable_definitions _variable_definitions = new variable_definitions(); - _variable_definitions.var_definitions.Add(_var_def_statement); - - //_ident_list.source_context = ((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - parsertools.create_source_context(_array_type, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_ident_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - //parsertools.create_source_context(LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_indexers_types, LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(2)); - - parsertools.create_source_context(_variable_definitions, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_var_def_statement, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(3)); - return _variable_definitions; - } - - case (int)RuleConstants.RULE_ARRAY_LIST2_TK_IDENTIFIER_TK_SQUAREOPEN_TK_SQUARECLOSE_TK_COMMA2: - // ::= 'tk_Identifier' 'tk_SquareOpen' 'tk_SquareClose' 'tk_Comma' - { - ident_list _ident_list = new ident_list(); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(0) as ident); - - indexers_types _indexers_types = GetIndexers(LRParser.GetReductionSyntaxNode(2)); - array_type _array_type = new array_type(_indexers_types, null); - - var_def_statement _var_def_statement = new var_def_statement(_ident_list, _array_type, null, definition_attribute.None, false); - variable_definitions _variable_definitions = (LRParser.GetReductionSyntaxNode(5) as variable_definitions); - _variable_definitions.var_definitions.Add(_var_def_statement); - - //_ident_list.source_context = ((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - parsertools.create_source_context(_array_type, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_ident_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - //parsertools.create_source_context(LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_indexers_types, LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(2)); - - parsertools.create_source_context(_variable_definitions, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(5)); - parsertools.create_source_context(_var_def_statement, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(3)); - return _variable_definitions; - } - - case (int)RuleConstants.RULE_VAR_DECLARATIONS1: - // ::= - { - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(0)).text.ToLower()); - - var_def_statement _var_def_statement = new var_def_statement(GetIdents(LRParser.GetReductionSyntaxNode(1)), _named_type_reference, null, definition_attribute.None, false); - var_statement _var_statement = new var_statement(_var_def_statement); - - parsertools.create_source_context(_var_def_statement, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_var_statement, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_named_type_reference, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - return _var_statement; - } - - case (int)RuleConstants.RULE_VAR_DECLARATIONS1_TK_ARRAY: - // ::= 'tk_array' - { - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(0)).text.ToLower()); - - statement_list var_statement_list = new statement_list(); - - variable_definitions _variable_definitions = LRParser.GetReductionSyntaxNode(2) as variable_definitions; - for (int i = 0; i < _variable_definitions.var_definitions.Count; i++) - { - ((_variable_definitions.var_definitions[i]).vars_type as array_type).elemets_types = _named_type_reference; - var_statement _var_statement = new var_statement((var_def_statement)_variable_definitions.var_definitions[i]); - var_statement_list.subnodes.Add(_var_statement); - - parsertools.create_source_context(_var_statement, _variable_definitions.var_definitions[i], _variable_definitions.var_definitions[i]); - - } - parsertools.create_source_context(_named_type_reference.names[0], LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_variable_definitions, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(var_statement_list, LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_named_type_reference, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - return var_statement_list; - } - - case (int)RuleConstants.RULE_VAR_DECLARATIONS2: - // ::= - { - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(0)).text.ToLower()); - var_def_statement _var_def_statement = new var_def_statement(GetIdents(LRParser.GetReductionSyntaxNode(1)), _named_type_reference, null, definition_attribute.None, false); - var_statement _var_statement = new var_statement(_var_def_statement); - - parsertools.create_source_context(_var_def_statement, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_var_statement, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_named_type_reference, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - return _var_statement; - } - - case (int)RuleConstants.RULE_VAR_DECLARATIONS2_TK_ARRAY: - // ::= 'tk_array' - { - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(0)).text.ToLower()); - - statement_list var_statement_list = new statement_list(); - - variable_definitions _variable_definitions = LRParser.GetReductionSyntaxNode(2) as variable_definitions; - for (int i = 0; i < _variable_definitions.var_definitions.Count; i++) - { - ((_variable_definitions.var_definitions[i]).vars_type as array_type).elemets_types = _named_type_reference; - var_statement _var_statement = new var_statement((var_def_statement)_variable_definitions.var_definitions[i]); - var_statement_list.subnodes.Add(_var_statement); - - parsertools.create_source_context(_var_statement, _variable_definitions.var_definitions[i], _variable_definitions.var_definitions[i]); - } - - parsertools.create_source_context(_named_type_reference.names[0], LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(var_statement_list, LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_variable_definitions, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_named_type_reference, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - - return var_statement_list; - } - - case (int)RuleConstants.RULE_VAR_DECL_LIST1: - // ::= - { - statement_list var_statement_list = GetStatements(LRParser.GetReductionSyntaxNode(0)); - - parsertools.create_source_context(var_statement_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - return var_statement_list; - } - - case (int)RuleConstants.RULE_VAR_DECL_LIST12: - // ::= - { - statement_list var_statement_list = GetStatements(LRParser.GetReductionSyntaxNode(0)); - var_statement_list.subnodes.AddRange(GetStatements(LRParser.GetReductionSyntaxNode(1)).subnodes); - - parsertools.create_source_context(var_statement_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - return var_statement_list; - } - - case (int)RuleConstants.RULE_VAR_DECL_LIST2: - // ::= - { - statement_list var_statement_list = GetStatements(LRParser.GetReductionSyntaxNode(0)); - - parsertools.create_source_context(var_statement_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - return var_statement_list; - } - - case (int)RuleConstants.RULE_VAR_DECL_LIST22: - // ::= - { - statement_list var_statement_list = GetStatements(LRParser.GetReductionSyntaxNode(0)); - var_statement_list.subnodes.AddRange(GetStatements(LRParser.GetReductionSyntaxNode(1)).subnodes); - - parsertools.create_source_context(var_statement_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - return var_statement_list; - } - - - case (int)RuleConstants.RULE_DECLARATIONS: - // ::= - return LRParser.GetReductionSyntaxNode(0); - - //------------------------- Globals - - case (int)RuleConstants.RULE_USES_UNITS_TK_USES: - // ::= 'tk_uses' - { - if (_units[unit_number - 1] != null) - (_units[unit_number - 1] as unit_data).used_units.idents.AddRange(((ident_list)LRParser.GetReductionSyntaxNode(1)).idents); - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - return LRParser.GetReductionSyntaxNode(1); - - //return null; - } - - case (int)RuleConstants.RULE_GLOBAL_DECL_LIST: - // ::= - { - statement_list _statement_list = GetStatements(LRParser.GetReductionSyntaxNode(0)); - _statement_list.subnodes.AddRange(GetStatements(LRParser.GetReductionSyntaxNode(2)).subnodes); - parsertools.create_source_context(_statement_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - return _statement_list; - } - - case (int)RuleConstants.RULE_GLOBAL_DECL_LIST2: - // ::= - { // etot kod pohoje inogda ne vipolniaetsia hotia pravilo srabativaet - statement_list _statement_list = GetStatements(LRParser.GetReductionSyntaxNode(0)); - for (int i = 0; i < _statement_list.subnodes.Count; i++) - (_units[this.unit_number - 1] as unit_data).sub_progs.defs.Add(_statement_list.subnodes[i] as declaration); - parsertools.create_source_context(_statement_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - return _statement_list; - } - - case (int)RuleConstants.RULE_INITIALIZATION_TK_ASSIGN: - // ::= 'tk_Assign' - { - assign _assign = new assign((addressed_value)LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(4) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(3)).type); - (_units[this.unit_number - 1] as unit_data).initialization.subnodes.Add(_assign); - - parsertools.create_source_context(_assign, LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(4)); - return null; - } - - case (int)RuleConstants.RULE_INITIALIZATION_TK_ASSIGN2: - // ::= 'tk_Assign' - { - assign _assign = new assign((addressed_value)LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - (_units[this.unit_number - 1] as unit_data).initialization.subnodes.Add(_assign); - - parsertools.create_source_context(_assign, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - return null; - } - - case (int)RuleConstants.RULE_GLOBAL_VARS: - // ::= - { - declarations _declarations = new declarations(); - //_declarations.defs.Add((declaration)LRParser.GetReductionSyntaxNode(2)); - statement_list _statement_list = GetStatements(LRParser.GetReductionSyntaxNode(0)); - for (int i = 0; i < _statement_list.subnodes.Count; i++) - { - (_units[this.unit_number - 1] as unit_data).sub_progs.defs.Add(_statement_list.subnodes[i] as declaration); - _declarations.defs.Add(_statement_list.subnodes[i] as declaration); - } - parsertools.create_source_context(_declarations, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(3)), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3), LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(0))); - return _declarations; - } - - case (int)RuleConstants.RULE_GLOBAL_VARS2: - // ::= - { - //declarations _declarations = (declarations)LRParser.GetReductionSyntaxNode(0); - declarations _declarations = new declarations(); - statement_list _statement_list = GetStatements(LRParser.GetReductionSyntaxNode(0)); - for (int i = 0; i < _statement_list.subnodes.Count; i++) - { - (_units[this.unit_number - 1] as unit_data).sub_progs.defs.Add(_statement_list.subnodes[i] as declaration); - _declarations.defs.Add(_statement_list.subnodes[i] as declaration); - } - parsertools.create_source_context(_declarations, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(0))); - return _declarations; - } - - case (int)RuleConstants.RULE_GLOBAL_PART: - // ::= - return null; - - case (int)RuleConstants.RULE_GLOBAL_PART2: - // ::= - { - //declarations _declarations = (declarations)LRParser.GetReductionSyntaxNode(0); - //parsertools.create_source_context(_declarations, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(0))); - return null; - } - - case (int)RuleConstants.RULE_GLOBAL_PART3: - // ::= - { - //declarations _declarations = (declarations)LRParser.GetReductionSyntaxNode(0); - //_declarations.defs.AddRange(((declarations)LRParser.GetReductionSyntaxNode(2)).defs); - //parsertools.create_source_context(_declarations, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(2)), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(0))); - return null; - } - case (int)RuleConstants.RULE_GLOBAL_PART4: - // ::= - { - //declarations _declarations = (declarations)LRParser.GetReductionSyntaxNode(0); - //parsertools.create_source_context(_declarations, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - return null; - } - - case (int)RuleConstants.RULE_FORMAL_PARAMETER1: - // ::= - { - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(0)).text.ToLower()); - ident_list _ident_list = GetIdents(LRParser.GetReductionSyntaxNode(1)); - _ident_list.idents.Reverse(); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, _named_type_reference, parametr_kind.none, null); - formal_parameters _formal_parametres = new formal_parameters(); - _formal_parametres.params_list.Add(_typed_parametres); - - parsertools.create_source_context(_typed_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_formal_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - return _formal_parametres; - } - - case (int)RuleConstants.RULE_FORMAL_PARAMETER1_TK_VAR: - // ::= 'tk_var' - { - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(1)).text.ToLower()); - ident_list _ident_list = GetIdents(LRParser.GetReductionSyntaxNode(2)); - _ident_list.idents.Reverse(); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, _named_type_reference, parametr_kind.var_parametr, null); - formal_parameters _formal_parametres = new formal_parameters(); - _formal_parametres.params_list.Add(_typed_parametres); - - parsertools.create_source_context(_typed_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_formal_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - return _formal_parametres; - } - - case (int)RuleConstants.RULE_FORMAL_PARAMETER1_TK_ARRAY: - // ::= 'tk_array' - { - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(0)).text.ToLower()); - variable_definitions _variable_definitions = LRParser.GetReductionSyntaxNode(2) as variable_definitions; - formal_parameters _formal_parametres = new formal_parameters(); - _variable_definitions.var_definitions.Reverse(); - - for (int i = 0; i < _variable_definitions.var_definitions.Count; i++) - { - ((_variable_definitions.var_definitions[i]).vars_type as array_type).elemets_types = _named_type_reference; - _formal_parametres.params_list.Add(new typed_parameters((_variable_definitions.var_definitions[i]).vars, (_variable_definitions.var_definitions[i]).vars_type, parametr_kind.none, null)); - } - _variable_definitions.var_definitions.Clear(); - - parsertools.create_source_context(_formal_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_variable_definitions, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_named_type_reference, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - return _formal_parametres; - } - - case (int)RuleConstants.RULE_FORMAL_PARAMETER1_TK_VAR_TK_ARRAY: - // ::= 'tk_var' 'tk_array' - { - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(1)).text.ToLower()); - variable_definitions _variable_definitions = LRParser.GetReductionSyntaxNode(3) as variable_definitions; - formal_parameters _formal_parametres = new formal_parameters(); - _variable_definitions.var_definitions.Reverse(); - - for (int i = 0; i < _variable_definitions.var_definitions.Count; i++) - { - ((_variable_definitions.var_definitions[i]).vars_type as array_type).elemets_types = _named_type_reference; - _formal_parametres.params_list.Add(new typed_parameters((_variable_definitions.var_definitions[i]).vars, (_variable_definitions.var_definitions[i]).vars_type, parametr_kind.var_parametr, null)); - } - _variable_definitions.var_definitions.Clear(); - - parsertools.create_source_context(_formal_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_variable_definitions, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_named_type_reference, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(3)); - return _formal_parametres; - } - - case (int)RuleConstants.RULE_FORMAL_PARAMETER2: - // ::= - { - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(0)).text.ToLower()); - ident_list _ident_list = GetIdents(LRParser.GetReductionSyntaxNode(1)); - _ident_list.idents.Reverse(); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, _named_type_reference, parametr_kind.none, null); - formal_parameters _formal_parametres = new formal_parameters(); - _formal_parametres.params_list.Add(_typed_parametres); - - parsertools.create_source_context(_typed_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_formal_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - return _formal_parametres; - } - - case (int)RuleConstants.RULE_FORMAL_PARAMETER2_TK_VAR: - // ::= 'tk_var' - { - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(1)).text.ToLower()); - ident_list _ident_list = GetIdents(LRParser.GetReductionSyntaxNode(2)); - _ident_list.idents.Reverse(); - - typed_parameters _typed_parametres = new typed_parameters(_ident_list, _named_type_reference, parametr_kind.var_parametr, null); - formal_parameters _formal_parametres = new formal_parameters(); - _formal_parametres.params_list.Add(_typed_parametres); - - parsertools.create_source_context(_typed_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_formal_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - return _formal_parametres; - } - - case (int)RuleConstants.RULE_FORMAL_PARAMETER2_TK_ARRAY: - // ::= 'tk_array' - { - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(0)).text.ToLower()); - variable_definitions _variable_definitions = LRParser.GetReductionSyntaxNode(2) as variable_definitions; - formal_parameters _formal_parametres = new formal_parameters(); - _variable_definitions.var_definitions.Reverse(); - - for (int i = 0; i < _variable_definitions.var_definitions.Count; i++) - { - ((_variable_definitions.var_definitions[i]).vars_type as array_type).elemets_types = _named_type_reference; - _formal_parametres.params_list.Add(new typed_parameters((_variable_definitions.var_definitions[i]).vars, (_variable_definitions.var_definitions[i]).vars_type, parametr_kind.none, null)); - } - _variable_definitions.var_definitions.Clear(); - - parsertools.create_source_context(_formal_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_variable_definitions, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - return _formal_parametres; - } - - case (int)RuleConstants.RULE_FORMAL_PARAMETER2_TK_VAR_TK_ARRAY: - // ::= 'tk_var' 'tk_array' - { - named_type_reference _named_type_reference = GetType(((token_info)LRParser.GetReductionSyntaxNode(1)).text.ToLower()); - variable_definitions _variable_definitions = LRParser.GetReductionSyntaxNode(3) as variable_definitions; - formal_parameters _formal_parametres = new formal_parameters(); - _variable_definitions.var_definitions.Reverse(); - - for (int i = 0; i < _variable_definitions.var_definitions.Count; i++) - { - ((_variable_definitions.var_definitions[i]).vars_type as array_type).elemets_types = _named_type_reference; - _formal_parametres.params_list.Add(new typed_parameters((_variable_definitions.var_definitions[i]).vars, (_variable_definitions.var_definitions[i]).vars_type, parametr_kind.var_parametr, null)); - } - _variable_definitions.var_definitions.Clear(); - - parsertools.create_source_context(_variable_definitions, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_formal_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(3)); - return _formal_parametres; - } - - case (int)RuleConstants.RULE_FORMAL_TYPE_LIST1: - // ::= - { - formal_parameters _formal_parametres = GetFormals(LRParser.GetReductionSyntaxNode(0)); - - parsertools.create_source_context(_formal_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - return _formal_parametres; - } - - case (int)RuleConstants.RULE_FORMAL_TYPE_LIST12: - // ::= - { - formal_parameters _formal_parametres = GetFormals(LRParser.GetReductionSyntaxNode(0)); - _formal_parametres.params_list.AddRange(GetFormals(LRParser.GetReductionSyntaxNode(1)).params_list); - - parsertools.create_source_context(_formal_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - return _formal_parametres; - } - - case (int)RuleConstants.RULE_FORMAL_TYPE_LIST2: - // ::= - { - formal_parameters _formal_parametres = GetFormals(LRParser.GetReductionSyntaxNode(0)); - - parsertools.create_source_context(_formal_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - return _formal_parametres; - } - - case (int)RuleConstants.RULE_FORMAL_TYPE_LIST22: - // ::= - { - formal_parameters _formal_parametres = GetFormals(LRParser.GetReductionSyntaxNode(0)); - _formal_parametres.params_list.AddRange(GetFormals(LRParser.GetReductionSyntaxNode(1)).params_list); - - parsertools.create_source_context(_formal_parametres, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - return _formal_parametres; - } - - case (int)RuleConstants.RULE_FORMAL_LIST: - // ::= - return null; - - case (int)RuleConstants.RULE_FORMAL_LIST2: - // ::= - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_FACT_LIST: - // ::= - return null; - - case (int)RuleConstants.RULE_FACT_LIST2: - // ::= - return LRParser.GetReductionSyntaxNode(0); - - //-------------------------- Operators - - case (int)RuleConstants.RULE_FREE_OPERATOR: - // ::= - return null; - - case (int)RuleConstants.RULE_CASE_VARIANT_LIST: - // ::= - { - if_node _if_node1; - if (LRParser.GetReductionSyntaxNode(1) is case_variant) - { - case_variant _case_variant1 = (case_variant)LRParser.GetReductionSyntaxNode(1); - _if_node1 = new if_node((expression)_case_variant1.conditions.expressions[0], GetStatements(_case_variant1.exec_if_true), null); - parsertools.create_source_context(_if_node1, LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(1)); //make - - } - else - _if_node1 = LRParser.GetReductionSyntaxNode(1) as if_node; - - case_variant _case_variant = (case_variant)LRParser.GetReductionSyntaxNode(0); - if_node _if_node = new if_node((expression)_case_variant.conditions.expressions[0], _case_variant.exec_if_true, _if_node1); - - parsertools.create_source_context(_if_node, LRParser.GetReductionSyntaxNode(0), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(0))); //make - return _if_node; - } - - case (int)RuleConstants.RULE_CASE_VARIANT_LIST2: - // ::= - { //unreacheable rule.. ? - case_variant _case_variant = (case_variant)LRParser.GetReductionSyntaxNode(0); - if_node _if_node = new if_node(GetExpressions(_case_variant.conditions), (statement)_case_variant.exec_if_true, null); - - parsertools.create_source_context(_if_node, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); //make - return _if_node; - } - - case (int)RuleConstants.RULE_CASE_VARIANT_TK_CASE_V_TK_COLON: - // ::= 'tk_case_v' 'tk_Colon' - { - expression_list _expression_list = GetExpressions(LRParser.GetReductionSyntaxNode(1)); - case_variant _case_variant = new case_variant(_expression_list, GetStatements(LRParser.GetReductionSyntaxNode(3))); - - //_case_variant.source_context = (GetExpressions(LRParser.GetReductionSyntaxNode(1))).source_context; - parsertools.create_source_context(_case_variant, LRParser.GetReductionSyntaxNode(0), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3), LRParser.GetReductionSyntaxNode(2))); - return _case_variant; - } - - case (int)RuleConstants.RULE_STATEMENTS: - // ::= - { - statement_list _statement_list = GetStatements(LRParser.GetReductionSyntaxNode(0)); - _statement_list.subnodes.AddRange(GetStatements(LRParser.GetReductionSyntaxNode(2)).subnodes); - - parsertools.create_source_context(_statement_list, parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(0))); - //parsertools.create_source_context(_statement_list, _statement_list, _statement_list); //make - return _statement_list; - } - - case (int)RuleConstants.RULE_STATEMENTS2: - // ::= - { - statement_list _statement_list = GetStatements(LRParser.GetReductionSyntaxNode(0)); - - parsertools.create_source_context(_statement_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - return _statement_list; - } - - case (int)RuleConstants.RULE_STATEMENT: - // ::= - { - empty_statement _empty_statement = new empty_statement(); - - return _empty_statement; - } - - case (int)RuleConstants.RULE_STATEMENT2: - // ::= - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_STATEMENT_TK_ASSIGN: - // ::= 'tk_Assign' - { - assign _assign = new assign((addressed_value)LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - - parsertools.create_source_context(_assign, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - return _assign; - } - - case (int)RuleConstants.RULE_STATEMENT_TK_IF_TK_THEN_TK_END_ALL: - // ::= 'tk_if' 'tk_then' 'tk_end_all' - { - if_node _if_node = new if_node((expression)LRParser.GetReductionSyntaxNode(1), GetStatements(LRParser.GetReductionSyntaxNode(3)), null); - - parsertools.create_source_context(_if_node, LRParser.GetReductionSyntaxNode(0), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(4), LRParser.GetReductionSyntaxNode(2))); - return _if_node; - } - - case (int)RuleConstants.RULE_STATEMENT_TK_IF_TK_THEN_TK_ELSE_TK_END_ALL: - // ::= 'tk_if' 'tk_then' 'tk_else' 'tk_end_all' - { - if_node _if_node = new if_node((expression)LRParser.GetReductionSyntaxNode(1), GetStatements(LRParser.GetReductionSyntaxNode(3)), GetStatements(LRParser.GetReductionSyntaxNode(5))); - - parsertools.create_source_context(_if_node, LRParser.GetReductionSyntaxNode(0), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(6), LRParser.GetReductionSyntaxNode(2))); - return _if_node; - } - - case (int)RuleConstants.RULE_STATEMENT_TK_BEGIN_CYCLE_TK_RAZ_TK_END_CYCLE: - // ::= 'tk_begin_cycle' 'tk_raz' 'tk_end_cycle' - { // remake without "_system_loop_var_" ! - int32_const _int32_const = new int32_const(1); - ident loop_var = new ident("&_system_loop_var"); - statement_list _statement_list = GetStatements(LRParser.GetReductionSyntaxNode(3)); - - for_node _for_node = new for_node(loop_var, _int32_const, (expression)LRParser.GetReductionSyntaxNode(1), _statement_list, for_cycle_type.to, null, null, true); - - parsertools.create_source_context(_for_node, LRParser.GetReductionSyntaxNode(0), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(4), LRParser.GetReductionSyntaxNode(1))); - if ((_statement_list as statement).source_context != null) - parsertools.create_source_context(_statement_list, LRParser.GetReductionSyntaxNode(3), LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_for_node, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(4)); - return _for_node; - } - - case (int)RuleConstants.RULE_STATEMENT_TK_BEGIN_CYCLE_TK_FOR_TK_IDENTIFIER_TK_FROM_TK_TO_TK_END_CYCLE: - // ::= 'tk_begin_cycle' 'tk_for' 'tk_Identifier' 'tk_from' 'tk_to' 'tk_end_cycle' - { - for_node _for_node = new for_node((ident)LRParser.GetReductionSyntaxNode(2), (expression)LRParser.GetReductionSyntaxNode(4), (expression)LRParser.GetReductionSyntaxNode(6), GetStatements(LRParser.GetReductionSyntaxNode(7)), for_cycle_type.to, null, null, false); - - parsertools.create_source_context(_for_node, LRParser.GetReductionSyntaxNode(0), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(8), LRParser.GetReductionSyntaxNode(1))); - parsertools.create_source_context(GetStatements(LRParser.GetReductionSyntaxNode(7)), LRParser.GetReductionSyntaxNode(7), LRParser.GetReductionSyntaxNode(7)); - return _for_node; - } - - case (int)RuleConstants.RULE_STATEMENT_TK_BEGIN_CYCLE_TK_WHILE_TK_END_CYCLE: - // ::= 'tk_begin_cycle' 'tk_while' 'tk_end_cycle' - { - while_node _while_node = new while_node((expression)LRParser.GetReductionSyntaxNode(2), GetStatements(LRParser.GetReductionSyntaxNode(3)), WhileCycleType.While); - - parsertools.create_source_context(_while_node, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(4)); - return _while_node; - } - - case (int)RuleConstants.RULE_STATEMENT_TK_CASE_TK_END_ALL: - // ::= 'tk_case' 'tk_end_all' - { - if_node _if_node; - if (LRParser.GetReductionSyntaxNode(2) is case_variant) - { - case_variant _case_variant = (case_variant)LRParser.GetReductionSyntaxNode(2); - _if_node = new if_node((expression)_case_variant.conditions.expressions[0], (statement)_case_variant.exec_if_true, null); - - parsertools.create_source_context(_if_node, LRParser.GetReductionSyntaxNode(0), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3), LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(1))); //make - return _if_node; - } - else{ - if_node _if_node1; - _if_node = (if_node)LRParser.GetReductionSyntaxNode(2); - _if_node1 = _if_node; - while (_if_node1.else_body is if_node) - _if_node1 = _if_node1.else_body as if_node; - - _if_node1.else_body = null; - parsertools.create_source_context(_if_node, LRParser.GetReductionSyntaxNode(0), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3), LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(1))); - return _if_node; - - } - } - - case (int)RuleConstants.RULE_STATEMENT_TK_CASE_TK_ELSE_TK_END_ALL: - // ::= 'tk_case' 'tk_else' 'tk_end_all' - { - if_node _if_node; - if (LRParser.GetReductionSyntaxNode(2) is case_variant) - { - case_variant _case_variant = (case_variant)LRParser.GetReductionSyntaxNode(2); - _if_node = new if_node((expression)_case_variant.conditions.expressions[0], (statement)_case_variant.exec_if_true, GetStatements(LRParser.GetReductionSyntaxNode(4))); - - parsertools.create_source_context(_if_node, LRParser.GetReductionSyntaxNode(0), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(5), LRParser.GetReductionSyntaxNode(4), LRParser.GetReductionSyntaxNode(3), LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(1))); //make - return _if_node; - } - else - { - if_node _if_node1; - _if_node = (if_node)LRParser.GetReductionSyntaxNode(2); - _if_node1 = _if_node; - while (_if_node1.else_body is if_node) - _if_node1 = _if_node1.else_body as if_node; - - - _if_node1.else_body = GetStatements(LRParser.GetReductionSyntaxNode(4)); - // _if_node1.else_body.source_context.end_position - //parsertools.create_source_context(_if_node1, LRParser.GetReductionSyntaxNode(2), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(5), LRParser.GetReductionSyntaxNode(4), LRParser.GetReductionSyntaxNode(3))); //make - parsertools.create_source_context(_if_node, LRParser.GetReductionSyntaxNode(0), parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(5), LRParser.GetReductionSyntaxNode(4), LRParser.GetReductionSyntaxNode(3), LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(1))); //make - return _if_node; - } - } - - case (int)RuleConstants.RULE_STATEMENT_TK_ASSERT: - // ::= 'tk_assert' - { //make it! - procedure_call _procedure_call = new procedure_call(); - expression_list _expression_list = new expression_list(); - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(1)); - method_call _method_call = new method_call(_expression_list); - _method_call.dereferencing_value = new ident("assert"); - _procedure_call.func_name = _method_call; - - parsertools.create_source_context(_method_call.dereferencing_value, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_expression_list, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_method_call, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_procedure_call, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - - return _procedure_call; - } - - case (int)RuleConstants.RULE_STATEMENT_TK_READ: - // ::= 'tk_read' - { - procedure_call _procedure_call = new procedure_call(); - expression_list _expression_list = new expression_list(); - ident_list _ident_list = GetIdents(LRParser.GetReductionSyntaxNode(1)); - - for (int i = 0; i < _ident_list.idents.Count; i++) - { - _expression_list.expressions.Add(_ident_list.idents[i] as expression); - } - _ident_list.idents.Clear(); - - method_call _method_call = new method_call(_expression_list); - _method_call.dereferencing_value = new ident("read"); - _procedure_call.func_name = _method_call; - - parsertools.create_source_context(_method_call.dereferencing_value, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_ident_list, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_method_call, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_procedure_call, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - return _procedure_call; - } - - case (int)RuleConstants.RULE_STATEMENT_TK_WRITE: - // ::= 'tk_write' - { - procedure_call _procedure_call = new procedure_call(); - expression_list _expression_list = GetExpressions(LRParser.GetReductionSyntaxNode(1)); - method_call _method_call = new method_call(_expression_list); - _method_call.dereferencing_value = new ident("write"); - _procedure_call.func_name = _method_call; - - parsertools.create_source_context(_method_call.dereferencing_value, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_expression_list, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_method_call, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_procedure_call, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - return _procedure_call; - } - - case (int)RuleConstants.RULE_STATEMENT_TK_IDENTIFIER_TK_ROUNDOPEN_TK_ROUNDCLOSE: - // ::= 'tk_Identifier' 'tk_RoundOpen' 'tk_RoundClose' - { - procedure_call _procedure_call = new procedure_call(); - method_call _method_call; - expression_list _expression_list; - - if (LRParser.GetReductionSyntaxNode(2) != null) - { - _expression_list = GetExpressions(LRParser.GetReductionSyntaxNode(2)); - _method_call = new method_call(_expression_list); - } - else - _method_call = new method_call(); - - - _method_call.dereferencing_value = new ident(((ident)LRParser.GetReductionSyntaxNode(0)).name); - _procedure_call.func_name = _method_call; - - parsertools.create_source_context(_method_call.dereferencing_value, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - //parsertools.create_source_context(_expression_list, LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_method_call, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_procedure_call, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(3)); - return _procedure_call; - } - - - case (int)RuleConstants.RULE_STATEMENT_TK_IDENTIFIER: - // ::= 'tk_Identifier' - { - procedure_call _procedure_call = new procedure_call(); - method_call _method_call = new method_call(null); - _method_call.dereferencing_value = new ident(((ident)LRParser.GetReductionSyntaxNode(0)).name); - _procedure_call.func_name = _method_call; - - parsertools.create_source_context(_method_call.dereferencing_value, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); parsertools.create_source_context(_method_call, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_procedure_call, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - return _procedure_call; - } - - case (int)RuleConstants.RULE_EXPRESSION_TK_GREATER: - // ::= 'tk_Greater' - { - bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - - parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - return _bin_expr; - } - - case (int)RuleConstants.RULE_EXPRESSION_TK_LOWER: - // ::= 'tk_Lower' - { - bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_EXPRESSION_TK_LOWEREQUAL: - // ::= 'tk_LowerEqual' - { - bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_EXPRESSION_TK_GREATEREQUAL: - // ::= 'tk_GreaterEqual' - { - bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_EXPRESSION_TK_EQUAL: - // ::= 'tk_Equal' - { - bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_EXPRESSION_TK_NOTEQUAL: - // ::= 'tk_NotEqual' - { - bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_EXPRESSION: - // ::= - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_ADDEXP_TK_OR: - // ::= 'tk_or' - { - bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_ADDEXP_TK_PLUS: - // ::= 'tk_Plus' - { - bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_ADDEXP_TK_MINUS: - // ::= 'tk_Minus' - { - bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_ADDEXP: - // ::= - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_MULTEXP_TK_AND: - // ::= 'tk_and' - { - bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_MULTEXP_TK_MULT: - // ::= 'tk_Mult' - { - bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_MULTEXP_TK_DIV: - // ::= 'tk_Div' - { - bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_MULTEXP: - // ::= - return LRParser.GetReductionSyntaxNode(0); //make it! - - case (int)RuleConstants.RULE_POWEREXP_TK_POWER: - { - // ::= 'tk_Power' - - expression_list _expression_list = new expression_list(); - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(0) as expression); - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(2) as expression); - method_call _method_call = new method_call(_expression_list); - _method_call.dereferencing_value = new ident("Power"); - parsertools.create_source_context(_method_call.dereferencing_value, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_method_call, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - return _method_call; - - //bin_expr _bin_expr = new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression, LRParser.GetReductionSyntaxNode(2) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - //parsertools.create_source_context(_bin_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - - //return _bin_expr; - } - case (int)RuleConstants.RULE_POWEREXP: - // ::= - return LRParser.GetReductionSyntaxNode(0); //make it! - - case (int)RuleConstants.RULE_NEGATEEXP_TK_MINUS: - // ::= 'tk_Minus' - { - un_expr _un_expr = new un_expr(LRParser.GetReductionSyntaxNode(1) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(0)).type); - parsertools.create_source_context(_un_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - - return _un_expr; - } - - case (int)RuleConstants.RULE_NEGATEEXP_TK_NOT: - // ::= 'tk_not' - { - un_expr _un_expr = new un_expr(LRParser.GetReductionSyntaxNode(1) as expression, ((op_type_node)LRParser.GetReductionSyntaxNode(0)).type); - parsertools.create_source_context(_un_expr, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - - return _un_expr; - } - - case (int)RuleConstants.RULE_NEGATEEXP: - // ::= - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_VALUE_TK_IDENTIFIER: - // ::= 'tk_Identifier' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_VALUE_TK_FUNC_VAL: - // ::= 'tk_func_val' - return new ident("result"); - - case (int)RuleConstants.RULE_VALUE_TK_INTEGER: - // ::= 'tk_integer' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_VALUE_TK_REAL: - // ::= 'tk_real' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_VALUE_TK_TRUE: - // ::= 'tk_true' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_VALUE_TK_FALSE: - // ::= 'tk_false' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_VALUE_TK_STRINGLITERAL: - // ::= 'tk_StringLiteral' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_VALUE_TK_CHAR: - // ::= 'tk_char' - return LRParser.GetReductionSyntaxNode(0); - - case (int)RuleConstants.RULE_VALUE_TK_EOL: - // ::= 'tk_eol' - { - literal_const_line _literal_const_line = new literal_const_line(); - sharp_char_const _sharp_char_const_13 = new sharp_char_const(13); - sharp_char_const _sharp_char_const_10 = new sharp_char_const(10); - _literal_const_line.literals.Add(_sharp_char_const_13); - _literal_const_line.literals.Add(_sharp_char_const_10); - - parsertools.create_source_context(_sharp_char_const_13, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); //make - parsertools.create_source_context(_sharp_char_const_10, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); //make - parsertools.create_source_context(_literal_const_line, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); //make - return _literal_const_line; - } - - case (int)RuleConstants.RULE_VALUE_TK_IDENTIFIER_TK_SQUAREOPEN_TK_SQUARECLOSE_TK_SQUAREOPEN_TK_SQUARECLOSE: - // ::= 'tk_Identifier' 'tk_SquareOpen' 'tk_SquareClose' 'tk_SquareOpen' 'tk_SquareClose' - { - - indexer _indexer = new indexer(GetExpressions(LRParser.GetReductionSyntaxNode(2))); - indexer _indexer1 = new indexer(GetExpressions(LRParser.GetReductionSyntaxNode(5))); - _indexer.dereferencing_value = LRParser.GetReductionSyntaxNode(0) as ident; - _indexer1.dereferencing_value = _indexer; - parsertools.create_source_context(_indexer, LRParser.GetReductionSyntaxNode(2), LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_indexer, LRParser.GetReductionSyntaxNode(5), LRParser.GetReductionSyntaxNode(5)); - return _indexer1; - } - - case (int)RuleConstants.RULE_VALUE_TK_IDENTIFIER_TK_SQUAREOPEN_TK_SQUARECLOSE: - // ::= 'tk_Identifier' 'tk_SquareOpen' 'tk_SquareClose' - { - - indexer _indexer = new indexer(GetExpressions(LRParser.GetReductionSyntaxNode(2))); - _indexer.dereferencing_value = LRParser.GetReductionSyntaxNode(0) as ident; - parsertools.create_source_context(_indexer, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(3)); - return _indexer; - } - - case (int)RuleConstants.RULE_VALUE_TK_IDENTIFIER_TK_ROUNDOPEN_TK_ROUNDCLOSE: - // ::= 'tk_Identifier' 'tk_RoundOpen' 'tk_RoundClose' - { - expression_list _expression_list; - method_call _method_call; - if (LRParser.GetReductionSyntaxNode(2) != null) - { - _expression_list = GetExpressions(LRParser.GetReductionSyntaxNode(2)); - _method_call = new method_call(_expression_list); - } - else - _method_call = new method_call(); - switch (((ident)LRParser.GetReductionSyntaxNode(0)).name) - { - case "tg": _method_call.dereferencing_value = new ident("tan"); break; - case "ctg": _method_call.dereferencing_value = new ident("ctg"); break; - case "arctg": _method_call.dereferencing_value = new ident("arctan"); break; - case "arcctg": _method_call.dereferencing_value = new ident("arcctg"); break; - case "lg": _method_call.dereferencing_value = new ident("log10"); break; - case "mod": _method_call.dereferencing_value = new ident("md"); break; - case "div": _method_call.dereferencing_value = new ident("dv"); break; - case "rnd": _method_call.dereferencing_value = new ident("random"); break; - case "int": _method_call.dereferencing_value = new ident("round"); break; - - default: - _method_call.dereferencing_value = new ident(((ident)LRParser.GetReductionSyntaxNode(0)).name); - break; - } - //_method_call.dereferencing_value = LRParser.GetReductionSyntaxNode(0) as ident; - - parsertools.create_source_context(_method_call.dereferencing_value, LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_method_call, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - return _method_call; - } - - case (int)RuleConstants.RULE_VALUE_TK_ROUNDOPEN_TK_ROUNDCLOSE: - // ::= 'tk_RoundOpen' 'tk_RoundClose' - return LRParser.GetReductionSyntaxNode(1); - - } - throw new RuleException("Unknown rule"); - } - - - - - - - } -} diff --git a/Parsers/KuMirParser/Parser.cs b/Parsers/KuMirParser/Parser.cs deleted file mode 100644 index 9b50e2ac1..000000000 --- a/Parsers/KuMirParser/Parser.cs +++ /dev/null @@ -1,161 +0,0 @@ -using System; -using System.IO; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Parsers; -using System.Resources; -using System.Reflection; -using PascalABCCompiler.Errors; -using System.Collections.Generic; - - -namespace PascalABCCompiler.KuMirParser -{ - - public class KuMirLanguageParser : IParser - { - GPBParser_KuMir parser; - - public KuMirLanguageParser() - { - filesExtensions = new string[1]; - filesExtensions[0] = ".alg"; - } - - string[] filesExtensions; - public string[] FilesExtensions - { - get - { - return filesExtensions; - } - } - - public ILanguageInformation LanguageInformation { - get { - return new DefaultLanguageInformation(this); - } - } - - public void Reset() - { - parser = new GPBParser_KuMir(CGTResourceExtractor.Extract(new ResourceManager("KuMirParser.KuMirLang", Assembly.GetExecutingAssembly()), "KuMirLanguage")); - parser.max_errors = 30; - } - - public bool CaseSensitive - { - get - { - return parser.LanguageGrammar.CaseSensitive; - } - } - - - public List CompilerDirectives - { - get - { - return new List(); - } - } - SourceFilesProviderDelegate sourceFilesProvider = null; - public SourceFilesProviderDelegate SourceFilesProvider - { - get - { - return sourceFilesProvider; - } - set - { - sourceFilesProvider = value; - } - } - - List errors = new List(); - public List Errors - { - get - { - return errors; - } - set - { - errors = value; - } - } - public Keyword[] Keywords - { - get - { - return new Keyword[0]; - } - } - - - public syntax_tree_node BuildTree(string FileName, string Text, string[] SearchPatchs, ParseMode ParseMode) - { - if (parser == null) - Reset(); - parser.errors = Errors; - parser.current_file_name = FileName; - parser.parsertools.LineCorrection = 0; - syntax_tree_node cu = null; - switch (ParseMode) - { - case ParseMode.Normal: - cu = (syntax_tree_node)parser.Parse(Text); - break; - case ParseMode.Expression: - case ParseMode.Statement: - return null; - } - if (cu != null && cu is compilation_unit) - { - (cu as compilation_unit).file_name = FileName; - (cu as compilation_unit).compiler_directives = CompilerDirectives; - } - return cu; - } - - public string Name - { - get - { - return "KuMir"; - } - } - public string Version - { - get - { - return "1.0"; - } - } - public string Copyright - { - get - { - return "(c) 3 course"; - } - } - - public override string ToString() - { - return "KuMir Language Parser v1.0"; - } - - public IPreprocessor Preprocessor - { - get - { - return null; - } - } - - - } - - - -} diff --git a/Parsers/KuMirParser/Properties/AssemblyInfo.cs b/Parsers/KuMirParser/Properties/AssemblyInfo.cs deleted file mode 100644 index 3cb461afa..000000000 --- a/Parsers/KuMirParser/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("KuMirParser")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("3c")] -[assembly: AssemblyProduct("KuMirParser")] -[assembly: AssemblyCopyright("Copyright © 3c 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("48d49307-d409-4acd-878e-0e6561b69c9f")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Parsers/PL0Parser/Errors.cs b/Parsers/PL0Parser/Errors.cs deleted file mode 100644 index 0eca9f430..000000000 --- a/Parsers/PL0Parser/Errors.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -//using com.calitha.goldparser; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.PL0Parser; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.Errors; -using System.Collections.Generic; - - -namespace PascalABCCompiler.PL0Parser.Errors -{ - public class UnexpectedToken : SyntaxError - { - private string _message; - public UnexpectedToken(PascalABCCompiler.ParserTools.GPBParser parser) - : base("", parser.current_file_name, parser.parsertools.GetTokenSourceContext(parser.LRParser), (syntax_tree_node)parser.prev_node) - { - List Symbols = parser.parsertools.GetPrioritySymbols(parser.LRParser.GetExpectedTokens()); - if (Symbols.Count == 1) - { - string OneSybmolText = "ONE_" + Symbols[0].Name.ToUpper(); - string LocOneSybmolText = StringResources.Get(OneSybmolText); - if (LocOneSybmolText != OneSybmolText) - { - _message = string.Format(LocOneSybmolText); - return; - } - } - _message = string.Format(StringResources.Get("EXPECTED{0}"), PascalABCCompiler.FormatTools.ObjectsToString(parser.parsertools.SymbolsToStrings(Symbols.ToArray()), ",")); - } - public UnexpectedToken(string _file_name, string expected, SourceContext _source_context, syntax_tree_node _node) - : base("", _file_name, _source_context, _node) - { - _message = string.Format(StringResources.Get("EXPECTED{0}"), expected); - } - public override string Message - { - get - { - return _message; - } - } - } - -} diff --git a/Parsers/PL0Parser/PL0Lang.resources b/Parsers/PL0Parser/PL0Lang.resources deleted file mode 100644 index ed4a002db..000000000 Binary files a/Parsers/PL0Parser/PL0Lang.resources and /dev/null differ diff --git a/Parsers/PL0Parser/PL0Parser.csproj b/Parsers/PL0Parser/PL0Parser.csproj deleted file mode 100644 index 4be18235e..000000000 --- a/Parsers/PL0Parser/PL0Parser.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0DE2DAD6-D1E9-435E-8A19-91DA2AD3B59B} - Library - Properties - PL0Parser - PL0Parser - - - 4.0 - - - v4.0 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - ..\..\bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - ..\..\bin\ - TRACE - prompt - 4 - AllRules.ruleset - - - - - - - - - - - - - - - - - {44A01F9E-DCE7-470C-AAE5-C3DE0CCBEE3B} - Errors - - - {2DE2842F-0912-4251-BC0F-480854C44A13} - Localization - - - {AF2EFD7B-69DD-4B43-AF65-B59B29349C23} - ParserTools - - - {C2CAC65A-B2AE-4CCC-B067-E6B8E75DF73A} - SyntaxTree - - - - - - - - False - КлиентÑ�кий профиль .NET Framework 3.5 SP1 - false - - - False - .NET Framework 3.5 SP1 - true - - - False - УÑ�тановщик Windows 3.1 - true - - - - - \ No newline at end of file diff --git a/Parsers/PL0Parser/PL0ParserTools.cs b/Parsers/PL0Parser/PL0ParserTools.cs deleted file mode 100644 index cf21f7354..000000000 --- a/Parsers/PL0Parser/PL0ParserTools.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Text; -//using com.calitha.goldparser; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.ParserTools; -using GoldParser; - - -namespace PascalABCCompiler.PL0Parser -{ - public static class StringResources - { - private static string prefix = "PL0PARSER_"; - public static string Get(string Id) - { - string ret = PascalABCCompiler.StringResources.Get(prefix + Id); - if (ret == prefix + Id) - return Id; - else - return ret; - } - } - - public class PL0_parsertools:parser_tools - { - public override string symbol_to_string(Symbol symbol) - { - switch (symbol.Index) - { - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKMINUS: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKSLASH: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKSTAR: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKGREATER: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKGREATEREQUAL: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKLOWER: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKLOWEREQUAL: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKNOTEQUAL: - return StringResources.Get("OPERATOR"); - } - string res = StringResources.Get(symbol.Name.ToUpper()); - if (res.IndexOf("TK") == 0) - return res.Remove(0, 2).ToLower(); - return res; - } - - public override int symbol_priority(Symbol symbol) - { - - switch (symbol.Index) - { - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKEND: - return 8; - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKBEGIN: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKNUMBER: - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKROUNDCLOSE: - return 9; - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKIDENT: - return 10; - - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKASSIGN: - return 25; - - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKEQUAL: - return 25; - - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_TKSEMICOLON: - return 30; - - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_EXPRESSION: - return 100; - case (int)GPBParser_PL0.SymbolConstants.SYMBOL_STATEMENT: - return 110; - - } - if (symbol.SymbolType == SymbolType.Terminal) - return 1; - return 0; - } - - - } -} diff --git a/Parsers/PL0Parser/PL0_lrparser.cs b/Parsers/PL0Parser/PL0_lrparser.cs deleted file mode 100644 index 010638264..000000000 --- a/Parsers/PL0Parser/PL0_lrparser.cs +++ /dev/null @@ -1,101 +0,0 @@ - -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.PL0Parser.Errors; -using PascalABCCompiler.ParserTools; - -namespace PascalABCCompiler.PL0Parser -{ - public partial class GPBParser_PL0 : GPBParser - { - private Stack NodesStack; - private SyntaxError error; - - Stream GrammarStream; - - public GPBParser_PL0(Stream stream) - : base(stream) - { - GrammarStream = stream; - parsertools = new PL0_parsertools(); - } - - public object Parse(string source) - { - NodesStack = new Stack(); - LRParser = new GoldParser.Parser(new StringReader(source), LanguageGrammar); - parsertools.parser = LRParser; - LRParser.TrimReductions = true; - try - { - while (true) - { - switch (LRParser.Parse()) - { - case GoldParser.ParseMessage.LexicalError: - errors.Add(new TokenReadError(this)); - LRParser.PopInputToken(); - if (errors.Count >= max_errors) - return null; - break; - - //sdes nugno vesti chtoto vrode steka poslednix oshibok. podumat - case GoldParser.ParseMessage.SyntaxError: - GoldParser.Symbol sym = LRParser.PopInputToken(); - error = new PL0Parser.Errors.UnexpectedToken(this); - //error = new UnexpectedToken(this, parsertools.symbol_collection_to_string(this.LRParser.GetExpectedTokens())); - if (sym.SymbolType == GoldParser.SymbolType.End && errors.Count > 0) - return null; - errors.Add(error); - if (errors.Count >= max_errors) - return null; - break; - case GoldParser.ParseMessage.Reduction: - LRParser.TokenSyntaxNode = CreateNonTerminalObject(LRParser.ReductionRule.Index); - if ((LRParser.TokenSyntaxNode as syntax_tree_node) != null) - prev_node = LRParser.TokenSyntaxNode; - break; - - case GoldParser.ParseMessage.Accept: - return LRParser.TokenSyntaxNode; - - case GoldParser.ParseMessage.TokenRead: - LRParser.TokenSyntaxNode = CreateTerminalObject(LRParser.TokenSymbol.Index); - break; - - case GoldParser.ParseMessage.InternalError: - errors.Add(new CompilerInternalError("PL0Parser", new Exception("ParseMessage.InternalError"))); - return null; - - case GoldParser.ParseMessage.NotLoadedError: - errors.Add(new CompilerInternalError("PL0Parser", new Exception("ParseMessage.NotLoadedError"))); - return null; - - case GoldParser.ParseMessage.CommentError: - errors.Add(new PascalABCCompiler.Errors.UnexpectedToken(this, "(EOF)")); - return null; - - /*case ParseMessage.CommentBlockRead: - break; - - case ParseMessage.CommentLineRead: - break;*/ - } - } - } - catch (Exception e) - { - if (errors.Count > 0) - return null; - else - throw; - } - - } - } - -} diff --git a/Parsers/PL0Parser/PL0_lrparser_rules.cs b/Parsers/PL0Parser/PL0_lrparser_rules.cs deleted file mode 100644 index cffaa5e6c..000000000 --- a/Parsers/PL0Parser/PL0_lrparser_rules.cs +++ /dev/null @@ -1,1060 +0,0 @@ - -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.PL0Parser.Errors; -using PascalABCCompiler.ParserTools; -using GoldParser; - -namespace PascalABCCompiler.PL0Parser -{ -public partial class GPBParser_PL0 : GPBParser -{ - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//SymbolConstants -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public enum SymbolConstants : int -{ - SYMBOL_EOF = 0, // (EOF) - SYMBOL_ERROR = 1, // (Error) - SYMBOL_WHITESPACE = 2, // (Whitespace) - SYMBOL_COMMENTEND = 3, // (Comment End) - SYMBOL_COMMENTLINE = 4, // (Comment Line) - SYMBOL_COMMENTSTART = 5, // (Comment Start) - SYMBOL_TKASSIGN = 6, // 'tkAssign' - SYMBOL_TKBEGIN = 7, // 'tkBegin' - SYMBOL_TKCALL = 8, // 'tkCall' - SYMBOL_TKCOMMA = 9, // 'tkComma' - SYMBOL_TKCONST = 10, // 'tkConst' - SYMBOL_TKDO = 11, // 'tkDo' - SYMBOL_TKDOT = 12, // 'tkDot' - SYMBOL_TKEND = 13, // 'tkEnd' - SYMBOL_TKEQUAL = 14, // 'tkEqual' - SYMBOL_TKGREATER = 15, // 'tkGreater' - SYMBOL_TKGREATEREQUAL = 16, // 'tkGreaterEqual' - SYMBOL_TKIDENT = 17, // 'tkIdent' - SYMBOL_TKIF = 18, // 'tkIf' - SYMBOL_TKLOWER = 19, // 'tkLower' - SYMBOL_TKLOWEREQUAL = 20, // 'tkLowerEqual' - SYMBOL_TKMINUS = 21, // 'tkMinus' - SYMBOL_TKNOTEQUAL = 22, // 'tkNotEqual' - SYMBOL_TKNUMBER = 23, // 'tkNumber' - SYMBOL_TKODD = 24, // 'tkOdd' - SYMBOL_TKPLUS = 25, // 'tkPlus' - SYMBOL_TKPROCEDURE = 26, // 'tkProcedure' - SYMBOL_TKREADLN = 27, // 'tkReadln' - SYMBOL_TKROUNDCLOSE = 28, // 'tkRoundClose' - SYMBOL_TKROUNDOPEN = 29, // 'tkRoundOpen' - SYMBOL_TKSEMICOLON = 30, // 'tkSemiColon' - SYMBOL_TKSLASH = 31, // 'tkSlash' - SYMBOL_TKSTAR = 32, // 'tkStar' - SYMBOL_TKTHEN = 33, // 'tkThen' - SYMBOL_TKVAR = 34, // 'tkVar' - SYMBOL_TKWHILE = 35, // 'tkWhile' - SYMBOL_TKWRITELN = 36, // 'tkWriteln' - SYMBOL_ADDOP = 37, // - SYMBOL_BLOCK = 38, // - SYMBOL_COMPOUND_STATEMENT = 39, // - SYMBOL_CONSTANTS = 40, // - SYMBOL_CONSTDECL = 41, // - SYMBOL_CONSTDEF = 42, // - SYMBOL_DECLARATION = 43, // - SYMBOL_DECLARATIONS = 44, // - SYMBOL_EMPTY = 45, // - SYMBOL_EXPR_LIST = 46, // - SYMBOL_EXPRESSION = 47, // - SYMBOL_FACTOR = 48, // - SYMBOL_MULOP = 49, // - SYMBOL_OPT_DECLARATIONS = 50, // - SYMBOL_OPT_PARAMS_LIST = 51, // - SYMBOL_PROC_DECL = 52, // - SYMBOL_PROGRAM = 53, // - SYMBOL_RELOP = 54, // - SYMBOL_SIMPLE_EXPR = 55, // - SYMBOL_STATEMENT = 56, // - SYMBOL_TERM = 57, // - SYMBOL_VARDECLS = 58, // - SYMBOL_VARIABLES = 59 // -}; - - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//RuleConstants -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public enum RuleConstants : int -{ - RULE_PROGRAM_TKDOT = 0, // ::= 'tkDot' - RULE_BLOCK = 1, // ::= - RULE_OPT_DECLARATIONS = 2, // ::= - RULE_OPT_DECLARATIONS2 = 3, // ::= - RULE_DECLARATIONS = 4, // ::= - RULE_DECLARATIONS2 = 5, // ::= - RULE_DECLARATION = 6, // ::= - RULE_DECLARATION2 = 7, // ::= - RULE_DECLARATION3 = 8, // ::= - RULE_CONSTANTS_TKCONST_TKSEMICOLON = 9, // ::= 'tkConst' 'tkSemiColon' - RULE_CONSTDECL = 10, // ::= - RULE_CONSTDECL_TKCOMMA = 11, // ::= 'tkComma' - RULE_CONSTDEF_TKIDENT_TKEQUAL_TKNUMBER = 12, // ::= 'tkIdent' 'tkEqual' 'tkNumber' - RULE_VARIABLES_TKVAR_TKSEMICOLON = 13, // ::= 'tkVar' 'tkSemiColon' - RULE_VARDECLS_TKIDENT = 14, // ::= 'tkIdent' - RULE_VARDECLS_TKCOMMA_TKIDENT = 15, // ::= 'tkComma' 'tkIdent' - RULE_PROC_DECL_TKPROCEDURE_TKIDENT_TKSEMICOLON_TKSEMICOLON = 16, // ::= 'tkProcedure' 'tkIdent' 'tkSemiColon' 'tkSemiColon' - RULE_STATEMENT_TKIDENT_TKASSIGN = 17, // ::= 'tkIdent' 'tkAssign' - RULE_STATEMENT_TKCALL_TKIDENT = 18, // ::= 'tkCall' 'tkIdent' - RULE_STATEMENT_TKWRITELN = 19, // ::= 'tkWriteln' - RULE_STATEMENT_TKREADLN_TKIDENT = 20, // ::= 'tkReadln' 'tkIdent' - RULE_STATEMENT_TKBEGIN_TKEND = 21, // ::= 'tkBegin' 'tkEnd' - RULE_STATEMENT_TKIF_TKTHEN = 22, // ::= 'tkIf' 'tkThen' - RULE_STATEMENT_TKWHILE_TKDO = 23, // ::= 'tkWhile' 'tkDo' - RULE_STATEMENT = 24, // ::= - RULE_OPT_PARAMS_LIST_TKROUNDOPEN_TKROUNDCLOSE = 25, // ::= 'tkRoundOpen' 'tkRoundClose' - RULE_OPT_PARAMS_LIST = 26, // ::= - RULE_EXPR_LIST = 27, // ::= - RULE_EXPR_LIST_TKCOMMA = 28, // ::= 'tkComma' - RULE_COMPOUND_STATEMENT = 29, // ::= - RULE_COMPOUND_STATEMENT_TKSEMICOLON = 30, // ::= 'tkSemiColon' - RULE_EXPRESSION_TKODD = 31, // ::= 'tkOdd' - RULE_EXPRESSION = 32, // ::= - RULE_SIMPLE_EXPR = 33, // ::= - RULE_SIMPLE_EXPR2 = 34, // ::= - RULE_TERM = 35, // ::= - RULE_TERM2 = 36, // ::= - RULE_FACTOR_TKIDENT = 37, // ::= 'tkIdent' - RULE_FACTOR_TKNUMBER = 38, // ::= 'tkNumber' - RULE_FACTOR_TKROUNDOPEN_TKROUNDCLOSE = 39, // ::= 'tkRoundOpen' 'tkRoundClose' - RULE_RELOP_TKEQUAL = 40, // ::= 'tkEqual' - RULE_RELOP_TKNOTEQUAL = 41, // ::= 'tkNotEqual' - RULE_RELOP_TKLOWER = 42, // ::= 'tkLower' - RULE_RELOP_TKLOWEREQUAL = 43, // ::= 'tkLowerEqual' - RULE_RELOP_TKGREATER = 44, // ::= 'tkGreater' - RULE_RELOP_TKGREATEREQUAL = 45, // ::= 'tkGreaterEqual' - RULE_ADDOP_TKPLUS = 46, // ::= 'tkPlus' - RULE_ADDOP_TKMINUS = 47, // ::= 'tkMinus' - RULE_MULOP_TKSTAR = 48, // ::= 'tkStar' - RULE_MULOP_TKSLASH = 49, // ::= 'tkSlash' - RULE_EMPTY = 50 // ::= -}; - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -private Object CreateTerminalObject(int TokenSymbolIndex) -{ -switch (TokenSymbolIndex) -{ - case (int)SymbolConstants.SYMBOL_EOF : - //(EOF) - //TERMINAL:EOF - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ERROR : - //(Error) - //TERMINAL:Error - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_WHITESPACE : - //(Whitespace) - //TERMINAL:Whitespace - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_COMMENTEND : - //(Comment End) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment End' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_COMMENTLINE : - //(Comment Line) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment Line' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_COMMENTSTART : - //(Comment Start) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment Start' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_TKASSIGN : - //'tkAssign' - - { - op_type_node _op_type_node=new op_type_node(Operators.Assignment); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKBEGIN : - //'tkBegin' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCALL : - //'tkCall' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCOMMA : - //'tkComma' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCONST : - //'tkConst' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKDO : - //'tkDo' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKDOT : - //'tkDot' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKEND : - //'tkEnd' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKEQUAL : - //'tkEqual' - - { - op_type_node _op_type_node=new op_type_node(Operators.Equal); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKGREATER : - //'tkGreater' - - { - op_type_node _op_type_node=new op_type_node(Operators.Greater); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKGREATEREQUAL : - //'tkGreaterEqual' - - { - op_type_node _op_type_node=new op_type_node(Operators.GreaterEqual); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKIDENT : - //'tkIdent' -return parsertools.create_ident(this); - case (int)SymbolConstants.SYMBOL_TKIF : - //'tkIf' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKLOWER : - //'tkLower' - - { - op_type_node _op_type_node=new op_type_node(Operators.Less); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKLOWEREQUAL : - //'tkLowerEqual' - - { - op_type_node _op_type_node=new op_type_node(Operators.LessEqual); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKMINUS : - //'tkMinus' - - { - op_type_node _op_type_node=new op_type_node(Operators.Minus); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKNOTEQUAL : - //'tkNotEqual' - - { - op_type_node _op_type_node=new op_type_node(Operators.NotEqual); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKNUMBER : - //'tkNumber' -return parsertools.create_int_const(this); - case (int)SymbolConstants.SYMBOL_TKODD : - //'tkOdd' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKPLUS : - //'tkPlus' - - { - op_type_node _op_type_node=new op_type_node(Operators.Plus); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKPROCEDURE : - //'tkProcedure' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKREADLN : - //'tkReadln' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKROUNDCLOSE : - //'tkRoundClose' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKROUNDOPEN : - //'tkRoundOpen' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSEMICOLON : - //'tkSemiColon' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSLASH : - //'tkSlash' - - { - op_type_node _op_type_node=new op_type_node(Operators.IntegerDivision); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKSTAR : - //'tkStar' - - { - op_type_node _op_type_node=new op_type_node(Operators.Multiplication); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKTHEN : - //'tkThen' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKVAR : - //'tkVar' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKWHILE : - //'tkWhile' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKWRITELN : - //'tkWriteln' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_ADDOP : - // - //TERMINAL:addop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_BLOCK : - // - //TERMINAL:block - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_COMPOUND_STATEMENT : - // - //TERMINAL:compound_statement - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONSTANTS : - // - //TERMINAL:constants - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONSTDECL : - // - //TERMINAL:constdecl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONSTDEF : - // - //TERMINAL:constdef - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_DECLARATION : - // - //TERMINAL:declaration - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_DECLARATIONS : - // - //TERMINAL:declarations - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EMPTY : - // - //TERMINAL:empty - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPR_LIST : - // - //TERMINAL:expr_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPRESSION : - // - //TERMINAL:expression - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FACTOR : - // - //TERMINAL:factor - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MULOP : - // - //TERMINAL:mulop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_DECLARATIONS : - // - //TERMINAL:opt_declarations - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_PARAMS_LIST : - // - //TERMINAL:opt_params_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROC_DECL : - // - //TERMINAL:proc_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROGRAM : - // - //TERMINAL:program - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RELOP : - // - //TERMINAL:relop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_EXPR : - // - //TERMINAL:simple_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STATEMENT : - // - //TERMINAL:statement - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TERM : - // - //TERMINAL:term - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARDECLS : - // - //TERMINAL:vardecls - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIABLES : - // - //TERMINAL:variables - return null; - //ENDTERMINAL -} -throw new SymbolException("Unknown symbol"); -} - - - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateNonTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public Object CreateNonTerminalObject(int ReductionRuleIndex) -{ -switch (ReductionRuleIndex) -{ - case (int)RuleConstants.RULE_PROGRAM_TKDOT : - // ::= 'tkDot' - - { - program_module _program_module=new program_module(null,null,(block)LRParser.GetReductionSyntaxNode(0),null); - - _program_module.Language = LanguageId.PascalABCNET; - parsertools.create_source_context(_program_module,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)),LRParser.GetReductionSyntaxNode(1)); - return _program_module; - } - - case (int)RuleConstants.RULE_BLOCK : - // ::= - - { - block _block=new block((declarations)LRParser.GetReductionSyntaxNode(0),null); - - statement_list sl=null; - if(LRParser.GetReductionSyntaxNode(1) is statement_list) - sl = LRParser.GetReductionSyntaxNode(1) as statement_list; - else - { - sl = new statement_list(); - sl.subnodes.Add(LRParser.GetReductionSyntaxNode(1) as statement); - if(!(LRParser.GetReductionSyntaxNode(1) is empty_statement)) - parsertools.assign_source_context(sl,LRParser.GetReductionSyntaxNode(1)); - } - _block.program_code=sl; - if(!(LRParser.GetReductionSyntaxNode(1) is empty_statement)) - parsertools.create_source_context(_block,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _block; - } - - case (int)RuleConstants.RULE_OPT_DECLARATIONS : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_DECLARATIONS2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_DECLARATIONS : - // ::= - - //TemplateList for declarations (create) - { - declarations _declarations=new declarations(); - _declarations.source_context=((declaration)LRParser.GetReductionSyntaxNode(0)).source_context; - _declarations.defs.Add((declaration)LRParser.GetReductionSyntaxNode(0)); - return _declarations; - } - - case (int)RuleConstants.RULE_DECLARATIONS2 : - // ::= - - //TemplateList for declarations (add) - { - declarations _declarations=(declarations)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_declarations,_declarations,LRParser.GetReductionSyntaxNode(2)); - _declarations.defs.Add(LRParser.GetReductionSyntaxNode(2) as declaration); - return _declarations; - } - - case (int)RuleConstants.RULE_DECLARATION : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_DECLARATION2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_DECLARATION3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONSTANTS_TKCONST_TKSEMICOLON : - // ::= 'tkConst' 'tkSemiColon' - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_CONSTDECL : - // ::= - - //TemplateList for consts_definitions_list (create) - { - consts_definitions_list _consts_definitions_list=new consts_definitions_list(); - _consts_definitions_list.source_context=((const_definition)LRParser.GetReductionSyntaxNode(0)).source_context; - _consts_definitions_list.const_defs.Add((const_definition)LRParser.GetReductionSyntaxNode(0)); - return _consts_definitions_list; - } - - case (int)RuleConstants.RULE_CONSTDECL_TKCOMMA : - // ::= 'tkComma' - - //TemplateList for consts_definitions_list (add) - { - consts_definitions_list _consts_definitions_list=(consts_definitions_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_consts_definitions_list,_consts_definitions_list,LRParser.GetReductionSyntaxNode(2)); - _consts_definitions_list.const_defs.Add(LRParser.GetReductionSyntaxNode(2) as const_definition); - return _consts_definitions_list; - } - - case (int)RuleConstants.RULE_CONSTDEF_TKIDENT_TKEQUAL_TKNUMBER : - // ::= 'tkIdent' 'tkEqual' 'tkNumber' - - { - simple_const_definition _simple_const_definition=new simple_const_definition(); - - _simple_const_definition.const_name=(ident)LRParser.GetReductionSyntaxNode(0); - _simple_const_definition.const_value=(expression)LRParser.GetReductionSyntaxNode(2); - parsertools.create_source_context(_simple_const_definition,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _simple_const_definition; - } - - case (int)RuleConstants.RULE_VARIABLES_TKVAR_TKSEMICOLON : - // ::= 'tkVar' 'tkSemiColon' - - { - variable_definitions _variable_definitions=new variable_definitions(); - - //var_def_statement vdf = new var_def_statement((ident_list)LRParser.GetReductionSyntaxNode(1),null,new int32_const(0),definition_attribute.None,false); - foreach (ident id in ((ident_list)LRParser.GetReductionSyntaxNode(1)).idents) - { - ident_list idl=new ident_list(); - idl.idents.Add(id); - parsertools.create_source_context(idl,id,id); - var_def_statement vdf = new var_def_statement(idl,null,new int32_const(0),definition_attribute.None,false); - parsertools.create_source_context(vdf,id,id); - _variable_definitions.var_definitions.Add(vdf); - } - parsertools.create_source_context(_variable_definitions,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _variable_definitions; - } - - case (int)RuleConstants.RULE_VARDECLS_TKIDENT : - // ::= 'tkIdent' - - //TemplateList for ident_list (create) - { - ident_list _ident_list=new ident_list(); - _ident_list.source_context=((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - _ident_list.idents.Add((ident)LRParser.GetReductionSyntaxNode(0)); - return _ident_list; - } - - case (int)RuleConstants.RULE_VARDECLS_TKCOMMA_TKIDENT : - // ::= 'tkComma' 'tkIdent' - - //TemplateList for ident_list (add) - { - ident_list _ident_list=(ident_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_ident_list,_ident_list,LRParser.GetReductionSyntaxNode(2)); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(2) as ident); - return _ident_list; - } - - case (int)RuleConstants.RULE_PROC_DECL_TKPROCEDURE_TKIDENT_TKSEMICOLON_TKSEMICOLON : - // ::= 'tkProcedure' 'tkIdent' 'tkSemiColon' 'tkSemiColon' - - method_name mn = new method_name(null,(ident)LRParser.GetReductionSyntaxNode(1),null); - procedure_header ph = new procedure_header(null,null,mn,false,false,null,null); - procedure_definition pd = new procedure_definition(ph,(block)LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(mn,LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(ph,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(pd,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(4)); - return pd; - case (int)RuleConstants.RULE_STATEMENT_TKIDENT_TKASSIGN : - // ::= 'tkIdent' 'tkAssign' - - { - assign _assign=new assign(LRParser.GetReductionSyntaxNode(0) as addressed_value,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_assign,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _assign; - } - - case (int)RuleConstants.RULE_STATEMENT_TKCALL_TKIDENT : - // ::= 'tkCall' 'tkIdent' - - { - procedure_call _procedure_call=new procedure_call(); - - method_call mc = new method_call(LRParser.GetReductionSyntaxNode(2) as expression_list); - mc.dereferencing_value=(addressed_value)LRParser.GetReductionSyntaxNode(1); - parsertools.create_source_context(mc,LRParser.GetReductionSyntaxNode(1),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1))); - _procedure_call.func_name = mc; - parsertools.create_source_context(_procedure_call,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1))); - return _procedure_call; - } - - case (int)RuleConstants.RULE_STATEMENT_TKWRITELN : - // ::= 'tkWriteln' - -{ - procedure_call pc = new procedure_call(); - expression_list expr = new expression_list(); - expr.expressions.Add((expression)LRParser.GetReductionSyntaxNode(1)); - method_call mc = new method_call(expr); - mc.dereferencing_value = new ident("writeln"); - pc.func_name = mc; - parsertools.create_source_context(mc.dereferencing_value,LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(expr,LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(mc,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(pc,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return pc; -} - - case (int)RuleConstants.RULE_STATEMENT_TKREADLN_TKIDENT : - // ::= 'tkReadln' 'tkIdent' - -{ - procedure_call pc = new procedure_call(); - expression_list expr = new expression_list(); - expr.expressions.Add((expression)LRParser.GetReductionSyntaxNode(1)); - method_call mc = new method_call(expr); - mc.dereferencing_value = new ident("readln"); - pc.func_name = mc; - parsertools.create_source_context(mc.dereferencing_value,LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(expr,LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(mc,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(pc,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return pc; -} - - case (int)RuleConstants.RULE_STATEMENT_TKBEGIN_TKEND : - // ::= 'tkBegin' 'tkEnd' -parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - ((statement_list)LRParser.GetReductionSyntaxNode(1)).left_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(0); - ((statement_list)LRParser.GetReductionSyntaxNode(1)).right_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(2); - return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_STATEMENT_TKIF_TKTHEN : - // ::= 'tkIf' 'tkThen' - - { - if_node _if_node=new if_node((expression)LRParser.GetReductionSyntaxNode(1),(statement)LRParser.GetReductionSyntaxNode(3),null); - - parsertools.create_source_context(_if_node,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(2))); - return _if_node; - } - - case (int)RuleConstants.RULE_STATEMENT_TKWHILE_TKDO : - // ::= 'tkWhile' 'tkDo' - - { - while_node _while_node=new while_node((expression)LRParser.GetReductionSyntaxNode(1),(statement)LRParser.GetReductionSyntaxNode(3),WhileCycleType.While); - - parsertools.create_source_context(_while_node,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(2))); - return _while_node; - } - - case (int)RuleConstants.RULE_STATEMENT : - // ::= - - { - empty_statement _empty_statement=new empty_statement(); - - return _empty_statement; - } - - case (int)RuleConstants.RULE_OPT_PARAMS_LIST_TKROUNDOPEN_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundClose' - return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_OPT_PARAMS_LIST : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_EXPR_LIST : - // ::= - - //TemplateList for expression_list (create) - { - expression_list _expression_list=new expression_list(); - _expression_list.source_context=((expression)LRParser.GetReductionSyntaxNode(0)).source_context; - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(0)); - return _expression_list; - } - - case (int)RuleConstants.RULE_EXPR_LIST_TKCOMMA : - // ::= 'tkComma' - - //TemplateList for expression_list (add) - { - expression_list _expression_list=(expression_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_expression_list,_expression_list,LRParser.GetReductionSyntaxNode(2)); - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(2) as expression); - return _expression_list; - } - - case (int)RuleConstants.RULE_COMPOUND_STATEMENT : - // ::= - - { - statement_list _statement_list=new statement_list(); - - _statement_list.subnodes.Add((statement)LRParser.GetReductionSyntaxNode(0)); - parsertools.assign_source_context(_statement_list,LRParser.GetReductionSyntaxNode(0)); - return _statement_list; - } - - case (int)RuleConstants.RULE_COMPOUND_STATEMENT_TKSEMICOLON : - // ::= 'tkSemiColon' - - { - statement_list _statement_list; - _statement_list=(statement_list)LRParser.GetReductionSyntaxNode(0); - _statement_list.subnodes.Add((statement)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_statement_list,_statement_list,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1))); - return _statement_list; - } - - case (int)RuleConstants.RULE_EXPRESSION_TKODD : - // ::= 'tkOdd' - - { - bin_expr _bin_expr=new bin_expr(new bin_expr((expression)LRParser.GetReductionSyntaxNode(1), new int32_const(2), Operators.ModulusRemainder),new int32_const(0),Operators.Equal); - - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _bin_expr; - } - - case (int)RuleConstants.RULE_EXPRESSION : - // ::= - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_SIMPLE_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_EXPR2 : - // ::= - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_TERM : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TERM2 : - // ::= - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_FACTOR_TKIDENT : - // ::= 'tkIdent' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FACTOR_TKNUMBER : - // ::= 'tkNumber' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FACTOR_TKROUNDOPEN_TKROUNDCLOSE : - // ::= 'tkRoundOpen' 'tkRoundClose' - return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_RELOP_TKEQUAL : - // ::= 'tkEqual' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RELOP_TKNOTEQUAL : - // ::= 'tkNotEqual' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RELOP_TKLOWER : - // ::= 'tkLower' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RELOP_TKLOWEREQUAL : - // ::= 'tkLowerEqual' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RELOP_TKGREATER : - // ::= 'tkGreater' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RELOP_TKGREATEREQUAL : - // ::= 'tkGreaterEqual' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ADDOP_TKPLUS : - // ::= 'tkPlus' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ADDOP_TKMINUS : - // ::= 'tkMinus' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_MULOP_TKSTAR : - // ::= 'tkStar' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_MULOP_TKSLASH : - // ::= 'tkSlash' -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EMPTY : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL -} -throw new RuleException("Unknown rule"); -} - - - - - - -} -} diff --git a/Parsers/PL0Parser/Parser.cs b/Parsers/PL0Parser/Parser.cs deleted file mode 100644 index 1915280b0..000000000 --- a/Parsers/PL0Parser/Parser.cs +++ /dev/null @@ -1,178 +0,0 @@ -using System; -using System.IO; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Parsers; -using System.Resources; -using System.Reflection; -using PascalABCCompiler.Errors; -using System.Collections.Generic; - - -namespace PascalABCCompiler.PL0Parser -{ - - public class PL0LanguageParser:IParser - { - GPBParser_PL0 parser; - - public PL0LanguageParser() - { - filesExtensions = new string[1]; - filesExtensions[0] = ".pl0"; - } - - string[] filesExtensions; - public string[] FilesExtensions - { - get - { - return filesExtensions; - } - } - - ILanguageInformation languageInformation; - public ILanguageInformation LanguageInformation { - get { - if (languageInformation == null) - languageInformation = new DefaultLanguageInformation(this); - return languageInformation; - } - } - - Keyword[] _keywords; - void initKeywords() - { - List key_words = new List(); - key_words.Add(new Keyword("CONST")); - key_words.Add(new Keyword("VAR", KeywordKind.Var)); - key_words.Add(new Keyword("CALL")); - key_words.Add(new Keyword("BEGIN")); - key_words.Add(new Keyword("END")); - key_words.Add(new Keyword("IF")); - key_words.Add(new Keyword("THEN")); - key_words.Add(new Keyword("WHILE")); - key_words.Add(new Keyword("DO")); - key_words.Add(new Keyword("PROCEDURE", KeywordKind.Function)); - key_words.Add(new Keyword("ODD")); - _keywords = key_words.ToArray(); - } - public Keyword[] Keywords - { - get - { - return _keywords; - } - } - - public void Reset() - { - parser = new GPBParser_PL0(CGTResourceExtractor.Extract(new ResourceManager("PL0Parser.PL0Lang", Assembly.GetExecutingAssembly()), "PL0Language")); - parser.max_errors = 30; - } - - public bool CaseSensitive - { - get - { - return parser.LanguageGrammar.CaseSensitive; - } - } - - SourceFilesProviderDelegate sourceFilesProvider = null; - public SourceFilesProviderDelegate SourceFilesProvider - { - get - { - return sourceFilesProvider; - } - set - { - sourceFilesProvider = value; - } - } - - public List CompilerDirectives - { - get - { - return new List(); - } - } - - List errors = new List(); - public List Errors - { - get - { - return errors; - } - set - { - errors = value; - } - } - public syntax_tree_node BuildTree(string FileName, string Text, string[] SearchPatchs, ParseMode ParseMode) - { - if (parser == null) - Reset(); - parser.errors = Errors; - parser.current_file_name = FileName; - parser.parsertools.LineCorrection = 0; - syntax_tree_node cu = null; - switch (ParseMode) - { - case ParseMode.Normal: - cu = (syntax_tree_node)parser.Parse(Text); - break; - case ParseMode.Expression: - case ParseMode.Statement: - return null; - } - if (cu != null && cu is compilation_unit) - { - (cu as compilation_unit).file_name = FileName; - (cu as compilation_unit).compiler_directives = CompilerDirectives; - } - return cu; - } - - public string Name - { - get - { - return "PL/0"; - } - } - public string Version - { - get - { - return "1.0"; - } - } - public string Copyright - { - get - { - return "(c) Òêà÷óê À.Â., 2007"; - } - } - - public override string ToString() - { - return "PL/0 Language Parser v1.0"; - } - public IPreprocessor Preprocessor - { - get - { - return null; - } - } - - } - - - -} diff --git a/Parsers/PL0Parser/Properties/AssemblyInfo.cs b/Parsers/PL0Parser/Properties/AssemblyInfo.cs deleted file mode 100644 index f1f179423..000000000 --- a/Parsers/PL0Parser/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("PL0Parser")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("DSS")] -[assembly: AssemblyProduct("PascalABCParser")] -[assembly: AssemblyCopyright("Copyright © DSS 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("e5788e70-934b-42a9-a652-255b64cf1709")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyFileVersion("1.0.*")] diff --git a/Parsers/PascalABCParser/CodeFormatting/CommentBinder.cs b/Parsers/PascalABCParser/CodeFormatting/CommentBinder.cs deleted file mode 100644 index ec3a7132e..000000000 --- a/Parsers/PascalABCParser/CodeFormatting/CommentBinder.cs +++ /dev/null @@ -1,1259 +0,0 @@ -using System; -using System.IO; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Parsers; -using System.Resources; -using System.Reflection; -using System.Collections.Generic; -using System.Text; - -namespace PascalABCCompiler.PascalABCParser -{ - public class CommentInfo - { - public string before; - public string after; - } - - public class CommentBinder : IVisitor - { - private string Text=null; - private Dictionary comment_table = new Dictionary(); - - public Dictionary Bind(compilation_unit cu, string Text) - { - return null; - } - - private string GetCommentsBefore(int pos) - { - StringBuilder sb = new StringBuilder(); - StringBuilder tmp = new StringBuilder(); - while (pos >= 0) - { - if (char.IsWhiteSpace(Text[pos])) - { - tmp.Insert(0, Text[pos]); - pos--; - } - else if (Text[pos] == '}') - { - sb.Append(tmp.ToString()); - while (pos >= 0 && Text[pos] != '{') - { - sb.Insert(0, Text[pos]); - pos--; - } - } - else - break; - } - if (sb.Length > 0) - return sb.ToString(); - else - return null; - } - - private string GetCommentsAfter(int pos) - { - StringBuilder sb = new StringBuilder(); - StringBuilder tmp = new StringBuilder(); - while (pos >= 0) - { - if (char.IsWhiteSpace(Text[pos])) - { - tmp.Append(Text[pos]); - pos++; - } - else if (Text[pos] == '}') - { - sb.Append(tmp.ToString()); - while (pos >= 0 && Text[pos] != '{') - { - sb.Append(Text[pos]); - pos++; - } - } - else - break; - } - if (sb.Length > 0) - return sb.ToString(); - else - return null; - } - - private void AddPossibleComments(syntax_tree_node sn, bool search_before, bool search_after) - { - string before = null; - if (search_before) - before = GetCommentsBefore(sn.source_context.Position - 1); - string after = null; - if (search_after) - after = GetCommentsAfter(sn.source_context.Position + sn.source_context.Length); - if (before != null || after != null) - { - comment_table.Add(sn, new string[] { before, after }); - } - } - - #region IVisitor Member - - public void visit(syntax_tree_node _syntax_tree_node) - { - throw new NotImplementedException(); - } - - private bool is_begin(statement_list sl) - { - return (sl.left_logical_bracket != null && sl.left_logical_bracket is token_info - && (sl.left_logical_bracket as token_info).text.ToLower() == "begin"); - } - - public void visit(statement_list _statement_list) - { - if (is_begin(_statement_list)) - AddPossibleComments(_statement_list, true, false); - foreach (statement stmt in _statement_list.subnodes) - stmt.visit(this); - } - - public void visit(expression _expression) - { - throw new NotImplementedException(); - } - - public void visit(assign _assign) - { - _assign.to.visit(this); - _assign.from.visit(this); - } - - public void visit(bin_expr _bin_expr) - { - _bin_expr.left.visit(this); - _bin_expr.right.visit(this); - } - - public void visit(un_expr _un_expr) - { - _un_expr.subnode.visit(this); - } - - public void visit(const_node _const_node) - { - throw new NotImplementedException(); - } - - public void visit(bool_const _bool_const) - { - AddPossibleComments(_bool_const, true, true); - } - - public void visit(int32_const _int32_const) - { - AddPossibleComments(_int32_const, true, true); - } - - public void visit(double_const _double_const) - { - AddPossibleComments(_double_const, true, true); - } - - public void visit(statement _statement) - { - throw new NotImplementedException(); - } - - public void visit(subprogram_body _subprogram_body) - { - throw new NotImplementedException(); - } - - public void visit(ident _ident) - { - AddPossibleComments(_ident, true, true); - } - - public void visit(addressed_value _addressed_value) - { - throw new NotImplementedException(); - } - - public void visit(type_definition _type_definition) - { - throw new NotImplementedException(); - } - - public void visit(named_type_reference _named_type_reference) - { - foreach (ident id in _named_type_reference.names) - id.visit(this); - } - - public void visit(variable_definitions _variable_definitions) - { - AddPossibleComments(_variable_definitions,true,false); - foreach (var_def_statement vds in _variable_definitions.var_definitions) - vds.visit(this); - } - - public void visit(ident_list _ident_list) - { - foreach (ident id in _ident_list.idents) - id.visit(this); - } - - public void visit(var_def_statement _var_def_statement) - { - if (_var_def_statement.is_event) - AddPossibleComments(_var_def_statement, true, false); - _var_def_statement.vars.visit(this); - if (_var_def_statement.vars_type != null) - _var_def_statement.vars_type.visit(this); - if (_var_def_statement.inital_value != null) - _var_def_statement.inital_value.visit(this); - } - - public void visit(declaration _declaration) - { - throw new NotImplementedException(); - } - - public void visit(declarations _declarations) - { - foreach (declaration decl in _declarations.defs) - decl.visit(this); - } - - public void visit(program_tree _program_tree) - { - throw new NotImplementedException(); - } - - public void visit(program_name _program_name) - { - AddPossibleComments(_program_name, true, false); - _program_name.prog_name.visit(this); - } - - public void visit(string_const _string_const) - { - AddPossibleComments(_string_const, true, true); - } - - public void visit(expression_list _expression_list) - { - foreach (expression ex in _expression_list.expressions) - ex.visit(this); - } - - public void visit(dereference _dereference) - { - throw new NotImplementedException(); - } - - public void visit(roof_dereference _roof_dereference) - { - _roof_dereference.dereferencing_value.visit(this); - AddPossibleComments(_roof_dereference, false, true); - } - - public void visit(indexer _indexer) - { - _indexer.dereferencing_value.visit(this); - _indexer.indexes.visit(this); - } - - public void visit(for_node _for_node) - { - AddPossibleComments(_for_node, true, false); - _for_node.loop_variable.visit(this); - if (_for_node.type_name != null) - _for_node.type_name.visit(this); - _for_node.initial_value.visit(this); - _for_node.finish_value.visit(this); - _for_node.statements.visit(this); - } - - public void visit(repeat_node _repeat_node) - { - AddPossibleComments(_repeat_node, true, false); - _repeat_node.statements.visit(this); - _repeat_node.expr.visit(this); - } - - public void visit(while_node _while_node) - { - AddPossibleComments(_while_node, true, false); - _while_node.expr.visit(this); - _while_node.statements.visit(this); - } - - public void visit(if_node _if_node) - { - AddPossibleComments(_if_node, true, false); - _if_node.condition.visit(this); - _if_node.then_body.visit(this); - if (_if_node.else_body != null) - _if_node.else_body.visit(this); - } - - public void visit(ref_type _ref_type) - { - AddPossibleComments(_ref_type, true, false); - _ref_type.pointed_to.visit(this); - } - - public void visit(diapason _diapason) - { - _diapason.left.visit(this); - _diapason.right.visit(this); - } - - public void visit(indexers_types _indexers_types) - { - foreach (type_definition td in _indexers_types.indexers) - if (td != null) - td.visit(this); - } - - public void visit(array_type _array_type) - { - AddPossibleComments(_array_type, true, false); - if (_array_type.indexers != null) - _array_type.indexers.visit(this); - _array_type.elemets_types.visit(this); - } - - public void visit(label_definitions _label_definitions) - { - AddPossibleComments(_label_definitions, true, false); - _label_definitions.labels.visit(this); - } - - public void visit(procedure_attribute _procedure_attribute) - { - if (_procedure_attribute.source_context != null) - AddPossibleComments(_procedure_attribute, true, true); - } - - public void visit(typed_parametres _typed_parametres) - { - if (_typed_parametres.param_kind != parametr_kind.none) - AddPossibleComments(_typed_parametres, true, false); - _typed_parametres.idents.visit(this); - _typed_parametres.vars_type.visit(this); - if (_typed_parametres.inital_value != null) - _typed_parametres.inital_value.visit(this); - } - - public void visit(formal_parametres _formal_parametres) - { - foreach (typed_parametres tp in _formal_parametres.params_list) - tp.visit(this); - } - - public void visit(procedure_attributes_list _procedure_attributes_list) - { - foreach (procedure_attribute pa in _procedure_attributes_list.proc_attributes) - pa.visit(this); - } - - public void visit(procedure_header _procedure_header) - { - AddPossibleComments(_procedure_header, true, false); - _procedure_header.name.visit(this); - if (_procedure_header.parametres != null) - _procedure_header.parametres.visit(this); - if (_procedure_header.proc_attributes != null) - _procedure_header.proc_attributes.visit(this); - if (_procedure_header.where_defs != null) - _procedure_header.where_defs.visit(this); - } - - public void visit(function_header _function_header) - { - AddPossibleComments(_function_header, true, false); - _function_header.name.visit(this); - if (_function_header.parametres != null) - _function_header.parametres.visit(this); - _function_header.return_type.visit(this); - if (_function_header.proc_attributes != null) - _function_header.proc_attributes.visit(this); - if (_function_header.where_defs != null) - _function_header.where_defs.visit(this); - } - - public void visit(procedure_definition _procedure_definition) - { - _procedure_definition.proc_header.visit(this); - _procedure_definition.proc_body.visit(this); - } - - public void visit(type_declaration _type_declaration) - { - if (_type_declaration.attributes != null) - _type_declaration.attributes.visit(this); - _type_declaration.type_name.visit(this); - _type_declaration.type_def.visit(this); - } - - public void visit(type_declarations _type_declarations) - { - AddPossibleComments(_type_declarations, true, false); - foreach (type_declaration td in _type_declarations.types_decl) - td.visit(this); - } - - public void visit(simple_const_definition _simple_const_definition) - { - _simple_const_definition.const_name.visit(this); - _simple_const_definition.const_value.visit(this); - } - - public void visit(typed_const_definition _typed_const_definition) - { - _typed_const_definition.const_name.visit(this); - _typed_const_definition.const_type.visit(this); - _typed_const_definition.const_value.visit(this); - } - - public void visit(const_definition _const_definition) - { - throw new NotImplementedException(); - } - - public void visit(consts_definitions_list _consts_definitions_list) - { - AddPossibleComments(_consts_definitions_list, true, false); - foreach (const_definition cd in _consts_definitions_list.const_defs) - cd.visit(this); - } - - public void visit(unit_name _unit_name) - { - AddPossibleComments(_unit_name, true, false); - _unit_name.idunit_name.visit(this); - } - - public void visit(unit_or_namespace _unit_or_namespace) - { - _unit_or_namespace.name.visit(this); - } - - public void visit(uses_unit_in _uses_unit_in) - { - _uses_unit_in.name.visit(this); - _uses_unit_in.in_file.visit(this); - } - - public void visit(uses_list _uses_list) - { - AddPossibleComments(_uses_list,true,false); - foreach (unit_or_namespace un in _uses_list.units) - un.visit(this); - } - - public void visit(program_body _program_body) - { - throw new NotImplementedException(); - } - - public void visit(compilation_unit _compilation_unit) - { - throw new NotImplementedException(); - } - - public void visit(unit_module _unit_module) - { - _unit_module.unit_name.visit(this); - if (_unit_module.interface_part != null) - _unit_module.interface_part.visit(this); - if (_unit_module.implementation_part != null) - _unit_module.implementation_part.visit(this); - if (_unit_module.initialization_part != null) - _unit_module.initialization_part.visit(this); - if (_unit_module.finalization_part != null) - _unit_module.finalization_part.visit(this); - } - - public void visit(program_module _program_module) - { - if (_program_module.program_name != null) - _program_module.program_name.visit(this); - if (_program_module.used_units != null) - _program_module.used_units.visit(this); - _program_module.program_block.visit(this); - } - - public void visit(hex_constant _hex_constant) - { - AddPossibleComments(_hex_constant, true, true); - } - - public void visit(get_address _get_address) - { - AddPossibleComments(_get_address, true, true); - } - - public void visit(case_variant _case_variant) - { - throw new NotImplementedException(); - } - - public void visit(case_node _case_node) - { - throw new NotImplementedException(); - } - - public void visit(method_name _method_name) - { - if (_method_name.class_name != null) - _method_name.class_name.visit(this); - if (_method_name.explicit_interface_name != null) - _method_name.explicit_interface_name.visit(this); - if (_method_name.meth_name != null) - _method_name.meth_name.visit(this); - } - - public void visit(dot_node _dot_node) - { - _dot_node.left.visit(this); - _dot_node.right.visit(this); - } - - public void visit(empty_statement _empty_statement) - { - throw new NotImplementedException(); - } - - public void visit(goto_statement _goto_statement) - { - _goto_statement.label.visit(this); - } - - public void visit(labeled_statement _labeled_statement) - { - _labeled_statement.label_name.visit(this); - _labeled_statement.to_statement.visit(this); - } - - public void visit(with_statement _with_statement) - { - _with_statement.do_with.visit(this); - _with_statement.what_do.visit(this); - } - - public void visit(method_call _method_call) - { - _method_call.dereferencing_value.visit(this); - if (_method_call.parametres != null) - _method_call.parametres.visit(this); - } - - public void visit(pascal_set_constant _pascal_set_constant) - { - AddPossibleComments(_pascal_set_constant, true, true); - if (_pascal_set_constant.values != null) - _pascal_set_constant.values.visit(this); - } - - public void visit(array_const _array_const) - { - AddPossibleComments(_array_const, true, true); - _array_const.elements.visit(this); - } - - public void visit(write_accessor_name _write_accessor_name) - { - throw new NotImplementedException(); - } - - public void visit(read_accessor_name _read_accessor_name) - { - throw new NotImplementedException(); - } - - public void visit(property_accessors _property_accessors) - { - throw new NotImplementedException(); - } - - public void visit(simple_property _simple_property) - { - throw new NotImplementedException(); - } - - public void visit(index_property _index_property) - { - throw new NotImplementedException(); - } - - public void visit(class_members _class_members) - { - throw new NotImplementedException(); - } - - public void visit(access_modifer_node _access_modifer_node) - { - throw new NotImplementedException(); - } - - public void visit(class_body _class_body) - { - throw new NotImplementedException(); - } - - public void visit(class_definition _class_definition) - { - throw new NotImplementedException(); - } - - public void visit(default_indexer_property_node _default_indexer_property_node) - { - throw new NotImplementedException(); - } - - public void visit(known_type_definition _known_type_definition) - { - throw new NotImplementedException(); - } - - public void visit(set_type_definition _set_type_definition) - { - throw new NotImplementedException(); - } - - public void visit(try_statement _try_statement) - { - throw new NotImplementedException(); - } - - public void visit(on_exception _on_exception) - { - throw new NotImplementedException(); - } - - public void visit(on_exception_list _on_exception_list) - { - throw new NotImplementedException(); - } - - public void visit(try_finally_statement _try_finally_statement) - { - throw new NotImplementedException(); - } - - public void visit(try_except_statement _try_except_statement) - { - throw new NotImplementedException(); - } - - public void visit(record_const_definition _record_const_definition) - { - throw new NotImplementedException(); - } - - public void visit(record_const _record_const) - { - throw new NotImplementedException(); - } - - public void visit(record_type _record_type) - { - throw new NotImplementedException(); - } - - public void visit(enum_type_definition _enum_type_definition) - { - throw new NotImplementedException(); - } - - public void visit(char_const _char_const) - { - AddPossibleComments(_char_const, true, true); - } - - public void visit(raise_statement _raise_statement) - { - throw new NotImplementedException(); - } - - public void visit(sharp_char_const _sharp_char_const) - { - AddPossibleComments(_sharp_char_const, true, true); - } - - public void visit(literal_const_line _literal_const_line) - { - throw new NotImplementedException(); - } - - public void visit(string_num_definition _string_num_definition) - { - _string_num_definition.name.visit(this); - _string_num_definition.num_of_symbols.visit(this); - AddPossibleComments(_string_num_definition, false, true); - } - - public void visit(variant _variant) - { - throw new NotImplementedException(); - } - - public void visit(variant_list _variant_list) - { - throw new NotImplementedException(); - } - - public void visit(variant_type _variant_type) - { - throw new NotImplementedException(); - } - - public void visit(variant_types _variant_types) - { - throw new NotImplementedException(); - } - - public void visit(variant_record_type _variant_record_type) - { - throw new NotImplementedException(); - } - - public void visit(procedure_call _procedure_call) - { - throw new NotImplementedException(); - } - - public void visit(class_predefinition _class_predefinition) - { - throw new NotImplementedException(); - } - - public void visit(nil_const _nil_const) - { - AddPossibleComments(_nil_const, true, true); - } - - public void visit(file_type_definition _file_type_definition) - { - throw new NotImplementedException(); - } - - public void visit(constructor _constructor) - { - throw new NotImplementedException(); - } - - public void visit(destructor _destructor) - { - throw new NotImplementedException(); - } - - public void visit(inherited_method_call _inherited_method_call) - { - throw new NotImplementedException(); - } - - public void visit(typecast_node _typecast_node) - { - throw new NotImplementedException(); - } - - public void visit(interface_node _interface_node) - { - if (_interface_node.uses_modules != null) - _interface_node.uses_modules.visit(this); - if (_interface_node.interface_definitions != null) - _interface_node.interface_definitions.visit(this); - } - - public void visit(implementation_node _implementation_node) - { - if (_implementation_node.uses_modules != null) - _implementation_node.uses_modules.visit(this); - if (_implementation_node.implementation_definitions != null) - _implementation_node.implementation_definitions.visit(this); - } - - public void visit(diap_expr _diap_expr) - { - throw new NotImplementedException(); - } - - public void visit(block _block) - { - if (_block.defs != null) - _block.defs.visit(this); - if (_block.program_code != null) - _block.program_code.visit(this); - } - - public void visit(proc_block _proc_block) - { - throw new NotImplementedException(); - } - - public void visit(array_of_named_type_definition _array_of_named_type_definition) - { - throw new NotImplementedException(); - } - - public void visit(array_of_const_type_definition _array_of_const_type_definition) - { - throw new NotImplementedException(); - } - - public void visit(literal _literal) - { - AddPossibleComments(_literal, true, true); - } - - public void visit(case_variants _case_variants) - { - throw new NotImplementedException(); - } - - public void visit(diapason_expr _diapason_expr) - { - _diapason_expr.left.visit(this); - _diapason_expr.right.visit(this); - } - - public void visit(var_def_list _var_def_list) - { - throw new NotImplementedException(); - } - - public void visit(record_type_parts _record_type_parts) - { - throw new NotImplementedException(); - } - - public void visit(property_array_default _property_array_default) - { - throw new NotImplementedException(); - } - - public void visit(property_interface _property_interface) - { - throw new NotImplementedException(); - } - - public void visit(property_parameter _property_parameter) - { - throw new NotImplementedException(); - } - - public void visit(property_parameter_list _property_parameter_list) - { - throw new NotImplementedException(); - } - - public void visit(inherited_ident _inherited_ident) - { - throw new NotImplementedException(); - } - - public void visit(format_expr _format_expr) - { - _format_expr.expr.visit(this); - _format_expr.format1.visit(this); - if (_format_expr.format2 != null) - _format_expr.format2.visit(this); - } - - public void visit(initfinal_part _initfinal_part) - { - throw new NotImplementedException(); - } - - public void visit(token_info _token_info) - { - throw new NotImplementedException(); - } - - public void visit(raise_stmt _raise_stmt) - { - AddPossibleComments(_raise_stmt, true, false); - _raise_stmt.expr.visit(this); - } - - public void visit(op_type_node _op_type_node) - { - throw new NotImplementedException(); - } - - public void visit(file_type _file_type) - { - AddPossibleComments(_file_type, true, false); - if (_file_type.file_of_type != null) - _file_type.file_of_type.visit(this); - } - - public void visit(known_type_ident _known_type_ident) - { - throw new NotImplementedException(); - } - - public void visit(exception_handler _exception_handler) - { - throw new NotImplementedException(); - } - - public void visit(exception_ident _exception_ident) - { - throw new NotImplementedException(); - } - - public void visit(exception_handler_list _exception_handler_list) - { - throw new NotImplementedException(); - } - - public void visit(exception_block _exception_block) - { - throw new NotImplementedException(); - } - - public void visit(try_handler _try_handler) - { - throw new NotImplementedException(); - } - - public void visit(try_handler_finally _try_handler_finally) - { - throw new NotImplementedException(); - } - - public void visit(try_handler_except _try_handler_except) - { - throw new NotImplementedException(); - } - - public void visit(try_stmt _try_stmt) - { - AddPossibleComments(_try_stmt, true, false); - _try_stmt.stmt_list.visit(this); - _try_stmt.handler.visit(this); - } - - public void visit(inherited_message _inherited_message) - { - throw new NotImplementedException(); - } - - public void visit(external_directive _external_directive) - { - throw new NotImplementedException(); - } - - public void visit(using_list _using_list) - { - throw new NotImplementedException(); - } - - public void visit(oberon_import_module _oberon_import_module) - { - throw new NotImplementedException(); - } - - public void visit(oberon_module _oberon_module) - { - throw new NotImplementedException(); - } - - public void visit(oberon_ident_with_export_marker _oberon_ident_with_export_marker) - { - throw new NotImplementedException(); - } - - public void visit(oberon_exit_stmt _oberon_exit_stmt) - { - throw new NotImplementedException(); - } - - public void visit(jump_stmt _jump_stmt) - { - throw new NotImplementedException(); - } - - public void visit(oberon_procedure_receiver _oberon_procedure_receiver) - { - throw new NotImplementedException(); - } - - public void visit(oberon_procedure_header _oberon_procedure_header) - { - throw new NotImplementedException(); - } - - public void visit(oberon_withstmt_guardstat _oberon_withstmt_guardstat) - { - throw new NotImplementedException(); - } - - public void visit(oberon_withstmt_guardstat_list _oberon_withstmt_guardstat_list) - { - throw new NotImplementedException(); - } - - public void visit(oberon_withstmt _oberon_withstmt) - { - throw new NotImplementedException(); - } - - public void visit(loop_stmt _loop_stmt) - { - throw new NotImplementedException(); - } - - public void visit(foreach_stmt _foreach_stmt) - { - AddPossibleComments(_foreach_stmt, true, false); - _foreach_stmt.identifier.visit(this); - if (_foreach_stmt.type_name != null) - _foreach_stmt.type_name.visit(this); - _foreach_stmt.in_what.visit(this); - _foreach_stmt.stmt.visit(this); - } - - public void visit(addressed_value_funcname _addressed_value_funcname) - { - throw new NotImplementedException(); - } - - public void visit(named_type_reference_list _named_type_reference_list) - { - foreach (named_type_reference ntr in _named_type_reference_list.types) - ntr.visit(this); - } - - public void visit(template_param_list _template_param_list) - { - throw new NotImplementedException(); - } - - public void visit(template_type_reference _template_type_reference) - { - throw new NotImplementedException(); - } - - public void visit(int64_const _int64_const) - { - AddPossibleComments(_int64_const, true, true); - } - - public void visit(uint64_const _uint64_const) - { - AddPossibleComments(_uint64_const, true, true); - } - - public void visit(new_expr _new_expr) - { - AddPossibleComments(_new_expr, true, false); - _new_expr.type.visit(this); - if (_new_expr.params_list != null) - _new_expr.params_list.visit(this); - if (_new_expr.array_init_expr != null) - _new_expr.array_init_expr.visit(this); - } - - public void visit(type_definition_list _type_definition_list) - { - throw new NotImplementedException(); - } - - public void visit(where_definition _where_definition) - { - throw new NotImplementedException(); - } - - public void visit(where_definition_list _where_definition_list) - { - throw new NotImplementedException(); - } - - public void visit(sizeof_operator _sizeof_operator) - { - AddPossibleComments(_sizeof_operator, true, true); - if (_sizeof_operator.type_def != null) - _sizeof_operator.type_def.visit(this); - if (_sizeof_operator.expr != null) - _sizeof_operator.expr.visit(this); - } - - public void visit(typeof_operator _typeof_operator) - { - AddPossibleComments(_typeof_operator, true, true); - _typeof_operator.type_name.visit(this); - } - - public void visit(compiler_directive _compiler_directive) - { - throw new NotImplementedException(); - } - - public void visit(operator_name_ident _operator_name_ident) - { - throw new NotImplementedException(); - } - - public void visit(var_statement _var_statement) - { - AddPossibleComments(_var_statement, true, false); - } - - public void visit(question_colon_expression _question_colon_expression) - { - _question_colon_expression.condition.visit(this); - _question_colon_expression.ret_if_true.visit(this); - _question_colon_expression.ret_if_false.visit(this); - } - - public void visit(expression_as_statement _expression_as_statement) - { - throw new NotImplementedException(); - } - - public void visit(c_scalar_type _c_scalar_type) - { - throw new NotImplementedException(); - } - - public void visit(c_module _c_module) - { - throw new NotImplementedException(); - } - - public void visit(declarations_as_statement _declarations_as_statement) - { - throw new NotImplementedException(); - } - - public void visit(array_size _array_size) - { - throw new NotImplementedException(); - } - - public void visit(enumerator _enumerator) - { - if (_enumerator.name != null) - _enumerator.name.visit(this); - _enumerator.value.visit(this); - } - - public void visit(enumerator_list _enumerator_list) - { - foreach (enumerator en in _enumerator_list.enumerators) - en.visit(this); - } - - public void visit(c_for_cycle _c_for_cycle) - { - throw new NotImplementedException(); - } - - public void visit(switch_stmt _switch_stmt) - { - throw new NotImplementedException(); - } - - public void visit(type_definition_attr_list _type_definition_attr_list) - { - throw new NotImplementedException(); - } - - public void visit(type_definition_attr _type_definition_attr) - { - throw new NotImplementedException(); - } - - public void visit(lock_stmt _lock_stmt) - { - throw new NotImplementedException(); - } - - public void visit(compiler_directive_list _compiler_directive_list) - { - throw new NotImplementedException(); - } - - public void visit(compiler_directive_if _compiler_directive_if) - { - throw new NotImplementedException(); - } - - public void visit(documentation_comment_list _documentation_comment_list) - { - throw new NotImplementedException(); - } - - public void visit(documentation_comment_tag _documentation_comment_tag) - { - throw new NotImplementedException(); - } - - public void visit(documentation_comment_tag_param _documentation_comment_tag_param) - { - throw new NotImplementedException(); - } - - public void visit(documentation_comment_section _documentation_comment_section) - { - throw new NotImplementedException(); - } - - public void visit(token_taginfo _token_taginfo) - { - throw new NotImplementedException(); - } - - public void visit(declaration_specificator _declaration_specificator) - { - throw new NotImplementedException(); - } - - public void visit(ident_with_templateparams _ident_with_templateparams) - { - throw new NotImplementedException(); - } - - public void visit(template_type_name _template_type_name) - { - throw new NotImplementedException(); - } - - public void visit(default_operator _default_operator) - { - AddPossibleComments(_default_operator, true, true); - _default_operator.type_name.visit(this); - } - - public void visit(bracket_expr _bracket_expr) - { - AddPossibleComments(_bracket_expr, true, true); - _bracket_expr.expr.visit(this); - } - - public void visit(attribute _attribute) - { - throw new NotImplementedException(); - } - - public void visit(simple_attribute_list _simple_attribute_list) - { - throw new NotImplementedException(); - } - - public void visit(attribute_list _attribute_list) - { - throw new NotImplementedException(); - } - - #endregion - } -} \ No newline at end of file diff --git a/Parsers/PascalABCParser/Errors.cs b/Parsers/PascalABCParser/Errors.cs deleted file mode 100644 index c7919f862..000000000 --- a/Parsers/PascalABCParser/Errors.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.PascalABCParser; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.Errors; -using System.Collections.Generic; - - -namespace PascalABCCompiler.PascalABCParser.Errors -{ - public class bad_operand_type: SyntaxError - { - public bad_operand_type(string _file_name,SourceContext _source_context,syntax_tree_node _node): - base(StringResources.Get("OPERATOR_NOT_IMPLEMET_TO_THIS_OPEAND_TYPE"), _file_name, _source_context, _node) - { - } - } - public class statement_expected : SyntaxError - { - public statement_expected(string _file_name,SourceContext _source_context,syntax_tree_node _node): - base(StringResources.Get("STATEMENT_EXPECTED"), _file_name, _source_context, _node) - { - } - - } - public class bad_leftside_assigment : SyntaxError - { - public bad_leftside_assigment(string _file_name,SourceContext _source_context,syntax_tree_node _node): - base(StringResources.Get("LEFT_SIDE_ASSIGN_MUST_BE_VARIABLE"), _file_name, _source_context, _node) - { - } - } - public class nonterminal_token_return_null : SyntaxError - { - public nonterminal_token_return_null(string _file_name,SourceContext _source_context,syntax_tree_node _node,string nonterminal_token_name): - base(string.Format(StringResources.Get("NONTERMINALTOKEN_{0}_RETURN_NULL"), nonterminal_token_name), - _file_name,_source_context,_node) - { - } - } - public class unexpected_return_value : SyntaxError - { - public unexpected_return_value(string _file_name, SourceContext _source_context, syntax_tree_node _node) - : base(StringResources.Get("PROCEDURE_CANNOT_HAVE_RETURNED_VALUE"), _file_name, _source_context, _node) - { - } - } - public class unexpected_ident : SyntaxError - { - public unexpected_ident(string _file_name,ident unexpected_id,string expected,SourceContext _source_context, syntax_tree_node _node) - : base(string.Format(StringResources.Get("EXPECTED_{0}_BUT_FOUND_{1}"), expected, unexpected_id.name), _file_name, _source_context, _node) - { - } - } - public class PABCNETUnexpectedToken : SyntaxError - { - private string _message; - public PABCNETUnexpectedToken(PascalABCCompiler.ParserTools.GPBParser parser) - : base("", parser.current_file_name, parser.parsertools.GetTokenSourceContext(parser.LRParser), (syntax_tree_node)parser.prev_node) - { - List Symbols = parser.parsertools.GetPrioritySymbols(parser.LRParser.GetExpectedTokens()); - if (Symbols.Count == 1) - { - string OneSybmolText = "ONE_" + Symbols[0].Name.ToUpper(); - string LocOneSybmolText = StringResources.Get(OneSybmolText); - if (LocOneSybmolText != OneSybmolText) - { - _message = string.Format(LocOneSybmolText); - return; - } - } - _message = string.Format(StringResources.Get("EXPECTED{0}"), PascalABCCompiler.FormatTools.ObjectsToString(parser.parsertools.SymbolsToStrings(Symbols.ToArray()), ",")); - } - public PABCNETUnexpectedToken(string _file_name, string expected, SourceContext _source_context, syntax_tree_node _node) - : base("", _file_name, _source_context, _node) - { - _message = string.Format(StringResources.Get("EXPECTED{0}"), expected); - } - public override string Message - { - get - { - return _message; - } - } - } - -} diff --git a/Parsers/PascalABCParser/Parser.cs b/Parsers/PascalABCParser/Parser.cs deleted file mode 100644 index 62dd1007f..000000000 --- a/Parsers/PascalABCParser/Parser.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System; -using System.IO; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Parsers; -using System.Resources; -using System.Reflection; -using System.Collections.Generic; -using PascalABCCompiler.Errors; -using PascalABCCompiler.Preprocessor2; - - -namespace PascalABCCompiler.PascalABCParser -{ - - public class PascalABCLanguageParser : BaseParser, IParser - { - private GPBParser_PascalABC parser; - private GPBParser_PascalABC localparser; // ВынеÑ� localparser Ñ�юда длÑ� передачи между методами. ПоÑ�ле избавлениÑ� от GPB должен оÑ�татьÑ�Ñ� только Ñ�тот парÑ�ер - - public Preprocessor2.Preprocessor2 preprocessor2 = new PascalABCCompiler.Preprocessor2.Preprocessor2(null); - - private Stream grammar_stream; - - public PascalABCLanguageParser() - : base("PascalABC.NET", "2.2", "(c) Ткачук Ð�.Ð’. 2005,2008; Михалкович С.С. 2012", false, new string[1]{".gpas"}) - { - parser = null; - } - - public override void Reset() - { - CompilerDirectives.Clear(); - grammar_stream = CGTResourceExtractor.Extract(new ResourceManager("PascalABCParser.PascalABCLang", Assembly.GetExecutingAssembly()),"PascalABCLanguage"); - parser = new GPBParser_PascalABC(grammar_stream, preprocessor2); - parser.Parse("begin end."); - max_errors = 30; - } - - public override SourceFilesProviderDelegate SourceFilesProvider - { - get - { - return sourceFilesProvider; - } - set - { - sourceFilesProvider = value; - preprocessor2.SourceFilesProvider = value; - } - } - - int max_errors - { - get - { - return parser.max_errors; - } - set - { - parser.max_errors = value; - } - } - - public override void PreBuildTree(string FileName) - { - if (this.parser == null) - Reset(); - CompilerDirectives = new List(); - localparser = new GPBParser_PascalABC(this.grammar_stream, this.parser.LanguageGrammar, preprocessor2); - localparser.CompilerDirectives = CompilerDirectives; - localparser.errors = Errors; - localparser.current_file_name = FileName; - localparser.parsertools.LineCorrection = 0; - localparser.build_tree_for_brackets = false; - preprocessor2 = new Preprocessor2.Preprocessor2(SourceFilesProvider); - } - - public override syntax_tree_node BuildTreeInNormalMode(string FileName, string Text) - { - Errors.Clear(); - - string[] file_names = new string[1]; - file_names[0] = FileName; - SourceContextMap scm = new SourceContextMap(); - Text = preprocessor2.Build(file_names, Errors, scm); - - localparser.scm = scm; - ((localparser.parsertools) as pascalabc_parsertools).scm = scm; - - if (Errors.Count > 0) - return null; - - syntax_tree_node root = (syntax_tree_node)localparser.Parse(Text); - if (root != null && root is compilation_unit) - (root as compilation_unit).file_name = FileName; - if (preprocessor2.CompilerDirectives != null && preprocessor2.CompilerDirectives.Count != 0) - localparser.CompilerDirectives.AddRange(preprocessor2.CompilerDirectives); - - return root; - } - - public override syntax_tree_node BuildTreeInExprMode(string FileName, string Text) - { - Text = String.Concat("<>", Environment.NewLine, Text); - localparser.parsertools.LineCorrection = -1; - syntax_tree_node root = (syntax_tree_node)localparser.Parse(Text); - return root as expression; - } - - public override syntax_tree_node BuildTreeInStatementMode(string FileName, string Text) - { - Text = String.Concat("<>", Environment.NewLine, Text); - localparser.parsertools.LineCorrection = -1; - syntax_tree_node root = (syntax_tree_node)localparser.Parse(Text); - return root as statement; - } - - public override syntax_tree_node BuildTreeInSpecialMode(string FileName, string Text) - { - Errors.Clear(); - syntax_tree_node root = (syntax_tree_node)localparser.Parse(Text); - return root; - } - - public override syntax_tree_node BuildTreeInFormatterMode(string FileName, string Text) - { - localparser.build_tree_for_brackets = true; - Errors.Clear(); - syntax_tree_node root = (syntax_tree_node)localparser.Parse(Text); - return root; - } - - public override string ToString() - { - return "PascalABC.NET Language Parser v2.2"; - } - public override IPreprocessor Preprocessor - { - get - { - //MZ - return preprocessor2; - } - } - - } - - - -} diff --git a/Parsers/PascalABCParser/PascalABCLang.resources b/Parsers/PascalABCParser/PascalABCLang.resources deleted file mode 100644 index ee5d1af29..000000000 Binary files a/Parsers/PascalABCParser/PascalABCLang.resources and /dev/null differ diff --git a/Parsers/PascalABCParser/PascalABCParser.csproj b/Parsers/PascalABCParser/PascalABCParser.csproj deleted file mode 100644 index 9c6ce4ffa..000000000 --- a/Parsers/PascalABCParser/PascalABCParser.csproj +++ /dev/null @@ -1,123 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {93E024EA-632F-495C-9142-86769EA42118} - Library - Properties - PascalABCParser - PascalABCOldParser - - - 4.0 - - - v4.0 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - ..\..\bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - ..\..\bin\ - TRACE - prompt - 4 - AllRules.ruleset - - - - - - - - - - Code - - - - Code - - - - - - - - - - - - - - - {44A01F9E-DCE7-470C-AAE5-C3DE0CCBEE3B} - Errors - - - {2DE2842F-0912-4251-BC0F-480854C44A13} - Localization - - - {AF2EFD7B-69DD-4B43-AF65-B59B29349C23} - ParserTools - - - {C2CAC65A-B2AE-4CCC-B067-E6B8E75DF73A} - SyntaxTree - - - - - False - КлиентÑ�кий профиль .NET Framework 3.5 SP1 - false - - - False - .NET Framework 3.5 SP1 - true - - - False - УÑ�тановщик Windows 3.1 - true - - - - - \ No newline at end of file diff --git a/Parsers/PascalABCParser/PascalABCParserTools.cs b/Parsers/PascalABCParser/PascalABCParserTools.cs deleted file mode 100644 index bfb482799..000000000 --- a/Parsers/PascalABCParser/PascalABCParserTools.cs +++ /dev/null @@ -1,172 +0,0 @@ -using System; -using System.Text; -//using com.calitha.goldparser; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.ParserTools; -using GoldParser; - - -namespace PascalABCCompiler.PascalABCParser -{ - public static class StringResources - { - private static string prefix = "PASCALABCPARSER_"; - public static string Get(string Id) - { - string ret = PascalABCCompiler.StringResources.Get(prefix + Id); - if (ret == prefix + Id) - return Id; - else - return ret; - } - } - - public class pascalabc_parsertools : parser_tools - { - public SourceContextMap scm = null; - public override SourceContext GetTokenSourceContext() - { - return GetTokenSourceContext(parser); - } - int NewLineLength = Environment.NewLine.Length; - int GetLinesCount(string s) - { - //Ð�е учитывает поÑ�ледний перевод еÑ�ли за ним ничего - int i = s.IndexOf(Environment.NewLine); - int res = 0; - if (i >= 0 && i < s.Length - NewLineLength) - res++; - while (i >= 0) - { - i = s.IndexOf(Environment.NewLine, i + NewLineLength); - if (i >= 0 && i < s.Length - NewLineLength) - res++; - } - return res; - } - public override SourceContext GetTokenSourceContext(Parser parser) - { - int LineNum = parser.TokenLineNumber + LineCorrection; - SourceContext sc = new SourceContext(LineNum, parser.TokenLinePosition, LineNum + GetLinesCount(parser.TokenText), parser.TokenLinePosition + parser.TokenLength - 1, parser.TokenCharPosition, parser.TokenCharPosition + parser.TokenLength); - if (scm != null) - sc = scm.GetSourceContext(sc); - return sc; - } - - public compiler_directive MakeDirective(token_info ti) - { - compiler_directive cd = new compiler_directive(); - cd.Directive = new token_info(); - string name = ti.text.Remove(0, 2).Replace("}",""); - int i = name.IndexOf(' '); - if (i > 0) - { - cd.Directive = new token_info(name.Remove(0, i + 1)); - cd.Directive.source_context = ti.source_context; - name = name.Remove(i); - cd.Directive.text = cd.Directive.text.Trim(' '); - cd.Directive.text = cd.Directive.text.Replace(@"'", "".ToString()); - } - - cd.Name = new token_info(name); - cd.Name.source_context = ti.source_context; - cd.source_context = ti.source_context; - return cd; - } - - public override string symbol_to_string(Symbol symbol) - { - switch (symbol.Index) - { - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKMINUS: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKOR: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKXOR: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKAND: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKDIV: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKMOD: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKSHL: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKSHR: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKSLASH: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKSTAR: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKGREATER: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKGREATEREQUAL: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKIN: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKLOWER: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKLOWEREQUAL: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKNOTEQUAL: - return StringResources.Get("OPERATOR"); - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKSQUARECLOSE: - return "]"; - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKSQUAREOPEN: - return "["; - } - string res = StringResources.Get(symbol.Name.ToUpper()); - if (res.IndexOf("TK") == 0) - return res.Remove(0, 2).ToLower(); - return res; - } - - public override int symbol_priority(Symbol symbol) - { - - switch (symbol.Index) - { - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKEND: - return 8; - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKBEGIN: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKINTEGER: - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKROUNDCLOSE: - return 9; - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKIDENTIFIER: - return 10; - - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKASSIGN: - return 25; - - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKCOLON: - return 20; - - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKEQUAL: - return 25; - - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKSEMICOLON: - return 30; - - // case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKDO: - // return 50; - //case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_TKPOINT: - // return 35; - - // return 5; - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_EXPR: - return 100; - case (int)GPBParser_PascalABC.SymbolConstants.SYMBOL_STMT: - return 110; - - } - if (symbol.SymbolType == SymbolType.Terminal) - return 1; - return 0; - } - - /*public override void check_comment_text(GPBParser parser) - { - string original_text = parser.LRParser.TokenString; - if (original_text[0] == '{' && original_text[1] == '$') - { - string text = original_text.Substring(2, original_text.Length - 3); - int delim_pos = text.IndexOf(' '); - if (delim_pos > 1) - { - string dname = text.Substring(0, delim_pos - 1); - string derictive = text.Substring(delim_pos, text.Length - delim_pos - 1); - compiler_directive cd = new compiler_directive(dname, derictive); - cd.source_context = GetTokenSourceContext(parser.LRParser); - parser.CompilerDirectives.Add(cd); - } - } - }*/ - - - } -} diff --git a/Parsers/PascalABCParser/Preprocessor/Parser.cs b/Parsers/PascalABCParser/Preprocessor/Parser.cs deleted file mode 100644 index bf392a172..000000000 --- a/Parsers/PascalABCParser/Preprocessor/Parser.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System; -using System.IO; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.SyntaxTree; - -using System.Resources; -using System.Reflection; -using PascalABCCompiler.Parsers; -using System.Collections.Generic; -using PascalABCCompiler.Errors; - - -namespace PascalABCCompiler.PascalPreprocessor -{ - - public class PascalPreprocessorLanguageParser:IParser - { - private GPBPreprocessor_Pascal parser; - - public PascalPreprocessorLanguageParser() - { - this.filesExtensions = new string[1]; - this.filesExtensions[0] = ".paspr" + Parsers.Controller.HideParserExtensionPostfixChar; - parser = null; - } - - string[] filesExtensions; - public string[] FilesExtensions - { - get - { - return filesExtensions; - } - } - - ILanguageInformation lnginf = new DefaultLanguageInformation(); - public ILanguageInformation LanguageInformation { - get { - return lnginf; - } - } - - public bool CaseSensitive - { - get - { - return parser.LanguageGrammar.CaseSensitive; - } - } - - public Keyword[] Keywords - { - get - { - return new Keyword[0]; - } - } - - public List compilerDirectives = new List(); - public List CompilerDirectives - { - get - { - return compilerDirectives; - } - } - - List errors = new List(); - public List Errors - { - get - { - return errors; - } - set - { - errors = value; - } - } - - private Stream grammar_stream = null; - public void Reset() - { - grammar_stream = CGTResourceExtractor.Extract(new ResourceManager("PascalABCParser.Preprocessor.PascalPreprocessorLang", Assembly.GetExecutingAssembly()), "PascalPreprocessorLanguage"); - parser = new GPBPreprocessor_Pascal(grammar_stream); - max_errors = 5; - } - public virtual int max_errors - { - get - { - return parser.max_errors; - } - set - { - parser.max_errors=value; - } - } - - SourceFilesProviderDelegate sourceFilesProvider = null; - public SourceFilesProviderDelegate SourceFilesProvider - { - get - { - return sourceFilesProvider; - } - set - { - sourceFilesProvider = value; - } - } - - public syntax_tree_node BuildTree(string FileName, string Text, string[] SearchPatchs, ParseMode parseMode) - { - if (this.parser == null) - Reset(); - GPBPreprocessor_Pascal parser = new GPBPreprocessor_Pascal(this.grammar_stream,this.parser.LanguageGrammar); - parser.errors = Errors; - parser.current_file_name = FileName; - compilerDirectives = new List(); - parser.CompilerDirectives = compilerDirectives; - switch (parseMode) - { - case ParseMode.Expression: - case ParseMode.Statement: - return null; - } - syntax_tree_node cu = (syntax_tree_node)parser.Parse(Text); - if (cu != null && cu is compilation_unit) - { - (cu as compilation_unit).file_name = FileName; - (cu as compilation_unit).compiler_directives = compilerDirectives; - } - return cu; - } - - public string Name - { - get - { - return "Pascal Preprocessor"; - } - } - public string Version - { - get - { - return "0.2"; - } - } - public string Copyright - { - get - { - return "(c) Ткачук Ð�.Ð’. 2008"; - } - } - public override string ToString() - { - return "Pascal Preprocessor v0.1"; - } - public IPreprocessor Preprocessor - { - get - { - return null; - } - } - - } - - -} diff --git a/Parsers/PascalABCParser/Preprocessor/PascalPreprocessorLang.resources b/Parsers/PascalABCParser/Preprocessor/PascalPreprocessorLang.resources deleted file mode 100644 index af4024172..000000000 Binary files a/Parsers/PascalABCParser/Preprocessor/PascalPreprocessorLang.resources and /dev/null differ diff --git a/Parsers/PascalABCParser/Preprocessor/PascalPreprocessor_lrparser.cs b/Parsers/PascalABCParser/Preprocessor/PascalPreprocessor_lrparser.cs deleted file mode 100644 index 2585ddf91..000000000 --- a/Parsers/PascalABCParser/Preprocessor/PascalPreprocessor_lrparser.cs +++ /dev/null @@ -1,329 +0,0 @@ - -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using System.Collections.Generic; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.PascalABCParser.Errors; -using PascalABCCompiler.ParserTools; -using GoldParser; -using PascalABCCompiler.PascalABCParser; - - -namespace PascalABCCompiler.PascalPreprocessor -{ - - public class GPBPreprocessor_Pascal:GPBParser - { - private int operation_value=0; - private object left_node,right_node; - private Stack if_part = new Stack(); - private Stack first_if = new Stack(); - private pascalabc_parsertools pascal_parsertools; - - public GPBPreprocessor_Pascal(Stream stream) - :base(stream) - { - pascal_parsertools = new pascalabc_parsertools(); - parsertools = pascal_parsertools; - } - - public GPBPreprocessor_Pascal(Stream stream, GoldParser.Grammar grammar):base(grammar) - { - pascal_parsertools = new pascalabc_parsertools(); - parsertools = pascal_parsertools; - } - - public object Parse(string source) - { - if_part.Clear(); - first_if.Clear(); - LRParser = new Parser(new StringReader(source), LanguageGrammar); - parsertools.parser = LRParser; - LRParser.TrimReductions = true; - try -{ - while (true) - { - switch (LRParser.Parse()) - { - case ParseMessage.LexicalError: - errors.Add(new TokenReadError(this)); - LRParser.PopInputToken(); - if (errors.Count > max_errors) - return null; - break; - - case ParseMessage.SyntaxError: - if ((LRParser.TokenSyntaxNode as syntax_tree_node)!= null) - prev_node = LRParser.TokenSyntaxNode; - Error er = new PABCNETUnexpectedToken(this); - Symbol sym = LRParser.PopInputToken(); - if (sym.SymbolType == SymbolType.End && errors.Count > 0) - return null; - errors.Add(er); - if (errors.Count > max_errors) - return null; - break; - case ParseMessage.Reduction: - LRParser.TokenSyntaxNode = CreateNonTerminalObject(); - break; - - case ParseMessage.Accept: - return LRParser.TokenSyntaxNode; - - case ParseMessage.TokenRead: - LRParser.TokenSyntaxNode = CreateTerminalObject(); - break; - - case ParseMessage.InternalError: - errors.Add(new CompilerInternalError("CParser", new Exception("ParseMessage.InternalError"))); - return null; - - case ParseMessage.NotLoadedError: - errors.Add(new CompilerInternalError("CParser", new Exception("ParseMessage.NotLoadedError"))); - return null; - - case ParseMessage.CommentError: - errors.Add(new UnexpectedToken(this,"(EOF)")); - return null; - - /*case ParseMessage.CommentBlockRead: - break; - - case ParseMessage.CommentLineRead: - break;*/ - } - } - } - catch (GoldParser.UnexpectedEOFinParseCommentBlock) - { - throw new TokenReadError(this); - } - catch (Exception e) - { - if (errors.Count > 0) - return null; - else - throw; - } - - } - - public enum SymbolConstants : int - { - SYMBOL_EOF = 0, // (EOF) - SYMBOL_ERROR = 1, // (Error) - SYMBOL_WHITESPACE = 2, // (Whitespace) - SYMBOL_COMMENTEND = 3, // (Comment End) - SYMBOL_COMMENTLINE = 4, // (Comment Line) - SYMBOL_COMMENTSTART = 5, // (Comment Start) - SYMBOL_TKDIRECTIVE = 6, // 'TKDIRECTIVE' - SYMBOL_TKNEWLINE = 7, // 'TKNEWLINE' - SYMBOL_TKPROGRAM_LINE_PART = 8, // 'TKPROGRAM_LINE_PART' - SYMBOL__DIRECTIVE_GROUPS = 9, // <_directive_groups> - SYMBOL_DIRECTIVE_GROUP = 10, // - SYMBOL_DIRECTIVE_GROUPS = 11, // - SYMBOL_EMPTY = 12, // - SYMBOL_PREPROCESSOR_PROGRAM = 13 // - }; - - public enum RuleConstants : int - { - RULE_PREPROCESSOR_PROGRAM = 0, // ::= - RULE_DIRECTIVE_GROUPS = 1, // ::= <_directive_groups> - RULE_DIRECTIVE_GROUPS2 = 2, // ::= - RULE__DIRECTIVE_GROUPS = 3, // <_directive_groups> ::= - RULE__DIRECTIVE_GROUPS2 = 4, // <_directive_groups> ::= - RULE_DIRECTIVE_GROUP_TKNEWLINE = 5, // ::= 'TKNEWLINE' - RULE_DIRECTIVE_GROUP_TKPROGRAM_LINE_PART = 6, // ::= 'TKPROGRAM_LINE_PART' - RULE_DIRECTIVE_GROUP_TKDIRECTIVE = 7, // ::= 'TKDIRECTIVE' - RULE_EMPTY = 8 // ::= - }; - - private Object CreateTerminalObject() - { - switch ((SymbolConstants) LRParser.TokenSymbol.Index) - { - case SymbolConstants.SYMBOL_EOF : - //(EOF) - //TERMINAL:EOF - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_ERROR : - //(Error) - //TERMINAL:Error - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_WHITESPACE : - //(Whitespace) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Whitespace' return NULL! \n\r");*/return null; - - case SymbolConstants.SYMBOL_COMMENTEND : - //(Comment End) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment End' return NULL! \n\r");*/return null; - - case SymbolConstants.SYMBOL_COMMENTLINE : - //(Comment Line) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment Line' return NULL! \n\r");*/return null; - - case SymbolConstants.SYMBOL_COMMENTSTART : - //(Comment Start) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment Start' return NULL! \n\r");*/return null; - - case SymbolConstants.SYMBOL_TKDIRECTIVE : - //'TKDIRECTIVE' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - - case SymbolConstants.SYMBOL_TKNEWLINE : - //'TKNEWLINE' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - - case SymbolConstants.SYMBOL_TKPROGRAM_LINE_PART : - //'TKPROGRAM_LINE_PART' - - { - token_info _token_info=new token_info(LRParser.TokenText); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - - case SymbolConstants.SYMBOL__DIRECTIVE_GROUPS : - //<_directive_groups> - //TERMINAL:_directive_groups - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_DIRECTIVE_GROUP : - // - //TERMINAL:directive_group - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_DIRECTIVE_GROUPS : - // - //TERMINAL:directive_groups - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_EMPTY : - // - //TERMINAL:empty - return null; - //ENDTERMINAL - - case SymbolConstants.SYMBOL_PREPROCESSOR_PROGRAM : - // - //TERMINAL:preprocessor_program - return null; - //ENDTERMINAL - - } - throw new SymbolException("Unknown symbol"); - } - - - - public Object CreateNonTerminalObject() - { - switch ((RuleConstants) LRParser.ReductionRule.Index) - { - case RuleConstants.RULE_PREPROCESSOR_PROGRAM : - // ::= - - { - compilation_unit _compilation_unit=new compilation_unit(); - - _compilation_unit.Language=LanguageId.PascalABCNET; - if(LRParser.GetReductionSyntaxNode(0)!=null){ - parsertools.create_source_context(_compilation_unit,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - CompilerDirectives.AddRange(((compiler_directive_list)LRParser.GetReductionSyntaxNode(0)).directives); - } - - return _compilation_unit; - } - - - case RuleConstants.RULE_DIRECTIVE_GROUPS : - // ::= <_directive_groups> -return LRParser.GetReductionSyntaxNode(0); - - case RuleConstants.RULE_DIRECTIVE_GROUPS2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - - case RuleConstants.RULE__DIRECTIVE_GROUPS : - //<_directive_groups> ::= - - { - compiler_directive_list _compiler_directive_list=new compiler_directive_list(); - - if(LRParser.GetReductionSyntaxNode(0) is compiler_directive) - _compiler_directive_list.directives.Add((compiler_directive)LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_compiler_directive_list,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _compiler_directive_list; - } - - - case RuleConstants.RULE__DIRECTIVE_GROUPS2 : - //<_directive_groups> ::= - - { - compiler_directive_list _compiler_directive_list=(compiler_directive_list)LRParser.GetReductionSyntaxNode(0); - if(LRParser.GetReductionSyntaxNode(1) is compiler_directive) - _compiler_directive_list.directives.Add((compiler_directive)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_compiler_directive_list,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _compiler_directive_list; - } - - - case RuleConstants.RULE_DIRECTIVE_GROUP_TKNEWLINE : - // ::= 'TKNEWLINE' -return LRParser.GetReductionSyntaxNode(0); - - case RuleConstants.RULE_DIRECTIVE_GROUP_TKPROGRAM_LINE_PART : - // ::= 'TKPROGRAM_LINE_PART' -return LRParser.GetReductionSyntaxNode(0); - - case RuleConstants.RULE_DIRECTIVE_GROUP_TKDIRECTIVE : - // ::= 'TKDIRECTIVE' - - { - compiler_directive _compiler_directive=(compiler_directive)pascal_parsertools.MakeDirective((token_info)LRParser.GetReductionSyntaxNode(0)); - return _compiler_directive; - } - - - case RuleConstants.RULE_EMPTY : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - - } - throw new RuleException("Unknown rule"); - } - } -} diff --git a/Parsers/PascalABCParser/Preprocessor/Preprocessor.cs b/Parsers/PascalABCParser/Preprocessor/Preprocessor.cs deleted file mode 100644 index 1c36f58bf..000000000 --- a/Parsers/PascalABCParser/Preprocessor/Preprocessor.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using PascalABCCompiler; -using PascalABCCompiler.Errors; -using System.IO; -using PascalABCCompiler.SyntaxTree; -using System.Text.RegularExpressions; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.Parsers; -using PascalABCCompiler.PascalPreprocessor; - -namespace PascalABCCompiler.PascalPreprocessor -{ - public class Preprocessor : IPreprocessor - { - public Preprocessor(SourceFilesProviderDelegate sourceFilesProvider) - { - this.sourceFilesProvider = sourceFilesProvider; - } - - SourceFilesProviderDelegate sourceFilesProvider; - public SourceFilesProviderDelegate SourceFilesProvider - { - get - { - return sourceFilesProvider; - } - set - { - sourceFilesProvider = value; - } - } - - List compilerDirectives=null; - public List CompilerDirectives - { - get - { - return compilerDirectives; - } - } - - PascalPreprocessorLanguageParser PascalPreprocessorParser; - public string Build(string[] fileNames,string[] SearchPaches, List errors, SourceContextMap sourceContextMap) - { - if (PascalPreprocessorParser == null) - PascalPreprocessorParser = new PascalPreprocessorLanguageParser(); - compilerDirectives = new List(); - string text = (string)SourceFilesProvider(fileNames[0], SourceFileOperation.GetText); - PascalPreprocessorParser.Errors = errors; - compilation_unit cu = PascalPreprocessorParser.BuildTree(fileNames[0], text, SearchPaches, PascalABCCompiler.Parsers.ParseMode.Normal) as compilation_unit; - if (errors.Count > 0) - return text; - if (cu == null) - errors.Add(new CompilerInternalError("PascalPreprocessor", new Exception("cu==null"))); - if (cu != null) - compilerDirectives.AddRange(cu.compiler_directives); - return text; - } - - } -} diff --git a/Parsers/PascalABCParser/Preprocessor_2/Errors.cs b/Parsers/PascalABCParser/Preprocessor_2/Errors.cs deleted file mode 100644 index 130eb6b2c..000000000 --- a/Parsers/PascalABCParser/Preprocessor_2/Errors.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.PascalABCParser; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.Errors; -using System.Collections.Generic; - - -namespace PascalABCCompiler.Preprocessor_2.Errors -{ - public static class StringResources - { - private static string prefix = "PABCPreprocessor2_"; - public static string Get(string Id) - { - string ret = PascalABCCompiler.StringResources.Get(prefix + Id); - if (ret == prefix + Id) - return Id; - else - return ret; - } - } - - public class IncludeFileNotFound : SyntaxError - { - public IncludeFileNotFound(string _file_name, SourceContext _source_context, syntax_tree_node _node, string FileName) - : - base(String.Format(StringResources.Get("INCLUDE_FILE_{0}_NOTFOUND"), FileName), _file_name, _source_context, _node) - { - } - } - - public class CircularInclude : SyntaxError - { - public CircularInclude(string _file_name, SourceContext _source_context, syntax_tree_node _node, string FileName) - : - base(String.Format(StringResources.Get("CIRCULAR_INCLUDE_{0}"), FileName), _file_name, _source_context, _node) - { - } - } - - public class ErrorInDefineSyntax : SyntaxError - { - public ErrorInDefineSyntax(string _file_name, SourceContext _source_context) - : - base(StringResources.Get("ERROR_IN_DEFINE_SYNTAX"), _file_name, _source_context, null) - { - } - } - - public class NameDefineError : SyntaxError - { - public NameDefineError(string name, string _file_name, SourceContext _source_context) - : - base(String.Format(StringResources.Get("NAME_IS_DEFINED_{0}"), name), _file_name, _source_context, null) - { - } - } - - public class NameUndefError : SyntaxError - { - public NameUndefError(string name, string _file_name, SourceContext _source_context) - : - base(String.Format(StringResources.Get("NAME_WAS_NOT_DEFINED_{0}"), name), _file_name, _source_context, null) - { - } - } - - public class ErrorInIncludeSyntax : SyntaxError - { - public ErrorInIncludeSyntax(string _file_name, SourceContext _source_context) - : - base(StringResources.Get("ERROR_IN_INCLUDE_SYNTAX"), _file_name, _source_context, null) - { - } - } - public class UnexpectedEndif : SyntaxError - { - public UnexpectedEndif(string _file_name, SourceContext _source_context) - : - base(StringResources.Get("UNEXPEXTED_ENDIF_DIRECTIVE"), _file_name, _source_context, null) - { - } - } - public class UnexpectedElse : SyntaxError - { - public UnexpectedElse(string _file_name, SourceContext _source_context) - : - base(StringResources.Get("UNEXPEXTED_ELSE_DIRECTIVE"), _file_name, _source_context, null) - { - } - } - public class UnexpectedEOF : SyntaxError - { - public UnexpectedEOF(string _file_name, SourceContext _source_context) - : - base(StringResources.Get("ENDIF_DIRECTIVE_EXPEXTED"), _file_name, _source_context, null) - { - } - } - public class SyntaxErrorInDirective : SyntaxError - { - public SyntaxErrorInDirective(string _file_name, SourceContext _source_context, string command) - : - base(String.Format(StringResources.Get("SYNTAX_ERROR_IN_DIRECTIVE_{0}"), command), _file_name, _source_context, null) - { - } - } - public class UnknownDirective : SyntaxError - { - public UnknownDirective(string _file_name, SourceContext _source_context, string command) - : - base(String.Format(StringResources.Get("UNKNOWN_DIRECTIVE_{0}"), command), _file_name, _source_context, null) - { - } - } - - //aspects - public class AspSpacesError : SyntaxError - { - public AspSpacesError(string _file_name, SourceContext _source_context, string command) - : - base(String.Format(StringResources.Get("UNEXPECTED_SPACES_IN_DIRECTIVE_{0}"), command), _file_name, _source_context, null) - { - } - } - - public class UnexpAspData : SyntaxError - { - public UnexpAspData(string _file_name, SourceContext _source_context, string command) - : - base(String.Format(StringResources.Get("UNEXPECTED_ASPDATA_DIRECTIVE_{0}"), command), _file_name, _source_context, null) - { - } - } - - public class DoubleAspData : SyntaxError - { - public DoubleAspData(string _file_name, SourceContext _source_context, string command) - : - base(String.Format(StringResources.Get("DOUBLE_ASPDATA_DIRECTIVE_{0}"), command), _file_name, _source_context, null) - { - } - } - - public class ErrorAspData : SyntaxError - { - public ErrorAspData(string _file_name, SourceContext _source_context, string command) - : - base(String.Format(StringResources.Get("ERROR_ASPDATA_DIRECTIVE_{0}"), command), _file_name, _source_context, null) - { - } - } - - public class AspBeginEndError : SyntaxError - { - public AspBeginEndError(string _file_name, SourceContext _source_context, string command) - : - base(String.Format(StringResources.Get("ASPBEGINEND_ERROR_IN_DIRECTIVE_{0}"), command), _file_name, _source_context, null) - { - } - } - //end aspects - -} diff --git a/Parsers/PascalABCParser/Preprocessor_2/PABCPreprocessor2Lang.resources b/Parsers/PascalABCParser/Preprocessor_2/PABCPreprocessor2Lang.resources deleted file mode 100644 index a745f9911..000000000 Binary files a/Parsers/PascalABCParser/Preprocessor_2/PABCPreprocessor2Lang.resources and /dev/null differ diff --git a/Parsers/PascalABCParser/Preprocessor_2/PABCPreprocessor2_lrparser.cs b/Parsers/PascalABCParser/Preprocessor_2/PABCPreprocessor2_lrparser.cs deleted file mode 100644 index 836280f15..000000000 --- a/Parsers/PascalABCParser/Preprocessor_2/PABCPreprocessor2_lrparser.cs +++ /dev/null @@ -1,597 +0,0 @@ - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//������ ���� ��������� �������, �� ��������� �������������!!! -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.PascalABCParser.Errors; -using PascalABCCompiler.Preprocessor_2.Errors; -using PascalABCCompiler.ParserTools; -using GoldParser; -using PascalABCCompiler.PascalABCParser; - -namespace PascalABCCompiler.Preprocessor2 -{ -public class GPB_PABCPreprocessor2 : GPBParser -{ - - -public PascalABCCompiler.Preprocessor2.Preprocessor2 prepr; - -private pascalabc_parsertools pascal_parsertools; - -public GPB_PABCPreprocessor2(Stream stream, PascalABCCompiler.Preprocessor2.Preprocessor2 prepr1) - : base(stream) - { - pascal_parsertools = new pascalabc_parsertools(); - parsertools = pascal_parsertools; - - prepr = prepr1; - } - - public GPB_PABCPreprocessor2(Stream stream, GoldParser.Grammar grammar, PascalABCCompiler.Preprocessor2.Preprocessor2 prepr1) - : base(grammar) - { - pascal_parsertools = new pascalabc_parsertools(); - parsertools = pascal_parsertools; - - prepr = prepr1; - } - - public object Parse(string source) - { - LRParser = new Parser(new StringReader(source), LanguageGrammar); - parsertools.parser = LRParser; - LRParser.TrimReductions = true; - try - { - while (true) - { - switch (LRParser.Parse()) - { - case ParseMessage.LexicalError: - errors.Add(new TokenReadError(this)); - LRParser.PopInputToken(); - if (errors.Count > max_errors) - return null; - break; - - case ParseMessage.SyntaxError: - if ((LRParser.TokenSyntaxNode as syntax_tree_node) != null) - prev_node = LRParser.TokenSyntaxNode; - Error er = new PABCNETUnexpectedToken(this); - Symbol sym = LRParser.PopInputToken(); - if (sym.SymbolType == SymbolType.End && errors.Count > 0) - return null; - errors.Add(er); - if (errors.Count > max_errors) - return null; - break; - case ParseMessage.Reduction: - LRParser.TokenSyntaxNode = CreateNonTerminalObject(); - break; - - case ParseMessage.Accept: - return LRParser.TokenSyntaxNode; - - case ParseMessage.TokenRead: - LRParser.TokenSyntaxNode = CreateTerminalObject(); - break; - - case ParseMessage.InternalError: - errors.Add(new CompilerInternalError("PABCPreprocessor2", new Exception("ParseMessage.InternalError"))); - return null; - - case ParseMessage.NotLoadedError: - errors.Add(new CompilerInternalError("PABCPreprocessor2", new Exception("ParseMessage.NotLoadedError"))); - return null; - - case ParseMessage.CommentError: - errors.Add(new UnexpectedToken(this, "(EOF)")); - return null; - - case ParseMessage.CommentBlockRead: - { - SourceContext sc1 = parsertools.GetTokenSourceContext(this.LRParser); - string comment = this.LRParser.CommentText; - SourceContext sc2 = new SourceContext(sc1, parsertools.GetTokenSourceContext(this.LRParser)); - if (comment[0] == '{' && comment[1] == '$') - prepr.Errors.Add(new SyntaxErrorInDirective(prepr.CurrentFileName, sc2, comment)); - //if (prepr.sm.AllowWrite()) - //prepr.WriteToThread(sc2, comment.Replace(Environment.NewLine, " ")); - //prepr.WriteToStream(sc2, comment.Replace("\r\n", " ")); - } - break; - - case ParseMessage.CommentLineRead: - { - SourceContext sc1 = parsertools.GetTokenSourceContext(this.LRParser); - string comment = this.LRParser.CommentText; - SourceContext sc2 = new SourceContext(sc1, sc1); - if (prepr.sm.AllowWrite()) - prepr.WriteToStream(sc1, comment.Replace("\r\n", " ")); - //prepr.WriteToStream(sc1, comment); - } - break; - } - } - } - catch (GoldParser.UnexpectedEOFinParseCommentBlock) - { - throw new TokenReadError(this); - } - catch (Exception e) - { - if (errors.Count > 0) - return null; - else - throw; - } - - } - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//SymbolConstants -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public enum SymbolConstants : int -{ - SYMBOL_EOF = 0, // (EOF) - SYMBOL_ERROR = 1, // (Error) - SYMBOL_WHITESPACE = 2, // (Whitespace) - SYMBOL_COMMENTEND = 3, // (Comment End) - SYMBOL_COMMENTLINE = 4, // (Comment Line) - SYMBOL_COMMENTSTART = 5, // (Comment Start) - SYMBOL_TK_AP = 6, // 'TK_AP' - SYMBOL_TK_DIRECTIVE = 7, // 'TK_DIRECTIVE' - SYMBOL_TK_KAV = 8, // 'TK_KAV' - SYMBOL_TK_NEWLINE = 9, // 'TK_NEWLINE' - SYMBOL_TK_PROGRAM_LINE = 10, // 'TK_PROGRAM_LINE' - SYMBOL_TK_SLASH = 11, // 'TK_SLASH' - SYMBOL_TK_SLASHEKV = 12, // 'TK_SLASHEKV' - SYMBOL__PREPROCESSOR_LEXEMS = 13, // <_preprocessor_lexems> - SYMBOL_EMPTY = 14, // - SYMBOL_PREPROCESSOR_LEXEM = 15, // - SYMBOL_PREPROCESSOR_LEXEMS = 16, // - SYMBOL_PREPROCESSOR_PROGRAM = 17 // -}; - - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//RuleConstants -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public enum RuleConstants : int -{ - RULE_PREPROCESSOR_PROGRAM = 0, // ::= - RULE_PREPROCESSOR_LEXEMS = 1, // ::= <_preprocessor_lexems> - RULE_PREPROCESSOR_LEXEMS2 = 2, // ::= - RULE__PREPROCESSOR_LEXEMS = 3, // <_preprocessor_lexems> ::= - RULE__PREPROCESSOR_LEXEMS2 = 4, // <_preprocessor_lexems> ::= - RULE_PREPROCESSOR_LEXEM_TK_NEWLINE = 5, // ::= 'TK_NEWLINE' - RULE_PREPROCESSOR_LEXEM_TK_SLASH = 6, // ::= 'TK_SLASH' - RULE_PREPROCESSOR_LEXEM_TK_SLASHEKV = 7, // ::= 'TK_SLASHEKV' - RULE_PREPROCESSOR_LEXEM_TK_AP = 8, // ::= 'TK_AP' - RULE_PREPROCESSOR_LEXEM_TK_KAV = 9, // ::= 'TK_KAV' - RULE_PREPROCESSOR_LEXEM_TK_PROGRAM_LINE = 10, // ::= 'TK_PROGRAM_LINE' - RULE_PREPROCESSOR_LEXEM_TK_DIRECTIVE = 11, // ::= 'TK_DIRECTIVE' - RULE_EMPTY = 12 // ::= -}; - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -private Object CreateTerminalObject() -{ -switch ((SymbolConstants)LRParser.TokenSymbol.Index) -{ - case SymbolConstants.SYMBOL_EOF : - //(EOF) - //TERMINAL:EOF - return null; - //ENDTERMINAL - case SymbolConstants.SYMBOL_ERROR : - //(Error) - //TERMINAL:Error - return null; - //ENDTERMINAL - case SymbolConstants.SYMBOL_WHITESPACE : - //(Whitespace) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Whitespace' return NULL! \n\r");*/return null; - case SymbolConstants.SYMBOL_COMMENTEND : - //(Comment End) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment End' return NULL! \n\r");*/return null; - case SymbolConstants.SYMBOL_COMMENTLINE : - //(Comment Line) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment Line' return NULL! \n\r");*/return null; - case SymbolConstants.SYMBOL_COMMENTSTART : - //(Comment Start) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment Start' return NULL! \n\r");*/return null; - case SymbolConstants.SYMBOL_TK_AP : - //'TK_AP' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - case SymbolConstants.SYMBOL_TK_DIRECTIVE : - //'TK_DIRECTIVE' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - case SymbolConstants.SYMBOL_TK_KAV : - //'TK_KAV' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - case SymbolConstants.SYMBOL_TK_NEWLINE : - //'TK_NEWLINE' - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'TK_NEWLINE' return NULL! \n\r");*/return null; - case SymbolConstants.SYMBOL_TK_PROGRAM_LINE : - //'TK_PROGRAM_LINE' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - case SymbolConstants.SYMBOL_TK_SLASH : - //'TK_SLASH' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - case SymbolConstants.SYMBOL_TK_SLASHEKV : - //'TK_SLASHEKV' - { - token_info _token_info = new token_info(LRParser.TokenText); - _token_info.source_context = parsertools.GetTokenSourceContext(); - - return _token_info; - } - case SymbolConstants.SYMBOL__PREPROCESSOR_LEXEMS : - //<_preprocessor_lexems> - //TERMINAL:_preprocessor_lexems - return null; - //ENDTERMINAL - case SymbolConstants.SYMBOL_EMPTY : - // - //TERMINAL:empty - return null; - //ENDTERMINAL - case SymbolConstants.SYMBOL_PREPROCESSOR_LEXEM : - // - //TERMINAL:preprocessor_lexem - return null; - //ENDTERMINAL - case SymbolConstants.SYMBOL_PREPROCESSOR_LEXEMS : - // - //TERMINAL:preprocessor_lexems - return null; - //ENDTERMINAL - case SymbolConstants.SYMBOL_PREPROCESSOR_PROGRAM : - // - //TERMINAL:preprocessor_program - return null; - //ENDTERMINAL -} -throw new SymbolException("Unknown symbol"); -} - - - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateNonTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public Object CreateNonTerminalObject() -{ -switch ((RuleConstants)LRParser.ReductionRule.Index) -{ - case RuleConstants.RULE_PREPROCESSOR_PROGRAM : - // ::= - { - compilation_unit _compilation_unit = new compilation_unit(); - - _compilation_unit.Language = LanguageId.PascalABCNET; - if (LRParser.GetReductionSyntaxNode(0) != null) - { - parsertools.create_source_context(_compilation_unit, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - CompilerDirectives.AddRange(((compiler_directive_list)LRParser.GetReductionSyntaxNode(0)).directives); - if (CompilerDirectives.Count != 0) - prepr.CompilerDirectives.AddRange(CompilerDirectives); - } - - return _compilation_unit; - } - case RuleConstants.RULE_PREPROCESSOR_LEXEMS : - // ::= <_preprocessor_lexems> - return LRParser.GetReductionSyntaxNode(0); - case RuleConstants.RULE_PREPROCESSOR_LEXEMS2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case RuleConstants.RULE__PREPROCESSOR_LEXEMS : - //<_preprocessor_lexems> ::= - { - compiler_directive_list _compiler_directive_list = new compiler_directive_list(); - - if (LRParser.GetReductionSyntaxNode(0) is compiler_directive) - _compiler_directive_list.directives.Add((compiler_directive)LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_compiler_directive_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(0)); - return _compiler_directive_list; - } - case RuleConstants.RULE__PREPROCESSOR_LEXEMS2 : - //<_preprocessor_lexems> ::= - { - compiler_directive_list _compiler_directive_list = (compiler_directive_list)LRParser.GetReductionSyntaxNode(0); - if (LRParser.GetReductionSyntaxNode(1) is compiler_directive) - _compiler_directive_list.directives.Add((compiler_directive)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_compiler_directive_list, LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(1)); - return _compiler_directive_list; - } - case RuleConstants.RULE_PREPROCESSOR_LEXEM_TK_NEWLINE : - // ::= 'TK_NEWLINE' - return LRParser.GetReductionSyntaxNode(0); - case RuleConstants.RULE_PREPROCESSOR_LEXEM_TK_SLASH : - // ::= 'TK_SLASH' - { - if (prepr.sm.AllowWrite()) - prepr.WriteToStream(((token_info)LRParser.GetReductionSyntaxNode(0)).source_context, ((token_info)LRParser.GetReductionSyntaxNode(0)).text); - return LRParser.GetReductionSyntaxNode(0); - } - case RuleConstants.RULE_PREPROCESSOR_LEXEM_TK_SLASHEKV : - // ::= 'TK_SLASHEKV' - { - if (prepr.sm.AllowWrite()) - prepr.WriteToStream(((token_info)LRParser.GetReductionSyntaxNode(0)).source_context, ((token_info)LRParser.GetReductionSyntaxNode(0)).text); - return LRParser.GetReductionSyntaxNode(0); - } - case RuleConstants.RULE_PREPROCESSOR_LEXEM_TK_AP : - // ::= 'TK_AP' - { - if (prepr.sm.AllowWrite()) - prepr.WriteToStream(((token_info)LRParser.GetReductionSyntaxNode(0)).source_context, ((token_info)LRParser.GetReductionSyntaxNode(0)).text); - return LRParser.GetReductionSyntaxNode(0); - } - case RuleConstants.RULE_PREPROCESSOR_LEXEM_TK_KAV : - // ::= 'TK_KAV' - { - if (prepr.sm.AllowWrite()) - prepr.WriteToStream(((token_info)LRParser.GetReductionSyntaxNode(0)).source_context, ((token_info)LRParser.GetReductionSyntaxNode(0)).text); - return LRParser.GetReductionSyntaxNode(0); - } - case RuleConstants.RULE_PREPROCESSOR_LEXEM_TK_PROGRAM_LINE : - // ::= 'TK_PROGRAM_LINE' - { - if (prepr.sm.AllowWrite()) - prepr.WriteToStream(((token_info)LRParser.GetReductionSyntaxNode(0)).source_context, ((token_info)LRParser.GetReductionSyntaxNode(0)).text); - return LRParser.GetReductionSyntaxNode(0); - } - case RuleConstants.RULE_PREPROCESSOR_LEXEM_TK_DIRECTIVE : - // ::= 'TK_DIRECTIVE' - { - bool inline = ( ((token_info)LRParser.GetReductionSyntaxNode(0)).source_context.begin_position.line_num - ((token_info)LRParser.GetReductionSyntaxNode(0)).source_context.end_position.line_num == 0 ); - string token_text = ((token_info)LRParser.GetReductionSyntaxNode(0)).text; - - if (token_text[1] == '$' && inline) - { - compiler_directive _compiler_directive = (compiler_directive)pascal_parsertools.MakeDirective((token_info)LRParser.GetReductionSyntaxNode(0)); - _compiler_directive.source_context.FileName = prepr.CurrentFileName; - prepr.CurrentFileName = _compiler_directive.source_context.FileName; - - //INCLUDE - if (_compiler_directive.Name.text == prepr.INCLUDE) - { - if (prepr.sm.AllowWrite()) - { - string IncludeFileName = _compiler_directive.Directive.text; - if (prepr.ProcessedFileNames.Contains(IncludeFileName) || Path.GetFileName(prepr.CurrentFileName) == Path.GetFileName(IncludeFileName)) - { - prepr.Errors.Add(new CircularInclude(prepr.CurrentFileName, _compiler_directive.source_context, null, IncludeFileName)); - } - else - { - if (!(bool)prepr.SourceFilesProvider(IncludeFileName, SourceFileOperation.Exists)) - prepr.Errors.Add(new IncludeFileNotFound(prepr.CurrentFileName, _compiler_directive.source_context, null, IncludeFileName)); - string b = prepr.CurrentFileName; - //string t = prepr.SourceText; - //string[] sl = prepr.SourceLines; - prepr.ProcessFile(IncludeFileName); - prepr.CurrentFileName = b; - //prepr.SourceText = t; - //prepr.SourceLines = sl; - prepr.ProcessedFileNames.Remove(IncludeFileName); - } - } - return _compiler_directive; - } - //DEFINE - if (_compiler_directive.Name.text == prepr.DEFINE) - { - if (prepr.sm.AllowWrite()) - { - string directive = _compiler_directive.Directive.text; - string name = prepr.getFirstIdent(directive); - string text = prepr.getSecondIdent(directive); - prepr.AddDefineDirective(name, text, _compiler_directive); - } - return _compiler_directive; - } - //UNDEF - if (_compiler_directive.Name.text == prepr.UNDEF) - { - if (prepr.sm.AllowWrite()) - { - string directive = _compiler_directive.Directive.text; - string name = prepr.getFirstIdent(directive); - if (name != null) - if (prepr.DefineDirectiveDefinded(name)) - prepr.DeleteDefineDirective(name, _compiler_directive); - } - return _compiler_directive; - } - //IFDEF - if (_compiler_directive.Name.text == prepr.IFDEF) - { - string directive = _compiler_directive.Directive.text; - if (prepr.sm.AllowWrite()) - { - - if (directive != null) - { - if (!prepr.DefineDirectiveDefinded(directive)) - prepr.sm.ChangeState(false, 1); - else - prepr.sm.ChangeState(true, 1); - } - - } - else - prepr.sm.ChangeState(false, -1); - return _compiler_directive; - } - //IFNDEF - if (_compiler_directive.Name.text == prepr.IFNDEF) - { - string directive = _compiler_directive.Directive.text; - if (prepr.sm.AllowWrite()) - { - - if (directive != null) - { - if (prepr.DefineDirectiveDefinded(directive)) - prepr.sm.ChangeState(false, 1); - else - prepr.sm.ChangeState(true, 1); - } - - } - else - prepr.sm.ChangeState(false, -1); - return _compiler_directive; - } - //ELSE - if (_compiler_directive.Name.text == prepr.ELSE) - { - if (prepr.sm.GetEndifCount() == 0 || prepr.sm.AllowElse() == false) - { - prepr.Errors.Add(new UnexpectedElse(prepr.CurrentFileName, _compiler_directive.source_context)); - } - else - { - if (prepr.sm.AllowWrite()) - prepr.sm.ChangeState(false, false); - else - { - if (prepr.sm.LastCondition() == 1) - prepr.sm.ChangeState(true, false); - else - prepr.sm.ChangeState(false, false); - } - } - return _compiler_directive; - } - //ENDIF - if (_compiler_directive.Name.text == prepr.ENDIF) - { - if (prepr.sm.GetEndifCount() == 0) - { - prepr.Errors.Add(new UnexpectedEndif(prepr.CurrentFileName, _compiler_directive.source_context)); - } - else - { - if (prepr.sm.AllowWrite()) - prepr.sm.ChangeState(true, true); - else - { - if (prepr.sm.LastEndifCondition() == 1) - prepr.sm.ChangeState(true, true); - else - prepr.sm.ChangeState(false, true); - } - } - return _compiler_directive; - } - return _compiler_directive; - } - return LRParser.GetReductionSyntaxNode(0); - } - case RuleConstants.RULE_EMPTY : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL -} -throw new RuleException("Unknown rule"); -} - - - - - - -} -} diff --git a/Parsers/PascalABCParser/Preprocessor_2/Parser.cs b/Parsers/PascalABCParser/Preprocessor_2/Parser.cs deleted file mode 100644 index 05dcfb450..000000000 --- a/Parsers/PascalABCParser/Preprocessor_2/Parser.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System; -using System.IO; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.SyntaxTree; -using System.Resources; -using System.Reflection; -using PascalABCCompiler.Parsers; -using System.Collections.Generic; -using PascalABCCompiler.Errors; - - -namespace PascalABCCompiler.Preprocessor2 -{ - - public class PascalPreprocessor2LanguageParser:IParser - { - public GPB_PABCPreprocessor2 parser; - - public PascalPreprocessor2LanguageParser() - { - this.filesExtensions = new string[1]; - this.filesExtensions[0] = ".paspr2" + Parsers.Controller.HideParserExtensionPostfixChar; - parser = null; - } - - string[] filesExtensions; - public string[] FilesExtensions - { - get - { - return filesExtensions; - } - } - - ILanguageInformation lnginf = new DefaultLanguageInformation(); - public ILanguageInformation LanguageInformation { - get { - return lnginf; - } - } - - public bool CaseSensitive - { - get - { - return parser.LanguageGrammar.CaseSensitive; - } - } - - public Keyword[] Keywords - { - get - { - return new Keyword[0]; - } - } - - public List compilerDirectives = new List(); - public List CompilerDirectives - { - get - { - return compilerDirectives; - } - } - - List errors = new List(); - public List Errors - { - get - { - return errors; - } - set - { - errors = value; - } - } - - private Stream grammar_stream = null; - public void Reset() - { - grammar_stream = CGTResourceExtractor.Extract(new ResourceManager("PascalABCParser.Preprocessor_2.PABCPreprocessor2Lang", Assembly.GetExecutingAssembly()), "PABCPreprocessor2Language"); - parser = new GPB_PABCPreprocessor2(grammar_stream,null); - - max_errors = 5; - } - public virtual int max_errors - { - get - { - return parser.max_errors; - } - set - { - parser.max_errors=value; - } - } - - SourceFilesProviderDelegate sourceFilesProvider = null; - public SourceFilesProviderDelegate SourceFilesProvider - { - get - { - return sourceFilesProvider; - } - set - { - sourceFilesProvider = value; - } - } - - public syntax_tree_node BuildTree(string FileName, string Text, ParseMode parseMode) - { - if (this.parser == null) - Reset(); - GPB_PABCPreprocessor2 parser = new GPB_PABCPreprocessor2(this.grammar_stream, this.parser.LanguageGrammar, this.parser.prepr); - parser.errors = Errors; - parser.current_file_name = FileName; - compilerDirectives = new List(); - parser.CompilerDirectives = compilerDirectives; - switch (parseMode) - { - case ParseMode.Expression: - case ParseMode.Statement: - return null; - } - syntax_tree_node cu = (syntax_tree_node)parser.Parse(Text); - if (cu != null && cu is compilation_unit) - { - (cu as compilation_unit).file_name = FileName; - (cu as compilation_unit).compiler_directives = compilerDirectives; - } - return cu; - } - - public string Name - { - get - { - return "PABCPreprocessor2"; - } - } - public string Version - { - get - { - return "0.1"; - } - } - public string Copyright - { - get - { - return "(c) Зарубин М.Ð�. 2009"; - } - } - public override string ToString() - { - return "PABCPreprocessor2 v0.1"; - } - public IPreprocessor Preprocessor - { - get - { - return null; - } - } - - } - - -} diff --git a/Parsers/PascalABCParser/Preprocessor_2/Preprocessor2.cs b/Parsers/PascalABCParser/Preprocessor_2/Preprocessor2.cs deleted file mode 100644 index e74833876..000000000 --- a/Parsers/PascalABCParser/Preprocessor_2/Preprocessor2.cs +++ /dev/null @@ -1,620 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using PascalABCCompiler; -using PascalABCCompiler.Errors; -using PascalABCCompiler.Preprocessor_2.Errors; -using System.IO; -using PascalABCCompiler.SyntaxTree; -using System.Text.RegularExpressions; -using PascalABCCompiler.ParserTools; -using PascalABCCompiler.Parsers; -using PascalABCCompiler.Preprocessor_2; - -namespace PascalABCCompiler.Preprocessor2 -{ - - public class Preprocessor2 : IPreprocessor - { - public string DEFINE = "define"; - public string UNDEF = "undef"; - public string INCLUDE = "include"; - public string IFDEF = "ifdef"; - public string IFNDEF = "ifndef"; - public string ENDIF = "endif"; - public string ELSE = "else"; - public string ASP = "asp"; - public string ENDASP = "endasp"; - public string ASPDATA = "aspdata"; - - PascalABCCompiler.Preprocessor2.PascalPreprocessor2LanguageParser preprocessor_parser = new PascalPreprocessor2LanguageParser(); - public StatesManager sm = new StatesManager(); - public List Directives = new List(); - public SourceContextMap SourceContextMap; - public TextWriter tw; - //public string SourceText; - //public string[] SourceLines; - public int CurrentLineNumber = 1; - public int Position = 0; - public List Errors; - public string CurrentFileName; - public List ProcessedFileNames = new List(); - - Dictionary DefineDirectives = new Dictionary(); - - //Aspects - public string CurrentAspectDirective = ""; - public bool InAspect = false; - public Dictionary AspectsMap = new Dictionary(); - public List AspectsNames = new List(); - //------- - - public int newLineLength = Environment.NewLine.Length; - - SourceFilesProviderDelegate sourceFilesProvider; - public SourceFilesProviderDelegate SourceFilesProvider - { - get - { - return sourceFilesProvider; - } - set - { - sourceFilesProvider = value; - } - } - - List compilerDirectives = null; - public List CompilerDirectives - { - get - { - return compilerDirectives; - } - } - - - public void AddDefineDirective(string name, string text, compiler_directive _compiler_directive) - { - if (!DefineDirectives.ContainsKey(name)) - { - DefineDirectives.Add(name, text); - } - else - { - Errors.Add(new NameDefineError(name, CurrentFileName, _compiler_directive.source_context)); - } - } - - public void DeleteDefineDirective(string name, compiler_directive _compiler_directive) - { - if (name != null) - { - if (DefineDirectives.ContainsKey(name)) - { - DefineDirectives.Remove(name); - } - else - { - Errors.Add(new NameUndefError(name, CurrentFileName, _compiler_directive.source_context)); - } - } - } - - public bool DefineDirectiveDefinded(string name) - { - return DefineDirectives.ContainsKey(name); - } - - public string getFirstIdent(string s) - { - s.Trim(); - int n = s.IndexOf(' '); - if (n > 0) - return s.Substring(0, s.IndexOf(' ')); - else - return s; - } - - public string getSecondIdent(string s) - { - string s1 = getFirstIdent(s); - return s.Substring(s1.Length, s.Length - s1.Length).Trim(); - } - - public Preprocessor2(SourceFilesProviderDelegate sourceFilesProvider) - { - this.sourceFilesProvider = sourceFilesProvider; - this.sm.Reset(); - } - - public string Build(string[] fileNames, List errors, SourceContextMap sourceContextMap) - { - compilerDirectives = new List(); - StringWriter sw = new StringWriter(); - tw = sw; - Errors = errors; - SourceContextMap = sourceContextMap; - //AspectsMap.Clear(); - ProcessedFileNames.Clear(); - DefineDirectives.Clear(); - foreach (string name in fileNames) - { - ProcessFile(name); - if (sm.GetEndifCount() != 0) - Errors.Add(new UnexpectedEOF(CurrentFileName, new SourceContext(int.MaxValue, 1, int.MaxValue, 1))); - if (errors.Count > 0) - return null; - } - return sw.ToString(); - } - - //Aspects - public string GetAspects(List cd_list, SourceContextMap sourceContextMap) - { - try - { - compilerDirectives = new List(cd_list); - //AspectsMap.Clear(); - - //GetStructures - foreach (compiler_directive cd in compilerDirectives) - { - if (cd.Name.text == ASP) - { - if (!(AspectsNames.Contains(cd.Directive.text))) - //if (!(AspectsMap.ContainsKey(cd.Directive.text))) - { - AspectsNames.Add(cd.Directive.text); - AspectsMap.Add(cd.Directive.text, new Aspect(cd.Directive.text)); - AspectsMap[cd.Directive.text].AddBegin(cd.source_context); - } - else - AspectsMap[cd.Directive.text].AddBegin(cd.source_context); - } - //if (cd.Name.text == ) - } - foreach (compiler_directive cd in compilerDirectives) - { - if (cd.Name.text == ENDASP) - { - if (!AspectsNames.Contains(cd.Directive.text)) - { - //Error - unexp end of aspect - } - else - AspectsMap[cd.Directive.text].AddEnd(cd.source_context); - //AspectsMap.Add(cd.Directive.text, new Aspect(cd.Directive.text, false, cd.source_context)); - } - } - //Get Text - StringWriter sw = new StringWriter(); - //SourceContextMap = sourceContextMap; - List beg; - List end; - string CurrentFileName; - string CurrentFileText; - - foreach (string str in AspectsMap.Keys) - { - beg = AspectsMap[str].GetBeginList(); - end = AspectsMap[str].GetEndList(); - - for (int i = 0; i < beg.Count; i++) - { - CurrentFileName = beg[i].FileName; - CurrentFileText = (string)SourceFilesProvider(CurrentFileName, SourceFileOperation.GetText); - sw.WriteLine(CurrentFileText.Substring(beg[i].Position, end[i].Position - beg[i].Position + end[i].Length)); - } - //AspectsMap[str].GetBeginList(); - } - return sw.ToString(); - } - catch (Exception e) - { - this.Errors.Add(new PascalABCCompiler.Errors.Error("Error in aspects reading")); - return "Error in aspects reading"; - } - } - - public string WriteAspects(string aspects, string proj) - { - - StringWriter sw = new StringWriter(); - List beg; - List end; - string CurrentAspectText; - string CurrentFileText; - string CurrentFileName; - string CurrentPath; - if (proj != "") - CurrentPath = proj + "\\"; - else - CurrentPath = ""; - - foreach (string str in AspectsMap.Keys) - { - beg = AspectsMap[str].GetBeginList(); - end = AspectsMap[str].GetEndList(); - int asp_num = 0; - int asp_num_file = 0; - string asp_file_name = CurrentPath + beg[0].FileName; - for (int i = 0; i < beg.Count; i++) - { - ///Files names & asp_num? - CurrentFileName = CurrentPath + beg[i].FileName; - CurrentFileText = (string)SourceFilesProvider(CurrentFileName, SourceFileOperation.GetText); - if (asp_file_name != CurrentFileName) - { - asp_num_file = 0; - asp_file_name = CurrentFileName; - } - if (aspects.IndexOf("{$asp " + str + "}", asp_num)>=0) - { - CurrentAspectText = aspects.Substring(aspects.IndexOf("{$asp " + str + "}", asp_num), aspects.IndexOf("{$endasp " + str + "}", asp_num) - aspects.IndexOf("{$asp " + str + "}", asp_num) + ("{$endasp " + str + "}").Length); - asp_num = aspects.IndexOf("{$endasp " + str + "}", asp_num) + ("{$endasp " + str + "}").Length; - - int d = CurrentFileText.IndexOf("{$asp " + str + "}", asp_num_file); - int c = CurrentFileText.IndexOf("{$endasp " + str + "}", asp_num_file); - if (d >= 0 && c >= 0) - { - CurrentFileText = CurrentFileText.Substring(0, asp_num_file) + CurrentFileText.Substring(asp_num_file, d - asp_num_file) + CurrentAspectText + CurrentFileText.Substring(c + ("{$endasp " + str + "}").Length); - - c = d + CurrentAspectText.Length; - - asp_num_file = c + ("{$endasp " + str + "}").Length; ; - } - else - break; - - StreamWriter swrt = new StreamWriter(Path.GetDirectoryName(CurrentFileName) + "\\" + Path.GetFileNameWithoutExtension(CurrentFileName) + ".pas", false, Encoding.UTF8); - swrt.Write(CurrentFileText); - swrt.Close(); - } - } - } - return sw.ToString(); - } - - public string WriteAspect(string aspects, string proj, string str) - { - - StringWriter sw = new StringWriter(); - List beg; - List end; - string CurrentAspectText; - string CurrentFileText; - string CurrentFileName; - string CurrentPath; - if (proj != "") - CurrentPath = proj + "\\"; - else - CurrentPath = ""; - - beg = AspectsMap[str].GetBeginList(); - end = AspectsMap[str].GetEndList(); - int asp_num = 0; - int asp_num_file = 0; - string asp_file_name = CurrentPath + beg[0].FileName; - for (int i = 0; i < beg.Count; i++) - { - CurrentFileName = CurrentPath + beg[i].FileName; - CurrentFileText = (string)SourceFilesProvider(CurrentFileName, SourceFileOperation.GetText); - if (asp_file_name != CurrentFileName) - { - asp_num_file = 0; - asp_file_name = CurrentFileName; - } - if (aspects.IndexOf("{$asp " + str + "}", asp_num) >= 0) - { - CurrentAspectText = aspects.Substring(aspects.IndexOf("{$asp " + str + "}", asp_num), aspects.IndexOf("{$endasp " + str + "}", asp_num) - aspects.IndexOf("{$asp " + str + "}", asp_num) + ("{$endasp " + str + "}").Length); - asp_num = aspects.IndexOf("{$endasp " + str + "}", asp_num) + ("{$endasp " + str + "}").Length; - - int d = CurrentFileText.IndexOf("{$asp " + str + "}", asp_num_file); - int c = CurrentFileText.IndexOf("{$endasp " + str + "}", asp_num_file); - if (d >= 0 && c >= 0) - { - CurrentFileText = CurrentFileText.Substring(0, asp_num_file) + CurrentFileText.Substring(asp_num_file, d - asp_num_file) + CurrentAspectText + CurrentFileText.Substring(c + ("{$endasp " + str + "}").Length); - - c = d + CurrentAspectText.Length; - - asp_num_file = c + ("{$endasp " + str + "}").Length; - } - else - { - break; - } - StreamWriter swrt = new StreamWriter(Path.GetDirectoryName(CurrentFileName) + "\\" + Path.GetFileNameWithoutExtension(CurrentFileName) + ".pas", false, Encoding.UTF8); - swrt.Write(CurrentFileText); - swrt.Close(); - } - } - - return sw.ToString(); - } - - //end aspects - - public void ProcessFile(string FileName) - { - ProcessedFileNames.Add(Path.GetFileName(FileName)); - string Text = (string)SourceFilesProvider(FileName, SourceFileOperation.GetText); - CurrentFileName = FileName; - //SourceText = Text; - //string[] s ={ "\r\n" }; - //SourceLines = Text.Split(s, StringSplitOptions.None); - preprocessor_parser.Reset(); - preprocessor_parser.Errors = Errors; - preprocessor_parser.parser.prepr = this; - compilation_unit cu = preprocessor_parser.BuildTree(FileName, Text, PascalABCCompiler.Parsers.ParseMode.Normal) as compilation_unit; - CurrentFileName = FileName; - - //if (cu.compiler_directives.Count != 0) - // CompilerDirectives.AddRange(cu.compiler_directives); - - ProcessedFileNames.Remove(FileName); - } - - /* - public void WriteToStream(int line1, int line2) - { - int startl = 1; - int endl = SourceLines.Length; - if (line1 >= 0) - startl = line1; - if (line2 >= 0) - endl = line2; - if (endl - startl < 0) - return; - int Length = 0; - for (int i = startl; i <= endl; i++) - { - tw.WriteLine(SourceLines[i - 1]); - Length += SourceLines[i - 1].Length + newLineLength; - } - SourceContext nsc = new SourceContext(CurrentLineNumber, 1, CurrentLineNumber + endl - startl, int.MaxValue, Position, Position + Length); - SourceContext rsc = new SourceContext(startl, 1, endl, int.MaxValue); - rsc.FileName = CurrentFileName; - SourceContextMap.AddArea(nsc, rsc); - CurrentLineNumber += endl - startl + 1; - Position += Length; - } - - public void WriteToStream(int line1, int line2, int col1, int col2) - { - int startl = 1; - int endl = SourceLines.Length; - if (line1 >= 0) - startl = line1; - if (line2 >= 0) - endl = line2; - if (endl - startl < 0) - return; - int Length = 0; - for (int i = startl; i <= endl; i++) - { - string s = (SourceLines[i - 1]).Substring(col1 - 1, col2 - col1 + 1); - Length += s.Length + newLineLength; - } - SourceContext nsc = new SourceContext(CurrentLineNumber, col1 - 1, CurrentLineNumber + endl - startl, int.MaxValue, Position, Position + Length); - SourceContext rsc = new SourceContext(startl, 1, endl, int.MaxValue); - rsc.FileName = CurrentFileName; - SourceContextMap.AddArea(nsc, rsc); - CurrentLineNumber += endl - startl + 1; - Position += Length; - } - */ - - public void WriteToStream(SourceContext sc, string text) - { - tw.WriteLine(text); - sc.FileName = CurrentFileName; - SourceContextMap.AddArea(new SourceContext(CurrentLineNumber, 1, CurrentLineNumber + sc.end_position.line_num - sc.begin_position.line_num, sc.end_position.column_num, Position, Position + text.Length), sc); - CurrentLineNumber += 1;// sc.end_position.line_num - sc.begin_position.line_num + 1; - Position += text.Length; - - } - - } - - public class StatesManager - { - private Stack if_stack; - private Stack endif_stack; - bool allow_write; - bool allow_else; - - public StatesManager() - { - allow_write = true; - allow_else = false; - if_stack = new Stack(); - endif_stack = new Stack(); - } - - public void Reset() - { - allow_write = true; - if_stack.Clear(); - endif_stack.Clear(); - } - - public void AddCondition(int i) - { - allow_else = true; - if_stack.Push(i); - endif_stack.Push(i); - } - - public int GetIfCount() - { - return if_stack.Count; - } - - public int GetEndifCount() - { - return endif_stack.Count; - } - - public int DeleteCondition(bool endif) - { - int i = 0; - if (endif) - { - allow_else = true; - i = endif_stack.Pop(); - } - else - allow_else = false; - if (if_stack.Count != 0) - return if_stack.Pop(); - else - { - //error - return i; - } - } - - public int LastCondition() - { - if (if_stack.Count != 0) - return if_stack.Peek(); - else - return 0; - } - - public int LastEndifCondition() - { - if (endif_stack.Count != 0) - return endif_stack.Peek(); - else - return 0; - } - - public bool AllowWrite() - { - return allow_write; - } - - public bool AllowElse() - { - return allow_else; - } - - public void ChangeState(bool new_mode) - { - allow_write = new_mode; - } - - public void ChangeState(bool new_mode, int new_if) - { - allow_write = new_mode; - AddCondition(new_if); - } - - public void ChangeState(bool new_mode, bool endif) - { - allow_write = new_mode; - int i = DeleteCondition(endif); - // return i; - } - - } - - //Aspects - public class Aspect - { - private string AspName; - private string AspAuthor = "name"; - private string AspVersion = "0.1"; - private List begin_list; - private List end_list; - bool allow_mod; - bool saved_params; - - public Aspect(string name) - { - this.AspName = name; - begin_list = new List(); - end_list = new List(); - allow_mod = true; - } - - public Aspect(string name, string auth, string ver) - { - this.AspName = name; - this.AspAuthor = auth; - this.AspVersion = ver; - begin_list = new List(); - end_list = new List(); - allow_mod = true; - } - - public void AddBegin(SourceContext sc) - { - if (!begin_list.Contains(sc)) - begin_list.Add(sc); - } - - public void AddEnd(SourceContext sc) - { - if (!end_list.Contains(sc)) - end_list.Add(sc); - } - - public bool IsSavedParams - { - set - { - IsSavedParams = value; - } - get - { - return saved_params; - } - } - - public string Author - { - set - { - AspAuthor = value; - } - get - { - return AspAuthor; - } - } - - public string Version - { - set - { - AspVersion = value; - } - get - { - return AspVersion; - } - } - - public List GetBeginList() - { - return new List(begin_list); - } - - public List GetEndList() - { - return new List(end_list); - } - - public void Reset() - { - allow_mod = true; - begin_list.Clear(); - end_list.Clear(); - } - } - //end aspects - -} \ No newline at end of file diff --git a/Parsers/PascalABCParser/Properties/AssemblyInfo.cs b/Parsers/PascalABCParser/Properties/AssemblyInfo.cs deleted file mode 100644 index 2129aacb6..000000000 --- a/Parsers/PascalABCParser/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("PascalABCParser")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("DSS")] -[assembly: AssemblyProduct("PascalABCParser")] -[assembly: AssemblyCopyright("Copyright © DSS 2006-2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("e5788e70-934b-42a9-a652-255b64cf1709")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.6.*")] -[assembly: AssemblyFileVersion("1.6.*")] diff --git a/Parsers/PascalABCParser/pascalabc_lrparser.cs b/Parsers/PascalABCParser/pascalabc_lrparser.cs deleted file mode 100644 index e8706bc3a..000000000 --- a/Parsers/PascalABCParser/pascalabc_lrparser.cs +++ /dev/null @@ -1,422 +0,0 @@ - -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using System.Collections.Generic; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.PascalABCParser.Errors; -using PascalABCCompiler.ParserTools; - -using PascalABCCompiler.Preprocessor2; - -namespace PascalABCCompiler.PascalABCParser -{ - public partial class GPBParser_PascalABC : GPBParser - { - public Preprocessor2.Preprocessor2 prepr; - internal SourceContextMap scm; - public bool build_tree_for_brackets = false; - private Stack NodesStack; - private SyntaxError error; - - Stream GrammarStream; - - public GPBParser_PascalABC(Stream stream, GoldParser.Grammar grammar, Preprocessor2.Preprocessor2 prepr1) - : base(grammar) - { - prepr = prepr1; - - GrammarStream = stream; - parsertools = new pascalabc_parsertools(); - } - - public GPBParser_PascalABC(Stream stream, Preprocessor2.Preprocessor2 prepr1) - : base(stream) - { - prepr = prepr1; - - GrammarStream = stream; - parsertools = new pascalabc_parsertools(); - } - - public object Parse(string source) - { - NodesStack = new Stack(); - LRParser = new GoldParser.Parser(new StringReader(source), LanguageGrammar); - parsertools.parser = LRParser; - LRParser.TrimReductions = true; - try - { - while (true) - { - switch (LRParser.Parse()) - { - case GoldParser.ParseMessage.LexicalError: - errors.Add(new TokenReadError(this)); - LRParser.PopInputToken(); - if (errors.Count >= max_errors) - return null; - break; - - //sdes nugno vesti chtoto vrode steka poslednix oshibok. podumat - case GoldParser.ParseMessage.SyntaxError: - GoldParser.Symbol sym = LRParser.PopInputToken(); - error = new PABCNETUnexpectedToken(this); - //error = new UnexpectedToken(this, parsertools.symbol_collection_to_string(this.LRParser.GetExpectedTokens())); - if (sym.SymbolType == GoldParser.SymbolType.End && errors.Count > 0) - return null; - errors.Add(error); - if (errors.Count >= max_errors) - return null; - break; - case GoldParser.ParseMessage.Reduction: - LRParser.TokenSyntaxNode = CreateNonTerminalObject(LRParser.ReductionRule.Index); - if ((LRParser.TokenSyntaxNode as syntax_tree_node) != null) - prev_node = LRParser.TokenSyntaxNode; - break; - - case GoldParser.ParseMessage.Accept: - return LRParser.TokenSyntaxNode; - - case GoldParser.ParseMessage.TokenRead: - LRParser.TokenSyntaxNode = CreateTerminalObject(LRParser.TokenSymbol.Index); - break; - - case GoldParser.ParseMessage.InternalError: - errors.Add(new CompilerInternalError("PascalABCParser", new Exception("ParseMessage.InternalError"))); - return null; - - case GoldParser.ParseMessage.NotLoadedError: - errors.Add(new CompilerInternalError("PascalABCParser", new Exception("ParseMessage.NotLoadedError"))); - return null; - - case GoldParser.ParseMessage.CommentError: - errors.Add(new UnexpectedToken(this, "(EOF)")); - return null; - - case GoldParser.ParseMessage.CommentBlockRead: - { - /* - compiler_directive cd = new compiler_directive(); - cd.source_context = parsertools.GetTokenSourceContext(this.LRParser); - string comment = this.LRParser.CommentText; - cd.Name = new token_info(comment); - cd.Directive = new token_info(comment); - cd.source_context = new SourceContext(cd.source_context,parsertools.GetTokenSourceContext(this.LRParser)); - if (cd.Directive.text[0] == '{' && cd.Directive.text[1] == '$') - this.errors.Add(new Preprocessor_2.Errors.SyntaxErrorInDirective(cd.source_context.FileName, cd.source_context, cd.Directive.text)); - - this.CompilerDirectives.Add(cd); - */ - - } break; - - case GoldParser.ParseMessage.CommentLineRead: - { - /* - compiler_directive cd = new compiler_directive(); - cd.source_context = parsertools.GetTokenSourceContext(this.LRParser); - string comment = this.LRParser.CommentText; - cd.Name = new token_info(comment); - cd.Directive = new token_info(comment); - cd.source_context = new SourceContext(cd.source_context.begin_position.line_num, cd.source_context.begin_position.column_num, cd.source_context.end_position.line_num, cd.source_context.end_position.column_num + comment.Length - Environment.NewLine.Length); - this.CompilerDirectives.Add(cd); - */ - } break; - - } - } - } - catch (GoldParser.UnexpectedEOFinParseCommentBlock) - { - throw new TokenReadError(this); - } - catch (Exception e) - { - if (errors.Count > 0) - return null; - else - throw; - } - - } - - ////////////////////////////////////tasha_16.04.2010 - /// SSM перенеÑ� из pascalabc_lparser_rules Ñ�юда, Ñ‚.к. Ñ�то partial клаÑ�Ñ�, а та чаÑ�ть генерировалаÑ�ÑŒ автоматичеÑ�ки. Голову отрывать надо - int lambda_num = 0; - List pascalABC_lambda_definitions = new List(); - List pascalABC_var_statements = new List(); - List pascalABC_type_declarations = new List(); - procedure_definition lambda(function_lambda_definition _function_lambda_definition) - { - procedure_definition _func_def = new procedure_definition(); - method_name _method_name1 = new method_name(null,null, new SyntaxTree.ident(_function_lambda_definition.lambda_name), null); - parsertools.create_source_context(_method_name1, _method_name1.meth_name, _method_name1.meth_name); - function_header _function_header1 = new function_header(); - - object rt1 = new object(); - _function_header1.name = _method_name1; - if (_function_header1.name.meth_name is template_type_name) - { - _function_header1.template_args = (_function_header1.name.meth_name as template_type_name).template_args; - ident id = new ident(_function_header1.name.meth_name.name); - parsertools.create_source_context(id, _function_header1.name.meth_name, _function_header1.name.meth_name); - _function_header1.name.meth_name = id; - } - - SyntaxTree.formal_parameters fps = new PascalABCCompiler.SyntaxTree.formal_parameters(); - _function_header1.parameters = _function_lambda_definition.formal_parameters;//fps; - - /*SyntaxTree.named_type_reference _named_type_reference = new SyntaxTree.named_type_reference(); - SyntaxTree.ident idtype = new SyntaxTree.ident("object"); - _named_type_reference.source_context = idtype.source_context; - _named_type_reference.names.Add(idtype); - rt1 = _named_type_reference; - _function_header1.return_type = (SyntaxTree.type_definition)_named_type_reference;*/ - _function_header1.return_type = _function_lambda_definition.return_type; - - _function_header1.of_object = false; - _function_header1.class_keyword = false; - token_info _token_info = new token_info("function"); - _token_info.source_context = parsertools.GetTokenSourceContext(); - parsertools.create_source_context(_function_header1, _token_info, _token_info); - - SyntaxTree.block _block1 = new SyntaxTree.block(null, null); - SyntaxTree.statement_list sl1 = new SyntaxTree.statement_list(); - sl1.subnodes.Add(_function_lambda_definition.proc_body); - _block1.program_code = sl1; - _func_def.proc_header = _function_header1; - _func_def.proc_body = (SyntaxTree.proc_block)_block1; - if (_function_lambda_definition.defs != null) - { - if (((block)_func_def.proc_body).defs == null) - ((block)_func_def.proc_body).defs = new declarations(); - for (int l = 0; l < _function_lambda_definition.defs.Count; l++) - ((block)_func_def.proc_body).defs.defs.Add(_function_lambda_definition.defs[l] as procedure_definition); - } - _function_lambda_definition.proc_definition = _func_def; - parsertools.create_source_context(_func_def, _function_header1, _function_header1); - return _func_def; - } - public function_lambda_definition find_pascalABC_lambda_name(string name) - { - int i = 0; - while (i < pascalABC_lambda_definitions.Count && (pascalABC_lambda_definitions[i] == null || ((function_lambda_definition)pascalABC_lambda_definitions[i]).lambda_name != name)) - i++; - if (i < pascalABC_lambda_definitions.Count) - return (function_lambda_definition)pascalABC_lambda_definitions[i]; - else - return null; - } - public var_def_statement find_var_statements(string name) - { - int i = pascalABC_var_statements.Count - 1; - bool b = false; - while (!b && i >= 0) - { - var_def_statement vds = (var_def_statement)pascalABC_var_statements[i]; - int j = 0; - while (j < vds.vars.idents.Count && - vds.vars.idents[j].name != name) - j++; - if (j < vds.vars.idents.Count) - b = true; - else - i--; - } - if (i >= 0 && i < pascalABC_var_statements.Count && - ((var_def_statement)pascalABC_var_statements[i]).vars_type != null) - return (var_def_statement)pascalABC_var_statements[i]; - else - return null; - } - public ident func_decl_lambda(object lr0, object lr2) - { - statement_list _statement_list = (statement_list)lr2; - expression_list _expression_list = new expression_list(); - ident_list _i_l = new ident_list(); - formal_parameters _formal_parameters = new formal_parameters(); - if (lr0 != null) - { - List ar = (List)lr0; - for (int i = 0; i < ar.Count; i++) - if (ar[i] is ident) - _i_l.idents.Add((ident)ar[i]); - else - _i_l.idents.Add(((var_def_statement)ar[i]).vars.idents[0]); - - for (int i = 0; i < _i_l.idents.Count; i++) - _expression_list.expressions.Add(_i_l.idents[i]); - - for (int i = 0; i < ar.Count; i++) - { - ident_list _ident_list = new ident_list(); - ident id = _i_l.idents[i]; - _ident_list.idents.Add(id); - string name_param = id.name; - typed_parameters _typed_parameters = null; - int k = 0; - { - named_type_reference _named_type_reference = new named_type_reference(); - type_definition t_d = new type_definition(); - if (ar[i] is ident) - { - ident idtype = new ident("object"); - _named_type_reference.names.Add(idtype); - t_d = (type_definition)_named_type_reference; - } - else - { - t_d = ((var_def_statement)ar[i]).vars_type; - } - _typed_parameters = new typed_parameters(_ident_list, t_d, parametr_kind.none, null); - parsertools.create_source_context(_typed_parameters, _ident_list, t_d); - - } - _formal_parameters.params_list.Add(_typed_parameters); - } - } - ////////////////////////// - named_type_reference _named_type_reference1 = new named_type_reference(); - ident idtype1 = new ident("object"); - _named_type_reference1.source_context = idtype1.source_context; - _named_type_reference1.names.Add(idtype1); - ///////////////////////////// - lambda_num++; - function_lambda_definition _procedure_definition = new function_lambda_definition(); - _procedure_definition.formal_parameters = _formal_parameters; - _procedure_definition.return_type = (type_definition)_named_type_reference1; - _procedure_definition.ident_list = _i_l; - _procedure_definition.proc_body = null; - _procedure_definition.parameters = _expression_list; - _procedure_definition.lambda_name = "__lambda__" + lambda_num; - //new function_lambda_definition(_formal_parameters, (type_definition)_named_type_reference1, _i_l, null, _expression_list, "lambda" + lambda_num); - object rt = _i_l; - _procedure_definition.proc_body = _statement_list; - - //////////////////////////////vnutrennie lambda - if (_procedure_definition.defs == null) - _procedure_definition.defs = new List(); - while (pascalABC_lambda_definitions.Count > 0 && pascalABC_lambda_definitions[pascalABC_lambda_definitions.Count - 1] != null) - { - _procedure_definition.defs.Add(lambda((function_lambda_definition)pascalABC_lambda_definitions[pascalABC_lambda_definitions.Count - 1])); - pascalABC_lambda_definitions.RemoveAt(pascalABC_lambda_definitions.Count - 1); - } - if (pascalABC_lambda_definitions.Count > 0 && pascalABC_lambda_definitions[pascalABC_lambda_definitions.Count - 1] == null) - pascalABC_lambda_definitions.RemoveAt(pascalABC_lambda_definitions.Count - 1); - pascalABC_lambda_definitions.Add(_procedure_definition); - /////////////////////////////////////////////// - parsertools.create_source_context(_procedure_definition, _expression_list, rt); - ident _name = new ident(_procedure_definition.lambda_name); - if (lr0 != null) - _name.source_context = _i_l.idents[0].source_context; - return _name; - } - - public List ident_list11(object lr1, object lr3) - { - List ar = (List)lr3; - ar.Insert(0, lr1); - return ar; - } - - public List ident_list12(object lr0) - { - List ar = new List(); - ar.Add(lr0); - return ar; - } - - public List ident_list21(object lr0, object lr2) - { - List ar = (List)lr0; - ar.Add(lr2); - return ar; - } - - public List ident_list13(object lr1, object lr3, object lr5) - { - List ar = (List)lr5; - //named_type_reference n_t_r = (named_type_reference)lr3; - var_def_statement vds = new var_def_statement(); - vds.vars = new ident_list(); - vds.vars.idents.Add((ident)lr1); - vds.vars_type = (type_definition)lr3;//n_t_r; - ar.Insert(0, vds); - return ar; - } - - public List ident_list14(object lr1, object lr3) - { - List ar = new List(); - //named_type_reference n_t_r = (named_type_reference)lr3; - var_def_statement vds = new var_def_statement(); - vds.vars = new ident_list(); - vds.vars.idents.Add((ident)lr1); - vds.vars_type = (type_definition)lr3; - ar.Add(vds); - return ar; - } - - public void add_lambda_to_program_block(block _block) - { - //tasha 16.04.2010 - if (pascalABC_lambda_definitions.Count > 0) - { - if (_block.defs == null) - _block.defs = new declarations(); - for (int i = 0; i < pascalABC_lambda_definitions.Count; i++) - _block.defs.defs.Add(lambda((function_lambda_definition)pascalABC_lambda_definitions[i])); - pascalABC_lambda_definitions.Clear(); - } - } - - public void add_lambda(object lr1, procedure_definition _procedure_definition) - { - if (pascalABC_lambda_definitions.Count > 0)//tasha 16.04.2010 - { - block _block = (block)lr1; - if (_block.defs == null) - _block.defs = new declarations(); - for (int i = 0; i < pascalABC_lambda_definitions.Count; i++) - _block.defs.defs.Add(lambda((function_lambda_definition)pascalABC_lambda_definitions[i])); - pascalABC_lambda_definitions.Clear(); - _procedure_definition.proc_body = (proc_block)_block; - } - else - //////////////////////////tasha 16.04.2010 - _procedure_definition.proc_body = (proc_block)lr1; - } - - public void for_assignment(object lr0, object lr2) - { - if (lr0 is ident && lr2 is ident && ((ident)lr2).name.Contains("__lambda__")) - { - string type_name = ""; - var_def_statement vds = find_var_statements(((ident)lr0).name); - if (vds != null) - type_name = ((named_type_reference)vds.vars_type).names[0].name; - if (type_name != "") - { - int ii = 0; - while (ii < pascalABC_type_declarations.Count && - ((type_declaration)pascalABC_type_declarations[ii]).type_name.name != type_name) - ii++; - if (ii < pascalABC_type_declarations.Count) - { - type_definition td = ((type_declaration)pascalABC_type_declarations[ii]).type_def; - function_lambda_definition fld = find_pascalABC_lambda_name(((ident)lr2).name); - fld.return_type = ((function_header)td).return_type; - for (int k = 0; k < fld.formal_parameters.params_list.Count && k < ((function_header)td).parameters.params_list.Count; k++) - fld.formal_parameters.params_list[k].vars_type = ((function_header)td).parameters.params_list[k].vars_type; - } - pascalABC_var_statements.Remove(vds); - } - } - } - - } - -} diff --git a/Parsers/PascalABCParser/pascalabc_lrparser_rules.cs b/Parsers/PascalABCParser/pascalabc_lrparser_rules.cs deleted file mode 100644 index 850634269..000000000 --- a/Parsers/PascalABCParser/pascalabc_lrparser_rules.cs +++ /dev/null @@ -1,11164 +0,0 @@ - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//������ ���� ��������� �������, �� ��������� �������������!!! -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -using System; -using System.IO; -using System.Runtime.Serialization; -using System.Collections; -using System.Collections.Generic; -using PascalABCCompiler.SyntaxTree; -using PascalABCCompiler.Errors; -using PascalABCCompiler.PascalABCParser.Errors; -using PascalABCCompiler.ParserTools; -using GoldParser; - -namespace PascalABCCompiler.PascalABCParser -{ -public partial class GPBParser_PascalABC : GPBParser -{ - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//SymbolConstants -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public enum SymbolConstants : int -{ - SYMBOL_EOF = 0, // (EOF) - SYMBOL_ERROR = 1, // (Error) - SYMBOL_WHITESPACE = 2, // (Whitespace) - SYMBOL_COMMENTEND = 3, // (Comment End) - SYMBOL_COMMENTLINE = 4, // (Comment Line) - SYMBOL_COMMENTSTART = 5, // (Comment Start) - SYMBOL_TKABSOLUTE = 6, // tkAbsolute - SYMBOL_TKABSTRACT = 7, // tkAbstract - SYMBOL_TKADDRESSOF = 8, // tkAddressOf - SYMBOL_TKAMPERSEND = 9, // tkAmpersend - SYMBOL_TKAND = 10, // tkAnd - SYMBOL_TKARRAY = 11, // tkArray - SYMBOL_TKARROW = 12, // tkArrow - SYMBOL_TKAS = 13, // tkAs - SYMBOL_TKASCIICHAR = 14, // tkAsciiChar - SYMBOL_TKASMBODY = 15, // tkAsmBody - SYMBOL_TKASSEMBLER = 16, // tkAssembler - SYMBOL_TKASSIGN = 17, // tkAssign - SYMBOL_TKAT = 18, // tkAt - SYMBOL_TKAUTOMATED = 19, // tkAutomated - SYMBOL_TKBEGIN = 20, // tkBegin - SYMBOL_TKBOOLEAN = 21, // tkBoolean - SYMBOL_TKBYTE = 22, // tkByte - SYMBOL_TKCARDINAL = 23, // tkCardinal - SYMBOL_TKCASE = 24, // tkCase - SYMBOL_TKCHAR = 25, // tkChar - SYMBOL_TKCLASS = 26, // tkClass - SYMBOL_TKCOLON = 27, // tkColon - SYMBOL_TKCOMMA = 28, // tkComma - SYMBOL_TKCOMP = 29, // tkComp - SYMBOL_TKCONST = 30, // tkConst - SYMBOL_TKCONSTRUCTOR = 31, // tkConstructor - SYMBOL_TKCONTAINS = 32, // tkContains - SYMBOL_TKCSHARPSTYLEOR = 33, // tkCSharpStyleOr - SYMBOL_TKDEFAULT = 34, // tkDefault - SYMBOL_TKDEREF = 35, // tkDeref - SYMBOL_TKDESTRUCTOR = 36, // tkDestructor - SYMBOL_TKDIRECTIVENAME = 37, // tkDirectiveName - SYMBOL_TKDISPID = 38, // tkDispid - SYMBOL_TKDIV = 39, // tkDiv - SYMBOL_TKDIVEQUAL = 40, // tkDivEqual - SYMBOL_TKDO = 41, // tkDo - SYMBOL_TKDOTDOT = 42, // tkDotDot - SYMBOL_TKDOUBLE = 43, // tkDouble - SYMBOL_TKDOWNTO = 44, // tkDownto - SYMBOL_TKELSE = 45, // tkElse - SYMBOL_TKEND = 46, // tkEnd - SYMBOL_TKEQUAL = 47, // tkEqual - SYMBOL_TKERROR = 48, // tkError - SYMBOL_TKEVENT = 49, // tkEvent - SYMBOL_TKEXCEPT = 50, // tkExcept - SYMBOL_TKEXPLICIT = 51, // tkExplicit - SYMBOL_TKEXPORTS = 52, // tkExports - SYMBOL_TKEXTENDED = 53, // tkExtended - SYMBOL_TKEXTERNAL = 54, // tkExternal - SYMBOL_TKFILE = 55, // tkFile - SYMBOL_TKFINAL = 56, // tkFinal - SYMBOL_TKFINALIZATION = 57, // tkFinalization - SYMBOL_TKFINALLY = 58, // tkFinally - SYMBOL_TKFLOAT = 59, // tkFloat - SYMBOL_TKFOR = 60, // tkFor - SYMBOL_TKFOREACH = 61, // tkForeach - SYMBOL_TKFORWARD = 62, // tkForward - SYMBOL_TKFUNCTION = 63, // tkFunction - SYMBOL_TKGOTO = 64, // tkGoto - SYMBOL_TKGREATER = 65, // tkGreater - SYMBOL_TKGREATEREQUAL = 66, // tkGreaterEqual - SYMBOL_TKHEX = 67, // tkHex - SYMBOL_TKIDENTIFIER = 68, // tkIdentifier - SYMBOL_TKIF = 69, // tkIf - SYMBOL_TKILCODE = 70, // tkILCode - SYMBOL_TKIMPLEMENTATION = 71, // tkImplementation - SYMBOL_TKIMPLEMENTS = 72, // tkImplements - SYMBOL_TKIMPLICIT = 73, // tkImplicit - SYMBOL_TKIN = 74, // tkIn - SYMBOL_TKINDEX = 75, // tkIndex - SYMBOL_TKINHERITED = 76, // tkInherited - SYMBOL_TKINITIALIZATION = 77, // tkInitialization - SYMBOL_TKINLINE = 78, // tkInline - SYMBOL_TKINT64 = 79, // tkInt64 - SYMBOL_TKINTEGER = 80, // tkInteger - SYMBOL_TKINTERFACE = 81, // tkInterface - SYMBOL_TKINTERNAL = 82, // tkInternal - SYMBOL_TKIS = 83, // tkIs - SYMBOL_TKLABEL = 84, // tkLabel - SYMBOL_TKLIBRARY = 85, // tkLibrary - SYMBOL_TKLOCK = 86, // tkLock - SYMBOL_TKLONGINT = 87, // tkLongInt - SYMBOL_TKLONGWORD = 88, // tkLongWord - SYMBOL_TKLOWER = 89, // tkLower - SYMBOL_TKLOWEREQUAL = 90, // tkLowerEqual - SYMBOL_TKMESSAGE = 91, // tkMessage - SYMBOL_TKMINUS = 92, // tkMinus - SYMBOL_TKMINUSEQUAL = 93, // tkMinusEqual - SYMBOL_TKMOD = 94, // tkMod - SYMBOL_TKMULTEQUAL = 95, // tkMultEqual - SYMBOL_TKNAME = 96, // tkName - SYMBOL_TKNIL = 97, // tkNil - SYMBOL_TKNODEFAULT = 98, // tkNodefault - SYMBOL_TKNOT = 99, // tkNot - SYMBOL_TKNOTEQUAL = 100, // tkNotEqual - SYMBOL_TKOF = 101, // tkOf - SYMBOL_TKOLEVARIANT = 102, // tkOleVariant - SYMBOL_TKON = 103, // tkOn - SYMBOL_TKOPERATOR = 104, // tkOperator - SYMBOL_TKOR = 105, // tkOr - SYMBOL_TKORDINTEGER = 106, // tkOrdInteger - SYMBOL_TKOUT = 107, // tkOut - SYMBOL_TKOVERLOAD = 108, // tkOverload - SYMBOL_TKOVERRIDE = 109, // tkOverride - SYMBOL_TKPACKAGE = 110, // tkPackage - SYMBOL_TKPACKED = 111, // tkPacked - SYMBOL_TKPARAMS = 112, // tkParams - SYMBOL_TKPARSEMODEEXPRESSION = 113, // tkParseModeExpression - SYMBOL_TKPARSEMODESTATEMENT = 114, // tkParseModeStatement - SYMBOL_TKPCHAR = 115, // tkPChar - SYMBOL_TKPLUS = 116, // tkPlus - SYMBOL_TKPLUSEQUAL = 117, // tkPlusEqual - SYMBOL_TKPOINT = 118, // tkPoint - SYMBOL_TKPRIVATE = 119, // tkPrivate - SYMBOL_TKPROCEDURE = 120, // tkProcedure - SYMBOL_TKPROGRAM = 121, // tkProgram - SYMBOL_TKPROPERTY = 122, // tkProperty - SYMBOL_TKPROTECTED = 123, // tkProtected - SYMBOL_TKPUBLIC = 124, // tkPublic - SYMBOL_TKQUESTION = 125, // tkQuestion - SYMBOL_TKRAISE = 126, // tkRaise - SYMBOL_TKREAD = 127, // tkRead - SYMBOL_TKREADONLY = 128, // tkReadOnly - SYMBOL_TKREAL = 129, // tkReal - SYMBOL_TKRECORD = 130, // tkRecord - SYMBOL_TKREINTRODUCE = 131, // tkReintroduce - SYMBOL_TKREPEAT = 132, // tkRepeat - SYMBOL_TKREQUIRES = 133, // tkRequires - SYMBOL_TKRESIDENT = 134, // tkResident - SYMBOL_TKRESOURCESTRING = 135, // tkResourceString - SYMBOL_TKROUNDCLOSE = 136, // tkRoundClose - SYMBOL_TKROUNDOPEN = 137, // tkRoundOpen - SYMBOL_TKSEMICOLON = 138, // tkSemiColon - SYMBOL_TKSET = 139, // tkSet - SYMBOL_TKSHL = 140, // tkShl - SYMBOL_TKSHORTINT = 141, // tkShortInt - SYMBOL_TKSHR = 142, // tkShr - SYMBOL_TKSINGLE = 143, // tkSingle - SYMBOL_TKSIZEOF = 144, // tkSizeOf - SYMBOL_TKSLASH = 145, // tkSlash - SYMBOL_TKSMALLINT = 146, // tkSmallInt - SYMBOL_TKSQUARECLOSE = 147, // tkSquareClose - SYMBOL_TKSQUAREOPEN = 148, // tkSquareOpen - SYMBOL_TKSTAR = 149, // tkStar - SYMBOL_TKSTATIC = 150, // tkStatic - SYMBOL_TKSTORED = 151, // tkStored - SYMBOL_TKSTRINGLITERAL = 152, // tkStringLiteral - SYMBOL_TKTEMPLATE = 153, // tkTemplate - SYMBOL_TKTHEN = 154, // tkThen - SYMBOL_TKTHREADVAR = 155, // tkThreadvar - SYMBOL_TKTO = 156, // tkTo - SYMBOL_TKTRY = 157, // tkTry - SYMBOL_TKTYPE = 158, // tkType - SYMBOL_TKTYPEOF = 159, // tkTypeOf - SYMBOL_TKUNIT = 160, // tkUnit - SYMBOL_TKUNTIL = 161, // tkUntil - SYMBOL_TKUSES = 162, // tkUses - SYMBOL_TKUSING = 163, // tkUsing - SYMBOL_TKVAR = 164, // tkVar - SYMBOL_TKVARIANT = 165, // tkVariant - SYMBOL_TKVIRTUAL = 166, // tkVirtual - SYMBOL_TKWHERE = 167, // tkWhere - SYMBOL_TKWHILE = 168, // tkWhile - SYMBOL_TKWIDECHAR = 169, // tkWideChar - SYMBOL_TKWITH = 170, // tkWith - SYMBOL_TKWORD = 171, // tkWord - SYMBOL_TKWRITE = 172, // tkWrite - SYMBOL_TKWRITEONLY = 173, // tkWriteOnly - SYMBOL_TKXOR = 174, // tkXor - SYMBOL_ZKCOMMA = 175, // zkComma - SYMBOL_ABC_BLOCK = 176, // - SYMBOL_ABC_CONSTRUCTOR_DECL = 177, // - SYMBOL_ABC_DECL_SECT = 178, // - SYMBOL_ABC_DECL_SECT_LIST = 179, // - SYMBOL_ABC_DECL_SECT_LIST1 = 180, // - SYMBOL_ABC_DESTRUCTOR_DECL = 181, // - SYMBOL_ABC_EXTERNAL_DIRECTR = 182, // - SYMBOL_ABC_FUNC_DECL = 183, // - SYMBOL_ABC_FUNC_DECL_NOCLASS = 184, // - SYMBOL_ABC_INTERFACE_PART = 185, // - SYMBOL_ABC_METHOD_DECL = 186, // - SYMBOL_ABC_PROC_BLOCK = 187, // - SYMBOL_ABC_PROC_DECL = 188, // - SYMBOL_ABC_PROC_DECL_NOCLASS = 189, // - SYMBOL_ADDOP = 190, // - SYMBOL_ALLOWABLE_EXPR_AS_STMT = 191, // - SYMBOL_ARRAY_CONST = 192, // - SYMBOL_ARRAY_NAME_FOR_NEW_EXPR = 193, // - SYMBOL_ARRAY_TYPE = 194, // - SYMBOL_AS_IS_CONSTEXPR = 195, // - SYMBOL_AS_IS_EXPR = 196, // - SYMBOL_ASM_BLOCK = 197, // - SYMBOL_ASM_STMT = 198, // - SYMBOL_ASSIGN_OPERATOR = 199, // - SYMBOL_ASSIGNMENT = 200, // - SYMBOL_ATTR_EXPR_LIST = 201, // - SYMBOL_ATTRIBUTE_DECLARATION = 202, // - SYMBOL_ATTRIBUTE_DECLARATIONS = 203, // - SYMBOL_ATTRIBUTE_VAR_SPECIFIERS = 204, // - SYMBOL_ATTRIBUTE_VARIABLE = 205, // - SYMBOL_BASE_CLASS_NAME = 206, // - SYMBOL_BASE_CLASSES_NAMES_LIST = 207, // - SYMBOL_BLOCK = 208, // - SYMBOL_CASE_ITEM = 209, // - SYMBOL_CASE_LABEL = 210, // - SYMBOL_CASE_LABEL_LIST = 211, // - SYMBOL_CASE_LIST = 212, // - SYMBOL_CASE_STMT = 213, // - SYMBOL_CASE_TAG_LIST = 214, // - SYMBOL_CLASS_ATTRIBUTES = 215, // - SYMBOL_CLASS_OR_INTERFACE_KEYWORD = 216, // - SYMBOL_COMPOUND_STMT = 217, // - SYMBOL_CONST_ADDOP = 218, // - SYMBOL_CONST_DECL = 219, // - SYMBOL_CONST_DECL_SECT = 220, // - SYMBOL_CONST_ELEM = 221, // - SYMBOL_CONST_ELEM_LIST = 222, // - SYMBOL_CONST_ELEM_LIST1 = 223, // - SYMBOL_CONST_EXPR = 224, // - SYMBOL_CONST_EXPR_LIST = 225, // - SYMBOL_CONST_FACTOR = 226, // - SYMBOL_CONST_FIELD = 227, // - SYMBOL_CONST_FIELD_LIST = 228, // - SYMBOL_CONST_FIELD_LIST_1 = 229, // - SYMBOL_CONST_FIELD_NAME = 230, // - SYMBOL_CONST_FUNC_EXPR_LIST = 231, // - SYMBOL_CONST_MULOP = 232, // - SYMBOL_CONST_NAME = 233, // - SYMBOL_CONST_RELOP = 234, // - SYMBOL_CONST_SET = 235, // - SYMBOL_CONST_SIMPLE_EXPR = 236, // - SYMBOL_CONST_TERM = 237, // - SYMBOL_CONST_VARIABLE = 238, // - SYMBOL_CONST_VARIABLE_2 = 239, // - SYMBOL_CONSTRUCTOR_DECL = 240, // - SYMBOL_CONSTRUCTOR_DECL_WITH_ATTR = 241, // - SYMBOL_CONTAINS_CLAUSE = 242, // - SYMBOL_DECLARED_VAR_NAME = 243, // - SYMBOL_DEFAULT_EXPR = 244, // - SYMBOL_DESTRUCTOR_DECL = 245, // - SYMBOL_DESTRUCTOR_DECL_WITH_ATTR = 246, // - SYMBOL_ELEM = 247, // - SYMBOL_ELEM_LIST = 248, // - SYMBOL_ELEM_LIST1 = 249, // - SYMBOL_ELSE_BRANCH = 250, // - SYMBOL_ELSE_CASE = 251, // - SYMBOL_EMPTY = 252, // - SYMBOL_ENUMERATION_ID = 253, // - SYMBOL_ENUMERATION_ID_LIST = 254, // - SYMBOL_ERROR2 = 255, // - SYMBOL_EXCEPTION_BLOCK = 256, // - SYMBOL_EXCEPTION_BLOCK_ELSE_BRANCH = 257, // - SYMBOL_EXCEPTION_CLASS_TYPE_IDENTIFIER = 258, // - SYMBOL_EXCEPTION_HANDLER = 259, // - SYMBOL_EXCEPTION_HANDLER_LIST = 260, // - SYMBOL_EXCEPTION_IDENTIFIER = 261, // - SYMBOL_EXCEPTION_VARIABLE = 262, // - SYMBOL_EXPORT_CLAUSE = 263, // - SYMBOL_EXPORTS_ENTRY = 264, // - SYMBOL_EXPORTS_INDEX = 265, // - SYMBOL_EXPORTS_LIST = 266, // - SYMBOL_EXPORTS_NAME = 267, // - SYMBOL_EXPORTS_RESIDENT = 268, // - SYMBOL_EXPR = 269, // - SYMBOL_EXPR_AS_STMT = 270, // - SYMBOL_EXPR_L1 = 271, // - SYMBOL_EXPR_LIST = 272, // - SYMBOL_EXTERNAL_DIRECTR = 273, // - SYMBOL_EXTERNAL_DIRECTR_IDENT = 274, // - SYMBOL_FACTOR = 275, // - SYMBOL_FIELD_ACCESS_MODIFIER = 276, // - SYMBOL_FIELD_LIST = 277, // - SYMBOL_FILE_TYPE = 278, // - SYMBOL_FILED_OR_CONST_DEFINITION = 279, // - SYMBOL_FILED_OR_CONST_DEFINITION_OR_AM = 280, // - SYMBOL_FIXED_PART = 281, // - SYMBOL_FIXED_PART_2 = 282, // - SYMBOL_FOR_CYCLE_TYPE = 283, // - SYMBOL_FOR_STMT = 284, // - SYMBOL_FOR_STMT_DECL_OR_ASSIGN = 285, // - SYMBOL_FOREACH_STMT = 286, // - SYMBOL_FOREACH_STMT_IDENT_DYPE_OPT = 287, // - SYMBOL_FORMAT_EXPR = 288, // - SYMBOL_FP_LIST = 289, // - SYMBOL_FP_SECT = 290, // - SYMBOL_FP_SECT_LIST = 291, // - SYMBOL_FPTYPE = 292, // - SYMBOL_FPTYPE_NEW = 293, // - SYMBOL_FUNC_BLOCK = 294, // - SYMBOL_FUNC_CLASS_NAME_IDENT = 295, // - SYMBOL_FUNC_DECL = 296, // - SYMBOL_FUNC_DECL_LAMBDA = 297, // - SYMBOL_FUNC_DECL_NOCLASS = 298, // - SYMBOL_FUNC_DECL_WITH_ATTR = 299, // - SYMBOL_FUNC_HEADING = 300, // - SYMBOL_FUNC_METH_NAME_IDENT = 301, // - SYMBOL_FUNC_NAME = 302, // - SYMBOL_FUNC_NAME_IDENT = 303, // - SYMBOL_FUNC_NAME_WITH_TEMPLATE_ARGS = 304, // - SYMBOL_GOTO_STMT = 305, // - SYMBOL_HEAD_COMPILER_DIRECTIVES = 306, // - SYMBOL_IDENT_LIST = 307, // - SYMBOL_IDENT_LIST1 = 308, // - SYMBOL_IDENT_LIST2 = 309, // - SYMBOL_IDENT_OR_KEYWORD_POINTSEPARATOR_LIST = 310, // - SYMBOL_IDENTIFIER = 311, // - SYMBOL_IDENTIFIER_KEYWORD_OPERATORNAME = 312, // - SYMBOL_IDENTIFIER_OR_KEYWORD = 313, // - SYMBOL_IF_STMT = 314, // - SYMBOL_IF_THEN_ELSE_BRANCH = 315, // - SYMBOL_IMPL_DECL_SECT = 316, // - SYMBOL_IMPL_DECL_SECT_LIST = 317, // - SYMBOL_IMPL_DECL_SECT_LIST1 = 318, // - SYMBOL_IMPLEMENTATION_PART = 319, // - SYMBOL_INHERITED_MESSAGE = 320, // - SYMBOL_INIT_CONST_EXPR = 321, // - SYMBOL_INITIALIZATION_PART = 322, // - SYMBOL_INT_DECL_SECT = 323, // - SYMBOL_INT_DECL_SECT_LIST = 324, // - SYMBOL_INT_DECL_SECT_LIST1 = 325, // - SYMBOL_INT_FUNC_HEADING = 326, // - SYMBOL_INT_PROC_HEADING = 327, // - SYMBOL_INTEGER_CONST = 328, // - SYMBOL_INTERFACE_PART = 329, // - SYMBOL_KEYWORD = 330, // - SYMBOL_LABEL_DECL_SECT = 331, // - SYMBOL_LABEL_LIST = 332, // - SYMBOL_LABEL_NAME = 333, // - SYMBOL_LAMBDA_BODY = 334, // - SYMBOL_LIBRARY_BLOCK = 335, // - SYMBOL_LIBRARY_FILE = 336, // - SYMBOL_LIBRARY_HEADING = 337, // - SYMBOL_LIBRARY_IMPL_DECL_SECT = 338, // - SYMBOL_LIBRARY_IMPL_DECL_SECT_LIST = 339, // - SYMBOL_LITERAL = 340, // - SYMBOL_LITERAL_LIST = 341, // - SYMBOL_LITERAL_OR_NUMBER = 342, // - SYMBOL_LOCK_STMT = 343, // - SYMBOL_MAIN_USED_UNIT_NAME = 344, // - SYMBOL_MAIN_USED_UNITS_LIST = 345, // - SYMBOL_MAIN_USES_CLAUSE = 346, // - SYMBOL_MAYBE_ERROR = 347, // - SYMBOL_METH_MODIFICATOR = 348, // - SYMBOL_METH_MODIFICATORS = 349, // - SYMBOL_MULOP = 350, // - SYMBOL_NEW_EXPR = 351, // - SYMBOL_NEW_OBJECT_TYPE = 352, // - SYMBOL_NEW_RECORD_TYPE = 353, // - SYMBOL_NON_RESERVED = 354, // - SYMBOL_NOT_ARRAY_DEFAULTPROPERTY = 355, // - SYMBOL_NOT_COMPONENT_LIST = 356, // - SYMBOL_NOT_COMPONENT_LIST_1 = 357, // - SYMBOL_NOT_COMPONENT_LIST_2 = 358, // - SYMBOL_NOT_COMPONENT_LIST_SEQ = 359, // - SYMBOL_NOT_CONSTRUCTOR_BLOCK_DECL = 360, // - SYMBOL_NOT_CONSTRUCTOR_HEADING = 361, // - SYMBOL_NOT_CONSTRUCTOR_HEADING_OBJECT = 362, // - SYMBOL_NOT_DESTRUCTOR_HEADING = 363, // - SYMBOL_NOT_FIELD_DEFINITION = 364, // - SYMBOL_NOT_GUID = 365, // - SYMBOL_NOT_METHOD_DEFINITION = 366, // - SYMBOL_NOT_METHOD_HEADING = 367, // - SYMBOL_NOT_OBJECT_TYPE = 368, // - SYMBOL_NOT_OBJECT_TYPE_IDENTIFIER_LIST = 369, // - SYMBOL_NOT_PARAMETER_DECL = 370, // - SYMBOL_NOT_PARAMETER_DECL_LIST = 371, // - SYMBOL_NOT_PARAMETER_NAME_LIST = 372, // - SYMBOL_NOT_PROCFUNC_HEADING = 373, // - SYMBOL_NOT_PROCFUNC_HEADING_VARIANTS = 374, // - SYMBOL_NOT_PROPERTY_DEFINITION = 375, // - SYMBOL_NOT_PROPERTY_INTERFACE = 376, // - SYMBOL_NOT_PROPERTY_INTERFACE_INDEX = 377, // - SYMBOL_NOT_PROPERTY_PARAMETER_LIST = 378, // - SYMBOL_NOT_PROPERTY_SPECIFIERS = 379, // - SYMBOL_NOT_SIMPLE_PROPERTY_DEFINITION = 380, // - SYMBOL_OBJECT_TYPE = 381, // - SYMBOL_ONE_ATTRIBUTE = 382, // - SYMBOL_ONE_COMPILER_DIRECTIVE = 383, // - SYMBOL_ONE_LITERAL = 384, // - SYMBOL_ONE_OR_SOME_ATTRIBUTE = 385, // - SYMBOL_ONLY_CONST_DECL = 386, // - SYMBOL_OOT_COMPONENT_LIST = 387, // - SYMBOL_OOT_CONSTRUCTOR_HEAD = 388, // - SYMBOL_OOT_DESTRUCTOR_HEAD = 389, // - SYMBOL_OOT_FIELD = 390, // - SYMBOL_OOT_FIELD_IDENTIFIER = 391, // - SYMBOL_OOT_FIELD_LIST = 392, // - SYMBOL_OOT_ID_LIST = 393, // - SYMBOL_OOT_METHOD = 394, // - SYMBOL_OOT_METHOD_HEAD = 395, // - SYMBOL_OOT_METHOD_LIST = 396, // - SYMBOL_OOT_PRIVAT_LIST = 397, // - SYMBOL_OOT_SUCCESSOR = 398, // - SYMBOL_OOT_TYPEIDENTIFIER = 399, // - SYMBOL_OPERATOR_NAME_IDENT = 400, // - SYMBOL_OPT_AMPERSEND = 401, // - SYMBOL_OPT_ARRAY_INITIALIZER = 402, // - SYMBOL_OPT_ATTR_EXPR_LIST = 403, // - SYMBOL_OPT_ATTRIBUTE_DECLARATIONS = 404, // - SYMBOL_OPT_BASE_CLASSES = 405, // - SYMBOL_OPT_CONST_FUNC_EXPR_LIST = 406, // - SYMBOL_OPT_EXPR_LIST = 407, // - SYMBOL_OPT_EXPR_LIST_WITH_BRACKET = 408, // - SYMBOL_OPT_HEAD_COMPILER_DIRECTIVES = 409, // - SYMBOL_OPT_IDENTIFIER = 410, // - SYMBOL_OPT_METH_MODIFICATORS = 411, // - SYMBOL_OPT_NOT_COMPONENT_LIST_SEQ_END = 412, // - SYMBOL_OPT_PROC_NAME = 413, // - SYMBOL_OPT_SEMICOLON = 414, // - SYMBOL_OPT_TEMPLATE_ARGUMENTS = 415, // - SYMBOL_OPT_TEMPLATE_TYPE_PARAMS = 416, // - SYMBOL_OPT_TK_DO = 417, // - SYMBOL_OPT_TK_POINT = 418, // - SYMBOL_OPT_VAR = 419, // - SYMBOL_OPT_WHERE_SECTION = 420, // - SYMBOL_OPTIONAL_QUALIFIED_IDENTIFIER = 421, // - SYMBOL_ORD_TYPE_NAME = 422, // - SYMBOL_OT_VISIBILITY_SPECIFIER = 423, // - SYMBOL_OTHER = 424, // - SYMBOL_OVERLOAD_OPERATOR = 425, // - SYMBOL_PACKAGE_FILE = 426, // - SYMBOL_PACKAGE_NAME = 427, // - SYMBOL_PARAM_NAME = 428, // - SYMBOL_PARAM_NAME_LIST = 429, // - SYMBOL_PARSE_GOAL = 430, // - SYMBOL_PARTS = 431, // - SYMBOL_POINTER_TYPE = 432, // - SYMBOL_PROC_BLOCK = 433, // - SYMBOL_PROC_BLOCK_DECL = 434, // - SYMBOL_PROC_CALL = 435, // - SYMBOL_PROC_DECL = 436, // - SYMBOL_PROC_DECL_NOCLASS = 437, // - SYMBOL_PROC_DECL_WITH_ATTR = 438, // - SYMBOL_PROC_HEADING = 439, // - SYMBOL_PROC_NAME = 440, // - SYMBOL_PROCEDURAL_TYPE = 441, // - SYMBOL_PROCEDURAL_TYPE_DECL = 442, // - SYMBOL_PROCEDURAL_TYPE_KIND = 443, // - SYMBOL_PROGRAM_BLOCK = 444, // - SYMBOL_PROGRAM_DECL_SECT_LIST = 445, // - SYMBOL_PROGRAM_FILE = 446, // - SYMBOL_PROGRAM_HEADING = 447, // - SYMBOL_PROGRAM_HEADING_2 = 448, // - SYMBOL_PROGRAM_NAME = 449, // - SYMBOL_PROGRAM_PARAM = 450, // - SYMBOL_PROGRAM_PARAM_LIST = 451, // - SYMBOL_PROPERTY_SPECIFIER_DIRECTIVES = 452, // - SYMBOL_QUALIFIED_IDENTIFIER = 453, // - SYMBOL_QUESTION_CONSTEXPR = 454, // - SYMBOL_QUESTION_EXPR = 455, // - SYMBOL_RAISE_STMT = 456, // - SYMBOL_RANGE_EXPR = 457, // - SYMBOL_RANGE_FACTOR = 458, // - SYMBOL_RANGE_METHODNAME = 459, // - SYMBOL_RANGE_TERM = 460, // - SYMBOL_REAL_TYPE_NAME = 461, // - SYMBOL_RECORD_COMPONENT_LIST = 462, // - SYMBOL_RECORD_CONST = 463, // - SYMBOL_RECORD_KEYWORD = 464, // - SYMBOL_RECORD_SECTION = 465, // - SYMBOL_RECORD_SECTION_ID = 466, // - SYMBOL_RECORD_SECTION_ID_LIST = 467, // - SYMBOL_RECORD_TYPE = 468, // - SYMBOL_RELOP = 469, // - SYMBOL_RELOP_EXPR = 470, // - SYMBOL_REPEAT_STMT = 471, // - SYMBOL_REQUIRES_CLAUSE = 472, // - SYMBOL_RES_STR_DECL_SECT = 473, // - SYMBOL_RESERVED_KEYWORD = 474, // - SYMBOL_SET_TYPE = 475, // - SYMBOL_SIGN = 476, // - SYMBOL_SIMPLE_EXPR = 477, // - SYMBOL_SIMPLE_FILED_OR_CONST_DEFINITION = 478, // - SYMBOL_SIMPLE_FP_SECT = 479, // - SYMBOL_SIMPLE_NOT_PROPERTY_DEFINITION = 480, // - SYMBOL_SIMPLE_OR_TEMPLATE_TYPE_REFERENCE = 481, // - SYMBOL_SIMPLE_TYPE = 482, // - SYMBOL_SIMPLE_TYPE_DECL = 483, // - SYMBOL_SIMPLE_TYPE_IDENTIFIER = 484, // - SYMBOL_SIMPLE_TYPE_LIST = 485, // - SYMBOL_SIMPLE_TYPE_OR_EMPTY = 486, // - SYMBOL_SIZEOF_EXPR = 487, // - SYMBOL_STMT = 488, // - SYMBOL_STMT_LIST = 489, // - SYMBOL_STMT_OR_EXPRESSION = 490, // - SYMBOL_STRING_TYPE = 491, // - SYMBOL_STRUCTURED_TYPE = 492, // - SYMBOL_TAG_FIELD = 493, // - SYMBOL_TAG_FIELD_NAME = 494, // - SYMBOL_TAG_FIELD_TYPENAME = 495, // - SYMBOL_TEMPLATE_ARGUMENTS = 496, // - SYMBOL_TEMPLATE_IDENTIFIER_WITH_EQUAL = 497, // - SYMBOL_TEMPLATE_PARAM = 498, // - SYMBOL_TEMPLATE_PARAM_LIST = 499, // - SYMBOL_TEMPLATE_TYPE = 500, // - SYMBOL_TEMPLATE_TYPE_BACK_VARSPECIFIERS = 501, // - SYMBOL_TEMPLATE_TYPE_PARAMS = 502, // - SYMBOL_TERM = 503, // - SYMBOL_THEN_BRANCH = 504, // - SYMBOL_TRY_HANDLER = 505, // - SYMBOL_TRY_STMT = 506, // - SYMBOL_TYPE_DECL = 507, // - SYMBOL_TYPE_DECL_IDENTIFIER = 508, // - SYMBOL_TYPE_DECL_SECT = 509, // - SYMBOL_TYPE_DECL_TYPE = 510, // - SYMBOL_TYPE_REF = 511, // - SYMBOL_TYPE_REF_AND_SECIFIC_LIST = 512, // - SYMBOL_TYPE_REF_OR_SECIFIC = 513, // - SYMBOL_TYPECAST_OP = 514, // - SYMBOL_TYPED_CONST = 515, // - SYMBOL_TYPED_CONST_LIST = 516, // - SYMBOL_TYPED_CONST_OR_NEW = 517, // - SYMBOL_TYPEOF_EXPR = 518, // - SYMBOL_UNIT_FILE = 519, // - SYMBOL_UNIT_HEADING = 520, // - SYMBOL_UNIT_KEY_WORD = 521, // - SYMBOL_UNIT_NAME = 522, // - SYMBOL_UNLABELLED_STMT = 523, // - SYMBOL_UNPACKED_STRUCTURED_TYPE = 524, // - SYMBOL_UNSIGNED_NUMBER = 525, // - SYMBOL_UNSIZED_ARRAY_TYPE = 526, // - SYMBOL_USES_CLAUSE = 527, // - SYMBOL_USING_CLAUSE = 528, // - SYMBOL_USING_LIST = 529, // - SYMBOL_USING_ONE = 530, // - SYMBOL_VAR_ADDRESS = 531, // - SYMBOL_VAR_DECL = 532, // - SYMBOL_VAR_DECL_PART = 533, // - SYMBOL_VAR_DECL_PART_ASSIGN = 534, // - SYMBOL_VAR_DECL_PART_IN_STMT = 535, // - SYMBOL_VAR_DECL_PART_NORMAL = 536, // - SYMBOL_VAR_DECL_SECT = 537, // - SYMBOL_VAR_INIT_VALUE = 538, // - SYMBOL_VAR_INIT_VALUE_TYPED = 539, // - SYMBOL_VAR_NAME = 540, // - SYMBOL_VAR_NAME_LIST = 541, // - SYMBOL_VAR_OR_IDENTIFIER = 542, // - SYMBOL_VAR_REFERENCE = 543, // - SYMBOL_VAR_SPECIFIERS = 544, // - SYMBOL_VAR_STMT = 545, // - SYMBOL_VARIABLE = 546, // - SYMBOL_VARIANT = 547, // - SYMBOL_VARIANT_FIELD_LIST = 548, // - SYMBOL_VARIANT_LIST = 549, // - SYMBOL_VARIANT_LIST_2 = 550, // - SYMBOL_VARIANT_PART = 551, // - SYMBOL_VARIANT_TYPE_NAME = 552, // - SYMBOL_VISIBILITY_SPECIFIER = 553, // - SYMBOL_WHERE_PART = 554, // - SYMBOL_WHERE_PART_LIST = 555, // - SYMBOL_WHILE_STMT = 556, // - SYMBOL_WITH_STMT = 557 // -}; - - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//RuleConstants -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public enum RuleConstants : int -{ - RULE_PARSE_GOAL = 0, // ::= - RULE_PARSE_GOAL2 = 1, // ::= - RULE_PARSE_GOAL3 = 2, // ::= - RULE_PARTS_TKPARSEMODEEXPRESSION = 3, // ::= tkParseModeExpression - RULE_PARTS_TKPARSEMODESTATEMENT = 4, // ::= tkParseModeStatement - RULE_STMT_OR_EXPRESSION = 5, // ::= - RULE_STMT_OR_EXPRESSION2 = 6, // ::= - RULE_STMT_OR_EXPRESSION3 = 7, // ::= - RULE_OPT_HEAD_COMPILER_DIRECTIVES = 8, // ::= - RULE_OPT_HEAD_COMPILER_DIRECTIVES2 = 9, // ::= - RULE_HEAD_COMPILER_DIRECTIVES = 10, // ::= - RULE_HEAD_COMPILER_DIRECTIVES2 = 11, // ::= - RULE_ONE_COMPILER_DIRECTIVE_TKDIRECTIVENAME_TKIDENTIFIER = 12, // ::= tkDirectiveName tkIdentifier - RULE_ONE_COMPILER_DIRECTIVE_TKDIRECTIVENAME_TKSTRINGLITERAL = 13, // ::= tkDirectiveName tkStringLiteral - RULE_PROGRAM_FILE = 14, // ::= - RULE_OPT_TK_POINT_TKPOINT = 15, // ::= tkPoint - RULE_OPT_TK_POINT_TKSEMICOLON = 16, // ::= tkSemiColon - RULE_OPT_TK_POINT_TKCOLON = 17, // ::= tkColon - RULE_OPT_TK_POINT_ZKCOMMA = 18, // ::= zkComma - RULE_OPT_TK_POINT_TKDOTDOT = 19, // ::= tkDotDot - RULE_OPT_TK_POINT = 20, // ::= - RULE_PROGRAM_HEADING = 21, // ::= - RULE_PROGRAM_HEADING_TKPROGRAM = 22, // ::= tkProgram - RULE_PROGRAM_HEADING_2_TKSEMICOLON = 23, // ::= tkSemiColon - RULE_PROGRAM_HEADING_2_TKROUNDOPEN_TKROUNDCLOSE_TKSEMICOLON = 24, // ::= tkRoundOpen tkRoundClose tkSemiColon - RULE_PROGRAM_NAME = 25, // ::= - RULE_PROGRAM_PARAM_LIST = 26, // ::= - RULE_PROGRAM_PARAM_LIST_TKCOMMA = 27, // ::= tkComma - RULE_PROGRAM_PARAM = 28, // ::= - RULE_PROGRAM_BLOCK = 29, // ::= - RULE_PROGRAM_DECL_SECT_LIST = 30, // ::= - RULE_USES_CLAUSE = 31, // ::= - RULE_USING_CLAUSE = 32, // ::= - RULE_USING_CLAUSE2 = 33, // ::= - RULE_USING_LIST = 34, // ::= - RULE_USING_LIST2 = 35, // ::= - RULE_USING_ONE_TKUSING_TKSEMICOLON = 36, // ::= tkUsing tkSemiColon - RULE_IDENT_OR_KEYWORD_POINTSEPARATOR_LIST = 37, // ::= - RULE_IDENT_OR_KEYWORD_POINTSEPARATOR_LIST_TKPOINT = 38, // ::= tkPoint - RULE_MAIN_USES_CLAUSE = 39, // ::= - RULE_MAIN_USES_CLAUSE_TKUSES_TKSEMICOLON = 40, // ::= tkUses tkSemiColon - RULE_MAIN_USED_UNITS_LIST_TKCOMMA = 41, // ::= tkComma - RULE_MAIN_USED_UNITS_LIST = 42, // ::= - RULE_MAIN_USED_UNIT_NAME = 43, // ::= - RULE_MAIN_USED_UNIT_NAME_TKIN_TKSTRINGLITERAL = 44, // ::= tkIn tkStringLiteral - RULE_LIBRARY_FILE_TKPOINT = 45, // ::= tkPoint - RULE_LIBRARY_HEADING_TKLIBRARY_TKSEMICOLON = 46, // ::= tkLibrary tkSemiColon - RULE_LIBRARY_BLOCK = 47, // ::= - RULE_LIBRARY_IMPL_DECL_SECT_LIST = 48, // ::= - RULE_LIBRARY_IMPL_DECL_SECT_LIST2 = 49, // ::= - RULE_LIBRARY_IMPL_DECL_SECT = 50, // ::= - RULE_LIBRARY_IMPL_DECL_SECT2 = 51, // ::= - RULE_LIBRARY_IMPL_DECL_SECT3 = 52, // ::= - RULE_LIBRARY_IMPL_DECL_SECT4 = 53, // ::= - RULE_LIBRARY_IMPL_DECL_SECT5 = 54, // ::= - RULE_LIBRARY_IMPL_DECL_SECT6 = 55, // ::= - RULE_LIBRARY_IMPL_DECL_SECT7 = 56, // ::= - RULE_LIBRARY_IMPL_DECL_SECT8 = 57, // ::= - RULE_LIBRARY_IMPL_DECL_SECT9 = 58, // ::= - RULE_LIBRARY_IMPL_DECL_SECT10 = 59, // ::= - RULE_EXPORT_CLAUSE_TKEXPORTS_TKSEMICOLON = 60, // ::= tkExports tkSemiColon - RULE_EXPORTS_LIST = 61, // ::= - RULE_EXPORTS_LIST_TKCOMMA = 62, // ::= tkComma - RULE_EXPORTS_ENTRY = 63, // ::= - RULE_EXPORTS_INDEX = 64, // ::= - RULE_EXPORTS_INDEX_TKINDEX = 65, // ::= tkIndex - RULE_EXPORTS_NAME = 66, // ::= - RULE_EXPORTS_NAME_TKNAME = 67, // ::= tkName - RULE_EXPORTS_NAME_TKNAME2 = 68, // ::= tkName - RULE_EXPORTS_RESIDENT = 69, // ::= - RULE_EXPORTS_RESIDENT_TKRESIDENT = 70, // ::= tkResident - RULE_UNIT_FILE_TKPOINT = 71, // ::= tkPoint - RULE_UNIT_FILE_TKPOINT2 = 72, // ::= tkPoint - RULE_UNIT_HEADING_TKSEMICOLON = 73, // ::= tkSemiColon - RULE_UNIT_KEY_WORD_TKUNIT = 74, // ::= tkUnit - RULE_UNIT_KEY_WORD_TKLIBRARY = 75, // ::= tkLibrary - RULE_UNIT_NAME = 76, // ::= - RULE_INTERFACE_PART_TKINTERFACE = 77, // ::= tkInterface - RULE_IMPLEMENTATION_PART_TKIMPLEMENTATION = 78, // ::= tkImplementation - RULE_ABC_INTERFACE_PART = 79, // ::= - RULE_INITIALIZATION_PART_TKEND = 80, // ::= tkEnd - RULE_INITIALIZATION_PART_TKINITIALIZATION_TKEND = 81, // ::= tkInitialization tkEnd - RULE_INITIALIZATION_PART_TKINITIALIZATION_TKFINALIZATION_TKEND = 82, // ::= tkInitialization tkFinalization tkEnd - RULE_INITIALIZATION_PART_TKBEGIN_TKEND = 83, // ::= tkBegin tkEnd - RULE_PACKAGE_FILE_TKPACKAGE_TKSEMICOLON_TKEND_TKPOINT = 84, // ::= tkPackage tkSemiColon tkEnd tkPoint - RULE_PACKAGE_NAME = 85, // ::= - RULE_REQUIRES_CLAUSE = 86, // ::= - RULE_REQUIRES_CLAUSE_TKREQUIRES = 87, // ::= tkRequires - RULE_REQUIRES_CLAUSE_TKREQUIRES_TKSEMICOLON = 88, // ::= tkRequires tkSemiColon - RULE_CONTAINS_CLAUSE = 89, // ::= - RULE_CONTAINS_CLAUSE_TKCONTAINS = 90, // ::= tkContains - RULE_CONTAINS_CLAUSE_TKCONTAINS_TKSEMICOLON = 91, // ::= tkContains tkSemiColon - RULE_INT_DECL_SECT_LIST = 92, // ::= - RULE_INT_DECL_SECT_LIST1 = 93, // ::= - RULE_INT_DECL_SECT_LIST12 = 94, // ::= - RULE_IMPL_DECL_SECT_LIST = 95, // ::= - RULE_IMPL_DECL_SECT_LIST1 = 96, // ::= - RULE_IMPL_DECL_SECT_LIST12 = 97, // ::= - RULE_ABC_DECL_SECT_LIST = 98, // ::= - RULE_ABC_DECL_SECT_LIST1 = 99, // ::= - RULE_ABC_DECL_SECT_LIST12 = 100, // ::= - RULE_INT_DECL_SECT = 101, // ::= - RULE_INT_DECL_SECT2 = 102, // ::= - RULE_INT_DECL_SECT3 = 103, // ::= - RULE_INT_DECL_SECT4 = 104, // ::= - RULE_INT_DECL_SECT5 = 105, // ::= - RULE_INT_DECL_SECT6 = 106, // ::= - RULE_IMPL_DECL_SECT = 107, // ::= - RULE_IMPL_DECL_SECT2 = 108, // ::= - RULE_IMPL_DECL_SECT3 = 109, // ::= - RULE_IMPL_DECL_SECT4 = 110, // ::= - RULE_IMPL_DECL_SECT5 = 111, // ::= - RULE_IMPL_DECL_SECT6 = 112, // ::= - RULE_IMPL_DECL_SECT7 = 113, // ::= - RULE_IMPL_DECL_SECT8 = 114, // ::= - RULE_IMPL_DECL_SECT9 = 115, // ::= - RULE_PROC_DECL_WITH_ATTR = 116, // ::= - RULE_FUNC_DECL_WITH_ATTR = 117, // ::= - RULE_CONSTRUCTOR_DECL_WITH_ATTR = 118, // ::= - RULE_DESTRUCTOR_DECL_WITH_ATTR = 119, // ::= - RULE_ABC_DECL_SECT = 120, // ::= - RULE_ABC_DECL_SECT2 = 121, // ::= - RULE_ABC_DECL_SECT3 = 122, // ::= - RULE_ABC_DECL_SECT4 = 123, // ::= - RULE_ABC_DECL_SECT5 = 124, // ::= - RULE_INT_PROC_HEADING = 125, // ::= - RULE_INT_PROC_HEADING_TKFORWARD_TKSEMICOLON = 126, // ::= tkForward tkSemiColon - RULE_INT_FUNC_HEADING = 127, // ::= - RULE_INT_FUNC_HEADING_TKFORWARD_TKSEMICOLON = 128, // ::= tkForward tkSemiColon - RULE_LABEL_DECL_SECT_TKLABEL_TKSEMICOLON = 129, // ::= tkLabel tkSemiColon - RULE_LABEL_LIST = 130, // ::= - RULE_LABEL_LIST_TKCOMMA = 131, // ::= tkComma - RULE_LABEL_NAME_TKINTEGER = 132, // ::= tkInteger - RULE_LABEL_NAME_TKFLOAT = 133, // ::= tkFloat - RULE_LABEL_NAME = 134, // ::= - RULE_CONST_DECL_SECT_TKCONST = 135, // ::= tkConst - RULE_CONST_DECL_SECT = 136, // ::= - RULE_RES_STR_DECL_SECT_TKRESOURCESTRING = 137, // ::= tkResourceString - RULE_RES_STR_DECL_SECT = 138, // ::= - RULE_TYPE_DECL_SECT_TKTYPE = 139, // ::= tkType - RULE_TYPE_DECL_SECT = 140, // ::= - RULE_VAR_DECL_SECT_TKVAR = 141, // ::= tkVar - RULE_VAR_DECL_SECT_TKEVENT = 142, // ::= tkEvent - RULE_VAR_DECL_SECT = 143, // ::= - RULE_CONST_DECL_TKSEMICOLON = 144, // ::= tkSemiColon - RULE_ONLY_CONST_DECL_TKEQUAL = 145, // ::= tkEqual - RULE_ONLY_CONST_DECL_TKCOLON_TKEQUAL = 146, // ::= tkColon tkEqual - RULE_INIT_CONST_EXPR = 147, // ::= - RULE_INIT_CONST_EXPR2 = 148, // ::= - RULE_CONST_NAME = 149, // ::= - RULE_CONST_EXPR = 150, // ::= - RULE_CONST_EXPR2 = 151, // ::= - RULE_CONST_EXPR3 = 152, // ::= - RULE_QUESTION_CONSTEXPR_TKQUESTION_TKCOLON = 153, // ::= tkQuestion tkColon - RULE_CONST_RELOP_TKEQUAL = 154, // ::= tkEqual - RULE_CONST_RELOP_TKNOTEQUAL = 155, // ::= tkNotEqual - RULE_CONST_RELOP_TKLOWER = 156, // ::= tkLower - RULE_CONST_RELOP_TKGREATER = 157, // ::= tkGreater - RULE_CONST_RELOP_TKLOWEREQUAL = 158, // ::= tkLowerEqual - RULE_CONST_RELOP_TKGREATEREQUAL = 159, // ::= tkGreaterEqual - RULE_CONST_RELOP_TKIN = 160, // ::= tkIn - RULE_CONST_SIMPLE_EXPR = 161, // ::= - RULE_CONST_SIMPLE_EXPR2 = 162, // ::= - RULE_CONST_ADDOP_TKPLUS = 163, // ::= tkPlus - RULE_CONST_ADDOP_TKMINUS = 164, // ::= tkMinus - RULE_CONST_ADDOP_TKOR = 165, // ::= tkOr - RULE_CONST_ADDOP_TKXOR = 166, // ::= tkXor - RULE_AS_IS_CONSTEXPR = 167, // ::= - RULE_CONST_TERM = 168, // ::= - RULE_CONST_TERM2 = 169, // ::= - RULE_CONST_TERM3 = 170, // ::= - RULE_CONST_MULOP_TKSTAR = 171, // ::= tkStar - RULE_CONST_MULOP_TKSLASH = 172, // ::= tkSlash - RULE_CONST_MULOP_TKDIV = 173, // ::= tkDiv - RULE_CONST_MULOP_TKMOD = 174, // ::= tkMod - RULE_CONST_MULOP_TKSHL = 175, // ::= tkShl - RULE_CONST_MULOP_TKSHR = 176, // ::= tkShr - RULE_CONST_MULOP_TKAND = 177, // ::= tkAnd - RULE_CONST_FACTOR = 178, // ::= - RULE_CONST_FACTOR2 = 179, // ::= - RULE_CONST_FACTOR3 = 180, // ::= - RULE_CONST_FACTOR4 = 181, // ::= - RULE_CONST_FACTOR_TKNIL = 182, // ::= tkNil - RULE_CONST_FACTOR_TKADDRESSOF = 183, // ::= tkAddressOf - RULE_CONST_FACTOR_TKROUNDOPEN_TKROUNDCLOSE = 184, // ::= tkRoundOpen tkRoundClose - RULE_CONST_FACTOR_TKNOT = 185, // ::= tkNot - RULE_CONST_FACTOR5 = 186, // ::= - RULE_CONST_FACTOR_TKDEREF = 187, // ::= tkDeref - RULE_CONST_SET_TKSQUAREOPEN_TKSQUARECLOSE = 188, // ::= tkSquareOpen tkSquareClose - RULE_SIGN_TKPLUS = 189, // ::= tkPlus - RULE_SIGN_TKMINUS = 190, // ::= tkMinus - RULE_CONST_VARIABLE = 191, // ::= - RULE_CONST_VARIABLE2 = 192, // ::= - RULE_CONST_VARIABLE3 = 193, // ::= - RULE_CONST_VARIABLE4 = 194, // ::= - RULE_CONST_VARIABLE_2_TKPOINT = 195, // ::= tkPoint - RULE_CONST_VARIABLE_2_TKDEREF = 196, // ::= tkDeref - RULE_CONST_VARIABLE_2_TKROUNDOPEN_TKROUNDCLOSE = 197, // ::= tkRoundOpen tkRoundClose - RULE_CONST_VARIABLE_2_TKSQUAREOPEN_TKSQUARECLOSE = 198, // ::= tkSquareOpen tkSquareClose - RULE_OPT_CONST_FUNC_EXPR_LIST = 199, // ::= - RULE_OPT_CONST_FUNC_EXPR_LIST2 = 200, // ::= - RULE_CONST_FUNC_EXPR_LIST = 201, // ::= - RULE_CONST_FUNC_EXPR_LIST_TKCOMMA = 202, // ::= tkComma - RULE_CONST_ELEM_LIST = 203, // ::= - RULE_CONST_ELEM_LIST2 = 204, // ::= - RULE_CONST_ELEM_LIST1 = 205, // ::= - RULE_CONST_ELEM_LIST1_TKCOMMA = 206, // ::= tkComma - RULE_CONST_ELEM = 207, // ::= - RULE_CONST_ELEM_TKDOTDOT = 208, // ::= tkDotDot - RULE_UNSIGNED_NUMBER_TKINTEGER = 209, // ::= tkInteger - RULE_UNSIGNED_NUMBER_TKHEX = 210, // ::= tkHex - RULE_UNSIGNED_NUMBER_TKFLOAT = 211, // ::= tkFloat - RULE_TYPED_CONST = 212, // ::= - RULE_TYPED_CONST2 = 213, // ::= - RULE_TYPED_CONST3 = 214, // ::= - RULE_ARRAY_CONST_TKROUNDOPEN_TKROUNDCLOSE = 215, // ::= tkRoundOpen tkRoundClose - RULE_ARRAY_CONST_TKROUNDOPEN_TKROUNDCLOSE2 = 216, // ::= tkRoundOpen tkRoundClose - RULE_ARRAY_CONST_TKROUNDOPEN_TKROUNDCLOSE3 = 217, // ::= tkRoundOpen tkRoundClose - RULE_TYPED_CONST_LIST = 218, // ::= - RULE_TYPED_CONST_LIST2 = 219, // ::= - RULE_TYPED_CONST_LIST_TKCOMMA = 220, // ::= tkComma - RULE_RECORD_CONST_TKROUNDOPEN_TKROUNDCLOSE = 221, // ::= tkRoundOpen tkRoundClose - RULE_CONST_FIELD_LIST = 222, // ::= - RULE_CONST_FIELD_LIST_TKSEMICOLON = 223, // ::= tkSemiColon - RULE_CONST_FIELD_LIST_1 = 224, // ::= - RULE_CONST_FIELD_LIST_1_TKSEMICOLON = 225, // ::= tkSemiColon - RULE_CONST_FIELD_TKCOLON = 226, // ::= tkColon - RULE_CONST_FIELD_NAME = 227, // ::= - RULE_TYPE_DECL = 228, // ::= - RULE_OPT_ATTRIBUTE_DECLARATIONS = 229, // ::= - RULE_OPT_ATTRIBUTE_DECLARATIONS2 = 230, // ::= - RULE_ATTRIBUTE_DECLARATIONS = 231, // ::= - RULE_ATTRIBUTE_DECLARATIONS2 = 232, // ::= - RULE_ATTRIBUTE_DECLARATION_TKSQUAREOPEN_TKSQUARECLOSE = 233, // ::= tkSquareOpen tkSquareClose - RULE_ONE_OR_SOME_ATTRIBUTE = 234, // ::= - RULE_ONE_OR_SOME_ATTRIBUTE_TKCOMMA = 235, // ::= tkComma - RULE_ONE_ATTRIBUTE = 236, // ::= - RULE_ONE_ATTRIBUTE_TKCOLON = 237, // ::= tkColon - RULE_SIMPLE_TYPE_DECL_TKEQUAL_TKSEMICOLON = 238, // ::= tkEqual tkSemiColon - RULE_SIMPLE_TYPE_DECL_TKSEMICOLON = 239, // ::= tkSemiColon - RULE_TYPE_DECL_IDENTIFIER = 240, // ::= - RULE_TYPE_DECL_IDENTIFIER2 = 241, // ::= - RULE_TEMPLATE_IDENTIFIER_WITH_EQUAL_TKLOWER_TKGREATEREQUAL = 242, // ::= tkLower tkGreaterEqual - RULE_TYPE_DECL_TYPE = 243, // ::= - RULE_TYPE_DECL_TYPE_TKTYPE = 244, // ::= tkType - RULE_TYPE_DECL_TYPE2 = 245, // ::= - RULE_TYPE_REF = 246, // ::= - RULE_TYPE_REF2 = 247, // ::= - RULE_TYPE_REF3 = 248, // ::= - RULE_TYPE_REF4 = 249, // ::= - RULE_TYPE_REF5 = 250, // ::= - RULE_TYPE_REF6 = 251, // ::= - RULE_TEMPLATE_TYPE = 252, // ::= - RULE_TEMPLATE_TYPE_PARAMS_TKLOWER_TKGREATER = 253, // ::= tkLower tkGreater - RULE_TEMPLATE_PARAM_LIST = 254, // ::= - RULE_TEMPLATE_PARAM_LIST_TKCOMMA = 255, // ::= tkComma - RULE_TEMPLATE_PARAM = 256, // ::= - RULE_TEMPLATE_PARAM2 = 257, // ::= - RULE_SIMPLE_TYPE = 258, // ::= - RULE_SIMPLE_TYPE_TKDOTDOT = 259, // ::= tkDotDot - RULE_SIMPLE_TYPE_TKROUNDOPEN_TKROUNDCLOSE = 260, // ::= tkRoundOpen tkRoundClose - RULE_RANGE_EXPR = 261, // ::= - RULE_RANGE_EXPR2 = 262, // ::= - RULE_RANGE_TERM = 263, // ::= - RULE_RANGE_TERM2 = 264, // ::= - RULE_RANGE_FACTOR = 265, // ::= - RULE_RANGE_FACTOR2 = 266, // ::= - RULE_RANGE_FACTOR3 = 267, // ::= - RULE_RANGE_FACTOR4 = 268, // ::= - RULE_RANGE_FACTOR_TKROUNDOPEN_TKROUNDCLOSE = 269, // ::= tkRoundOpen tkRoundClose - RULE_RANGE_FACTOR_TKROUNDOPEN_TKROUNDCLOSE2 = 270, // ::= tkRoundOpen tkRoundClose - RULE_RANGE_METHODNAME = 271, // ::= - RULE_RANGE_METHODNAME_TKPOINT = 272, // ::= tkPoint - RULE_SIMPLE_TYPE_IDENTIFIER = 273, // ::= - RULE_SIMPLE_TYPE_IDENTIFIER_TKPOINT = 274, // ::= tkPoint - RULE_ENUMERATION_ID_LIST_TKCOMMA = 275, // ::= tkComma - RULE_ENUMERATION_ID_LIST_TKCOMMA2 = 276, // ::= tkComma - RULE_ENUMERATION_ID = 277, // ::= - RULE_ENUMERATION_ID_TKEQUAL = 278, // ::= tkEqual - RULE_POINTER_TYPE_TKDEREF = 279, // ::= tkDeref - RULE_STRUCTURED_TYPE = 280, // ::= - RULE_STRUCTURED_TYPE_TKPACKED = 281, // ::= tkPacked - RULE_UNPACKED_STRUCTURED_TYPE = 282, // ::= - RULE_UNPACKED_STRUCTURED_TYPE2 = 283, // ::= - RULE_UNPACKED_STRUCTURED_TYPE3 = 284, // ::= - RULE_UNPACKED_STRUCTURED_TYPE4 = 285, // ::= - RULE_ARRAY_TYPE_TKARRAY_TKSQUAREOPEN_TKSQUARECLOSE_TKOF = 286, // ::= tkArray tkSquareOpen tkSquareClose tkOf - RULE_ARRAY_TYPE = 287, // ::= - RULE_UNSIZED_ARRAY_TYPE_TKARRAY_TKOF = 288, // ::= tkArray tkOf - RULE_SIMPLE_TYPE_LIST = 289, // ::= - RULE_SIMPLE_TYPE_LIST_TKCOMMA = 290, // ::= tkComma - RULE_SIMPLE_TYPE_OR_EMPTY = 291, // ::= - RULE_SIMPLE_TYPE_OR_EMPTY2 = 292, // ::= - RULE_RECORD_TYPE_TKRECORD_TKEND = 293, // ::= tkRecord tkEnd - RULE_RECORD_TYPE_TKRECORD_TKEND2 = 294, // ::= tkRecord tkEnd - RULE_FIELD_LIST = 295, // ::= - RULE_FIELD_LIST2 = 296, // ::= - RULE_FIELD_LIST_TKSEMICOLON = 297, // ::= tkSemiColon - RULE_FIXED_PART = 298, // ::= - RULE_FIXED_PART_TKSEMICOLON = 299, // ::= tkSemiColon - RULE_FIXED_PART_2 = 300, // ::= - RULE_FIXED_PART_2_TKSEMICOLON = 301, // ::= tkSemiColon - RULE_RECORD_SECTION_TKCOLON = 302, // ::= tkColon - RULE_RECORD_SECTION_ID_LIST = 303, // ::= - RULE_RECORD_SECTION_ID_LIST_TKCOMMA = 304, // ::= tkComma - RULE_RECORD_SECTION_ID = 305, // ::= - RULE_VARIANT_PART_TKCASE_TKOF = 306, // ::= tkCase tkOf - RULE_TAG_FIELD = 307, // ::= - RULE_TAG_FIELD_TKCOLON = 308, // ::= tkColon - RULE_TAG_FIELD_NAME = 309, // ::= - RULE_TAG_FIELD_TYPENAME = 310, // ::= - RULE_VARIANT_LIST = 311, // ::= - RULE_VARIANT_LIST_TKSEMICOLON = 312, // ::= tkSemiColon - RULE_VARIANT_LIST_2 = 313, // ::= - RULE_VARIANT_LIST_2_TKSEMICOLON = 314, // ::= tkSemiColon - RULE_VARIANT_TKCOLON_TKROUNDOPEN_TKROUNDCLOSE = 315, // ::= tkColon tkRoundOpen tkRoundClose - RULE_VARIANT_FIELD_LIST = 316, // ::= - RULE_VARIANT_FIELD_LIST2 = 317, // ::= - RULE_CASE_TAG_LIST = 318, // ::= - RULE_CONST_EXPR_LIST = 319, // ::= - RULE_CONST_EXPR_LIST_TKCOMMA = 320, // ::= tkComma - RULE_SET_TYPE_TKSET_TKOF = 321, // ::= tkSet tkOf - RULE_FILE_TYPE_TKFILE_TKOF = 322, // ::= tkFile tkOf - RULE_FILE_TYPE_TKFILE = 323, // ::= tkFile - RULE_STRING_TYPE_TKIDENTIFIER_TKSQUAREOPEN_TKSQUARECLOSE = 324, // ::= tkIdentifier tkSquareOpen tkSquareClose - RULE_PROCEDURAL_TYPE = 325, // ::= - RULE_PROCEDURAL_TYPE_KIND = 326, // ::= - RULE_PROCEDURAL_TYPE_DECL_TKPROCEDURE = 327, // ::= tkProcedure - RULE_PROCEDURAL_TYPE_DECL_TKFUNCTION_TKCOLON = 328, // ::= tkFunction tkColon - RULE_MAYBE_ERROR_TKCOLON = 329, // ::= tkColon - RULE_MAYBE_ERROR = 330, // ::= - RULE_OBJECT_TYPE = 331, // ::= - RULE_OOT_PRIVAT_LIST = 332, // ::= - RULE_OOT_PRIVAT_LIST_TKPRIVATE = 333, // ::= tkPrivate - RULE_OOT_COMPONENT_LIST = 334, // ::= - RULE_OOT_COMPONENT_LIST2 = 335, // ::= - RULE_OOT_COMPONENT_LIST3 = 336, // ::= - RULE_OOT_COMPONENT_LIST4 = 337, // ::= - RULE_OOT_SUCCESSOR_TKROUNDOPEN_TKROUNDCLOSE = 338, // ::= tkRoundOpen tkRoundClose - RULE_OOT_TYPEIDENTIFIER = 339, // ::= - RULE_OOT_FIELD_LIST = 340, // ::= - RULE_OOT_FIELD_LIST2 = 341, // ::= - RULE_OOT_FIELD_TKCOLON_TKSEMICOLON = 342, // ::= tkColon tkSemiColon - RULE_OOT_ID_LIST = 343, // ::= - RULE_OOT_ID_LIST_TKCOMMA = 344, // ::= tkComma - RULE_OOT_FIELD_IDENTIFIER = 345, // ::= - RULE_OOT_METHOD_LIST = 346, // ::= - RULE_OOT_METHOD_LIST2 = 347, // ::= - RULE_OOT_METHOD = 348, // ::= - RULE_OOT_METHOD_HEAD = 349, // ::= - RULE_OOT_METHOD_HEAD2 = 350, // ::= - RULE_OOT_METHOD_HEAD3 = 351, // ::= - RULE_OOT_METHOD_HEAD4 = 352, // ::= - RULE_OOT_CONSTRUCTOR_HEAD_TKCONSTRUCTOR = 353, // ::= tkConstructor - RULE_OOT_DESTRUCTOR_HEAD_TKDESTRUCTOR = 354, // ::= tkDestructor - RULE_NEW_OBJECT_TYPE = 355, // ::= - RULE_NOT_OBJECT_TYPE = 356, // ::= - RULE_NEW_RECORD_TYPE_TKEND = 357, // ::= tkEnd - RULE_CLASS_ATTRIBUTES_TKFINAL = 358, // ::= tkFinal - RULE_CLASS_ATTRIBUTES = 359, // ::= - RULE_CLASS_OR_INTERFACE_KEYWORD_TKCLASS = 360, // ::= tkClass - RULE_CLASS_OR_INTERFACE_KEYWORD_TKINTERFACE = 361, // ::= tkInterface - RULE_CLASS_OR_INTERFACE_KEYWORD_TKTEMPLATE = 362, // ::= tkTemplate - RULE_CLASS_OR_INTERFACE_KEYWORD_TKTEMPLATE_TKCLASS = 363, // ::= tkTemplate tkClass - RULE_CLASS_OR_INTERFACE_KEYWORD_TKTEMPLATE_TKRECORD = 364, // ::= tkTemplate tkRecord - RULE_CLASS_OR_INTERFACE_KEYWORD_TKTEMPLATE_TKINTERFACE = 365, // ::= tkTemplate tkInterface - RULE_RECORD_KEYWORD_TKRECORD = 366, // ::= tkRecord - RULE_OPT_NOT_COMPONENT_LIST_SEQ_END = 367, // ::= - RULE_OPT_NOT_COMPONENT_LIST_SEQ_END_TKEND = 368, // ::= tkEnd - RULE_OPT_BASE_CLASSES = 369, // ::= - RULE_OPT_BASE_CLASSES_TKROUNDOPEN_TKROUNDCLOSE = 370, // ::= tkRoundOpen tkRoundClose - RULE_BASE_CLASSES_NAMES_LIST = 371, // ::= - RULE_BASE_CLASSES_NAMES_LIST_TKCOMMA = 372, // ::= tkComma - RULE_BASE_CLASS_NAME = 373, // ::= - RULE_BASE_CLASS_NAME2 = 374, // ::= - RULE_OPT_TEMPLATE_ARGUMENTS = 375, // ::= - RULE_OPT_TEMPLATE_ARGUMENTS2 = 376, // ::= - RULE_TEMPLATE_ARGUMENTS_TKLOWER_TKGREATER = 377, // ::= tkLower tkGreater - RULE_OPT_WHERE_SECTION = 378, // ::= - RULE_OPT_WHERE_SECTION2 = 379, // ::= - RULE_WHERE_PART_LIST = 380, // ::= - RULE_WHERE_PART_LIST2 = 381, // ::= - RULE_WHERE_PART_TKWHERE_TKCOLON_TKSEMICOLON = 382, // ::= tkWhere tkColon tkSemiColon - RULE_TYPE_REF_AND_SECIFIC_LIST = 383, // ::= - RULE_TYPE_REF_AND_SECIFIC_LIST_TKCOMMA = 384, // ::= tkComma - RULE_TYPE_REF_OR_SECIFIC = 385, // ::= - RULE_TYPE_REF_OR_SECIFIC_TKCLASS = 386, // ::= tkClass - RULE_TYPE_REF_OR_SECIFIC_TKRECORD = 387, // ::= tkRecord - RULE_TYPE_REF_OR_SECIFIC_TKCONSTRUCTOR = 388, // ::= tkConstructor - RULE_RECORD_COMPONENT_LIST = 389, // ::= - RULE_NOT_COMPONENT_LIST_SEQ = 390, // ::= - RULE_NOT_COMPONENT_LIST_SEQ2 = 391, // ::= - RULE_OT_VISIBILITY_SPECIFIER_TKINTERNAL = 392, // ::= tkInternal - RULE_OT_VISIBILITY_SPECIFIER_TKPUBLIC = 393, // ::= tkPublic - RULE_OT_VISIBILITY_SPECIFIER_TKPROTECTED = 394, // ::= tkProtected - RULE_OT_VISIBILITY_SPECIFIER_TKPRIVATE = 395, // ::= tkPrivate - RULE_NOT_OBJECT_TYPE_IDENTIFIER_LIST = 396, // ::= - RULE_NOT_OBJECT_TYPE_IDENTIFIER_LIST_TKCOMMA = 397, // ::= tkComma - RULE_IDENT_LIST = 398, // ::= - RULE_IDENT_LIST_TKCOMMA = 399, // ::= tkComma - RULE_NOT_COMPONENT_LIST = 400, // ::= - RULE_NOT_COMPONENT_LIST2 = 401, // ::= - RULE_NOT_COMPONENT_LIST3 = 402, // ::= - RULE_NOT_COMPONENT_LIST_TKSEMICOLON = 403, // ::= tkSemiColon - RULE_OPT_SEMICOLON = 404, // ::= - RULE_OPT_SEMICOLON_TKSEMICOLON = 405, // ::= tkSemiColon - RULE_NOT_GUID = 406, // ::= - RULE_NOT_COMPONENT_LIST_1 = 407, // ::= - RULE_NOT_COMPONENT_LIST_1_TKSEMICOLON = 408, // ::= tkSemiColon - RULE_NOT_COMPONENT_LIST_2 = 409, // ::= - RULE_NOT_COMPONENT_LIST_22 = 410, // ::= - RULE_NOT_COMPONENT_LIST_23 = 411, // ::= - RULE_NOT_COMPONENT_LIST_24 = 412, // ::= - RULE_FILED_OR_CONST_DEFINITION = 413, // ::= - RULE_SIMPLE_FILED_OR_CONST_DEFINITION_TKCONST = 414, // ::= tkConst - RULE_SIMPLE_FILED_OR_CONST_DEFINITION = 415, // ::= - RULE_SIMPLE_FILED_OR_CONST_DEFINITION_TKCLASS = 416, // ::= tkClass - RULE_FILED_OR_CONST_DEFINITION_OR_AM = 417, // ::= - RULE_FILED_OR_CONST_DEFINITION_OR_AM2 = 418, // ::= - RULE_NOT_FIELD_DEFINITION = 419, // ::= - RULE_NOT_FIELD_DEFINITION_TKEVENT_TKCOLON = 420, // ::= tkEvent tkColon - RULE_FIELD_ACCESS_MODIFIER_TKSTATIC = 421, // ::= tkStatic - RULE_NOT_METHOD_DEFINITION = 422, // ::= - RULE_NOT_METHOD_DEFINITION2 = 423, // ::= - RULE_ABC_METHOD_DECL = 424, // ::= - RULE_ABC_METHOD_DECL2 = 425, // ::= - RULE_ABC_METHOD_DECL3 = 426, // ::= - RULE_ABC_METHOD_DECL4 = 427, // ::= - RULE_NOT_METHOD_HEADING_TKCLASS = 428, // ::= tkClass - RULE_NOT_METHOD_HEADING = 429, // ::= - RULE_NOT_METHOD_HEADING2 = 430, // ::= - RULE_NOT_METHOD_HEADING3 = 431, // ::= - RULE_NOT_PROCFUNC_HEADING = 432, // ::= - RULE_NOT_PROCFUNC_HEADING_VARIANTS = 433, // ::= - RULE_NOT_PROCFUNC_HEADING_VARIANTS2 = 434, // ::= - RULE_OPTIONAL_QUALIFIED_IDENTIFIER = 435, // ::= - RULE_OPTIONAL_QUALIFIED_IDENTIFIER2 = 436, // ::= - RULE_NOT_CONSTRUCTOR_HEADING = 437, // ::= - RULE_NOT_CONSTRUCTOR_HEADING_TKCLASS = 438, // ::= tkClass - RULE_OPT_PROC_NAME = 439, // ::= - RULE_OPT_PROC_NAME2 = 440, // ::= - RULE_NOT_CONSTRUCTOR_HEADING_OBJECT_TKCONSTRUCTOR = 441, // ::= tkConstructor - RULE_NOT_DESTRUCTOR_HEADING_TKDESTRUCTOR = 442, // ::= tkDestructor - RULE_QUALIFIED_IDENTIFIER = 443, // ::= - RULE_QUALIFIED_IDENTIFIER2 = 444, // ::= - RULE_QUALIFIED_IDENTIFIER_TKPOINT = 445, // ::= tkPoint - RULE_QUALIFIED_IDENTIFIER_TKPOINT2 = 446, // ::= tkPoint - RULE_NOT_PROPERTY_DEFINITION = 447, // ::= - RULE_SIMPLE_NOT_PROPERTY_DEFINITION = 448, // ::= - RULE_SIMPLE_NOT_PROPERTY_DEFINITION_TKCLASS = 449, // ::= tkClass - RULE_NOT_SIMPLE_PROPERTY_DEFINITION_TKPROPERTY_TKSEMICOLON = 450, // ::= tkProperty tkSemiColon - RULE_NOT_ARRAY_DEFAULTPROPERTY = 451, // ::= - RULE_NOT_ARRAY_DEFAULTPROPERTY_TKDEFAULT_TKSEMICOLON = 452, // ::= tkDefault tkSemiColon - RULE_NOT_PROPERTY_INTERFACE = 453, // ::= - RULE_NOT_PROPERTY_INTERFACE_TKCOLON = 454, // ::= tkColon - RULE_NOT_PROPERTY_INTERFACE_INDEX = 455, // ::= - RULE_NOT_PROPERTY_INTERFACE_INDEX_TKINDEX = 456, // ::= tkIndex - RULE_NOT_PROPERTY_PARAMETER_LIST = 457, // ::= - RULE_NOT_PROPERTY_PARAMETER_LIST_TKSQUAREOPEN_TKSQUARECLOSE = 458, // ::= tkSquareOpen tkSquareClose - RULE_NOT_PARAMETER_DECL_LIST = 459, // ::= - RULE_NOT_PARAMETER_DECL_LIST_TKSEMICOLON = 460, // ::= tkSemiColon - RULE_NOT_PARAMETER_DECL_TKCOLON = 461, // ::= tkColon - RULE_NOT_PARAMETER_DECL_TKCONST_TKCOLON = 462, // ::= tkConst tkColon - RULE_NOT_PARAMETER_DECL_TKVAR_TKCOLON = 463, // ::= tkVar tkColon - RULE_NOT_PARAMETER_DECL_TKOUT_TKCOLON = 464, // ::= tkOut tkColon - RULE_NOT_PARAMETER_NAME_LIST = 465, // ::= - RULE_OPT_IDENTIFIER = 466, // ::= - RULE_OPT_IDENTIFIER2 = 467, // ::= - RULE_NOT_PROPERTY_SPECIFIERS = 468, // ::= - RULE_NOT_PROPERTY_SPECIFIERS_TKREADONLY = 469, // ::= tkReadOnly - RULE_NOT_PROPERTY_SPECIFIERS_TKWRITEONLY = 470, // ::= tkWriteOnly - RULE_NOT_PROPERTY_SPECIFIERS_TKDEFAULT = 471, // ::= tkDefault - RULE_NOT_PROPERTY_SPECIFIERS_TKREAD = 472, // ::= tkRead - RULE_NOT_PROPERTY_SPECIFIERS_TKWRITE = 473, // ::= tkWrite - RULE_VAR_DECL_TKSEMICOLON = 474, // ::= tkSemiColon - RULE_VAR_DECL_PART = 475, // ::= - RULE_VAR_DECL_PART2 = 476, // ::= - RULE_VAR_DECL_PART_TKCOLON_TKASSIGN = 477, // ::= tkColon tkAssign - RULE_VAR_DECL_PART_IN_STMT = 478, // ::= - RULE_VAR_DECL_PART_ASSIGN_TKASSIGN = 479, // ::= tkAssign - RULE_VAR_DECL_PART_NORMAL_TKCOLON = 480, // ::= tkColon - RULE_VAR_INIT_VALUE = 481, // ::= - RULE_VAR_INIT_VALUE_TYPED = 482, // ::= - RULE_TYPED_CONST_OR_NEW = 483, // ::= - RULE_TYPED_CONST_OR_NEW2 = 484, // ::= - RULE_TYPED_CONST_OR_NEW3 = 485, // ::= - RULE_VAR_NAME_LIST = 486, // ::= - RULE_VAR_NAME_LIST_TKCOMMA = 487, // ::= tkComma - RULE_VAR_NAME = 488, // ::= - RULE_DECLARED_VAR_NAME = 489, // ::= - RULE_CONSTRUCTOR_DECL = 490, // ::= - RULE_ABC_CONSTRUCTOR_DECL = 491, // ::= - RULE_DESTRUCTOR_DECL = 492, // ::= - RULE_ABC_DESTRUCTOR_DECL = 493, // ::= - RULE_NOT_CONSTRUCTOR_BLOCK_DECL = 494, // ::= - RULE_NOT_CONSTRUCTOR_BLOCK_DECL2 = 495, // ::= - RULE_NOT_CONSTRUCTOR_BLOCK_DECL3 = 496, // ::= - RULE_PROC_DECL = 497, // ::= - RULE_PROC_DECL_TKCLASS = 498, // ::= tkClass - RULE_PROC_DECL_NOCLASS = 499, // ::= - RULE_ABC_PROC_DECL = 500, // ::= - RULE_ABC_PROC_DECL_TKCLASS = 501, // ::= tkClass - RULE_ABC_PROC_DECL_NOCLASS = 502, // ::= - RULE_FUNC_DECL = 503, // ::= - RULE_FUNC_DECL_TKCLASS = 504, // ::= tkClass - RULE_FUNC_DECL_NOCLASS = 505, // ::= - RULE_ABC_FUNC_DECL = 506, // ::= - RULE_ABC_FUNC_DECL_TKCLASS = 507, // ::= tkClass - RULE_ABC_FUNC_DECL_NOCLASS = 508, // ::= - RULE_PROC_HEADING_TKPROCEDURE = 509, // ::= tkProcedure - RULE_PROC_NAME = 510, // ::= - RULE_FUNC_NAME = 511, // ::= - RULE_FUNC_NAME_TKPOINT = 512, // ::= tkPoint - RULE_FUNC_NAME_TKPOINT_TKPOINT = 513, // ::= tkPoint tkPoint - RULE_FUNC_CLASS_NAME_IDENT = 514, // ::= - RULE_FUNC_METH_NAME_IDENT = 515, // ::= - RULE_FUNC_METH_NAME_IDENT2 = 516, // ::= - RULE_FUNC_NAME_WITH_TEMPLATE_ARGS = 517, // ::= - RULE_FUNC_NAME_WITH_TEMPLATE_ARGS2 = 518, // ::= - RULE_FUNC_NAME_IDENT = 519, // ::= - RULE_FUNC_NAME_IDENT2 = 520, // ::= - RULE_FUNC_HEADING_TKFUNCTION_TKCOLON = 521, // ::= tkFunction tkColon - RULE_FUNC_HEADING_TKFUNCTION = 522, // ::= tkFunction - RULE_PROC_BLOCK = 523, // ::= - RULE_FUNC_BLOCK = 524, // ::= - RULE_PROC_BLOCK_DECL = 525, // ::= - RULE_PROC_BLOCK_DECL2 = 526, // ::= - RULE_PROC_BLOCK_DECL3 = 527, // ::= - RULE_PROC_BLOCK_DECL_TKFORWARD_TKSEMICOLON = 528, // ::= tkForward tkSemiColon - RULE_ABC_PROC_BLOCK = 529, // ::= - RULE_ABC_PROC_BLOCK2 = 530, // ::= - RULE_EXTERNAL_DIRECTR = 531, // ::= - RULE_EXTERNAL_DIRECTR_TKSEMICOLON = 532, // ::= tkSemiColon - RULE_EXTERNAL_DIRECTR_TKEXTERNAL_TKSEMICOLON = 533, // ::= tkExternal tkSemiColon - RULE_EXTERNAL_DIRECTR_IDENT = 534, // ::= - RULE_EXTERNAL_DIRECTR_IDENT2 = 535, // ::= - RULE_ABC_EXTERNAL_DIRECTR_TKEXTERNAL_TKNAME = 536, // ::= tkExternal tkName - RULE_ABC_EXTERNAL_DIRECTR_TKEXTERNAL = 537, // ::= tkExternal - RULE_ASM_BLOCK_TKASMBODY_TKSEMICOLON = 538, // ::= tkAsmBody tkSemiColon - RULE_BLOCK_TKSEMICOLON = 539, // ::= tkSemiColon - RULE_ABC_BLOCK_TKSEMICOLON = 540, // ::= tkSemiColon - RULE_FP_LIST = 541, // ::= - RULE_FP_LIST_TKROUNDOPEN_TKROUNDCLOSE = 542, // ::= tkRoundOpen tkRoundClose - RULE_FP_SECT_LIST = 543, // ::= - RULE_FP_SECT_LIST2 = 544, // ::= - RULE_FP_SECT_LIST_TKSEMICOLON = 545, // ::= tkSemiColon - RULE_FP_SECT = 546, // ::= - RULE_SIMPLE_FP_SECT_TKCOLON = 547, // ::= tkColon - RULE_SIMPLE_FP_SECT_TKVAR_TKCOLON = 548, // ::= tkVar tkColon - RULE_SIMPLE_FP_SECT_TKOUT_TKCOLON = 549, // ::= tkOut tkColon - RULE_SIMPLE_FP_SECT_TKCONST_TKCOLON = 550, // ::= tkConst tkColon - RULE_SIMPLE_FP_SECT_TKPARAMS_TKCOLON = 551, // ::= tkParams tkColon - RULE_SIMPLE_FP_SECT_TKCOLON_TKASSIGN = 552, // ::= tkColon tkAssign - RULE_SIMPLE_FP_SECT_TKVAR_TKCOLON_TKASSIGN = 553, // ::= tkVar tkColon tkAssign - RULE_SIMPLE_FP_SECT_TKOUT_TKCOLON_TKASSIGN = 554, // ::= tkOut tkColon tkAssign - RULE_SIMPLE_FP_SECT_TKCONST_TKCOLON_TKASSIGN = 555, // ::= tkConst tkColon tkAssign - RULE_PARAM_NAME_LIST = 556, // ::= - RULE_PARAM_NAME_LIST_TKCOMMA = 557, // ::= tkComma - RULE_PARAM_NAME = 558, // ::= - RULE_FPTYPE = 559, // ::= - RULE_FPTYPE_NEW = 560, // ::= - RULE_FPTYPE_NEW_TKARRAY_TKOF_TKCONST = 561, // ::= tkArray tkOf tkConst - RULE_STMT = 562, // ::= - RULE_STMT_TKCOLON = 563, // ::= tkColon - RULE_UNLABELLED_STMT = 564, // ::= - RULE_UNLABELLED_STMT2 = 565, // ::= - RULE_UNLABELLED_STMT3 = 566, // ::= - RULE_UNLABELLED_STMT4 = 567, // ::= - RULE_UNLABELLED_STMT5 = 568, // ::= - RULE_UNLABELLED_STMT6 = 569, // ::= - RULE_UNLABELLED_STMT7 = 570, // ::= - RULE_UNLABELLED_STMT8 = 571, // ::= - RULE_UNLABELLED_STMT9 = 572, // ::= - RULE_UNLABELLED_STMT10 = 573, // ::= - RULE_UNLABELLED_STMT11 = 574, // ::= - RULE_UNLABELLED_STMT12 = 575, // ::= - RULE_UNLABELLED_STMT13 = 576, // ::= - RULE_UNLABELLED_STMT14 = 577, // ::= - RULE_UNLABELLED_STMT15 = 578, // ::= - RULE_UNLABELLED_STMT16 = 579, // ::= - RULE_UNLABELLED_STMT17 = 580, // ::= - RULE_UNLABELLED_STMT18 = 581, // ::= - RULE_UNLABELLED_STMT19 = 582, // ::= - RULE_VAR_STMT_TKVAR = 583, // ::= tkVar - RULE_ASSIGNMENT = 584, // ::= - RULE_PROC_CALL = 585, // ::= - RULE_GOTO_STMT_TKGOTO = 586, // ::= tkGoto - RULE_COMPOUND_STMT_TKBEGIN_TKEND = 587, // ::= tkBegin tkEnd - RULE_STMT_LIST = 588, // ::= - RULE_STMT_LIST_TKSEMICOLON = 589, // ::= tkSemiColon - RULE_IF_STMT_TKIF = 590, // ::= tkIf - RULE_IF_THEN_ELSE_BRANCH_TKTHEN = 591, // ::= tkThen - RULE_IF_THEN_ELSE_BRANCH_TKTHEN_TKELSE = 592, // ::= tkThen tkElse - RULE_THEN_BRANCH = 593, // ::= - RULE_ELSE_BRANCH = 594, // ::= - RULE_CASE_STMT_TKCASE_TKOF_TKEND = 595, // ::= tkCase tkOf tkEnd - RULE_CASE_LIST = 596, // ::= - RULE_CASE_LIST_TKSEMICOLON = 597, // ::= tkSemiColon - RULE_CASE_ITEM = 598, // ::= - RULE_CASE_ITEM_TKCOLON = 599, // ::= tkColon - RULE_CASE_LABEL_LIST = 600, // ::= - RULE_CASE_LABEL_LIST_TKCOMMA = 601, // ::= tkComma - RULE_CASE_LABEL = 602, // ::= - RULE_ELSE_CASE = 603, // ::= - RULE_ELSE_CASE_TKELSE = 604, // ::= tkElse - RULE_REPEAT_STMT_TKREPEAT_TKUNTIL = 605, // ::= tkRepeat tkUntil - RULE_WHILE_STMT_TKWHILE = 606, // ::= tkWhile - RULE_OPT_TK_DO_TKDO = 607, // ::= tkDo - RULE_OPT_TK_DO = 608, // ::= - RULE_LOCK_STMT_TKLOCK_TKDO = 609, // ::= tkLock tkDo - RULE_FOREACH_STMT_TKFOREACH_TKIN_TKDO = 610, // ::= tkForeach tkIn tkDo - RULE_FOREACH_STMT_TKFOREACH_TKVAR_TKCOLON_TKIN_TKDO = 611, // ::= tkForeach tkVar tkColon tkIn tkDo - RULE_FOREACH_STMT_IDENT_DYPE_OPT_TKCOLON = 612, // ::= tkColon - RULE_FOREACH_STMT_IDENT_DYPE_OPT = 613, // ::= - RULE_FOR_STMT_TKFOR = 614, // ::= tkFor - RULE_OPT_VAR_TKVAR = 615, // ::= tkVar - RULE_OPT_VAR = 616, // ::= - RULE_FOR_STMT_DECL_OR_ASSIGN_TKASSIGN = 617, // ::= tkAssign - RULE_FOR_STMT_DECL_OR_ASSIGN_TKCOLON_TKASSIGN = 618, // ::= tkColon tkAssign - RULE_FOR_CYCLE_TYPE_TKTO = 619, // ::= tkTo - RULE_FOR_CYCLE_TYPE_TKDOWNTO = 620, // ::= tkDownto - RULE_WITH_STMT_TKWITH_TKDO = 621, // ::= tkWith tkDo - RULE_INHERITED_MESSAGE_TKINHERITED = 622, // ::= tkInherited - RULE_TRY_STMT_TKTRY = 623, // ::= tkTry - RULE_TRY_HANDLER_TKFINALLY_TKEND = 624, // ::= tkFinally tkEnd - RULE_TRY_HANDLER_TKEXCEPT_TKEND = 625, // ::= tkExcept tkEnd - RULE_EXCEPTION_BLOCK = 626, // ::= - RULE_EXCEPTION_BLOCK_TKSEMICOLON = 627, // ::= tkSemiColon - RULE_EXCEPTION_BLOCK2 = 628, // ::= - RULE_EXCEPTION_HANDLER_LIST = 629, // ::= - RULE_EXCEPTION_HANDLER_LIST_TKSEMICOLON = 630, // ::= tkSemiColon - RULE_EXCEPTION_BLOCK_ELSE_BRANCH = 631, // ::= - RULE_EXCEPTION_BLOCK_ELSE_BRANCH_TKELSE = 632, // ::= tkElse - RULE_EXCEPTION_HANDLER_TKON_TKDO = 633, // ::= tkOn tkDo - RULE_EXCEPTION_IDENTIFIER = 634, // ::= - RULE_EXCEPTION_IDENTIFIER_TKCOLON = 635, // ::= tkColon - RULE_EXCEPTION_CLASS_TYPE_IDENTIFIER = 636, // ::= - RULE_EXCEPTION_VARIABLE = 637, // ::= - RULE_RAISE_STMT_TKRAISE = 638, // ::= tkRaise - RULE_RAISE_STMT_TKRAISE2 = 639, // ::= tkRaise - RULE_RAISE_STMT_TKRAISE_TKAT = 640, // ::= tkRaise tkAt - RULE_ASM_STMT_TKASMBODY = 641, // ::= tkAsmBody - RULE_EXPR_LIST = 642, // ::= - RULE_EXPR_LIST_TKCOMMA = 643, // ::= tkComma - RULE_ATTR_EXPR_LIST = 644, // ::= - RULE_EXPR_AS_STMT = 645, // ::= - RULE_ALLOWABLE_EXPR_AS_STMT = 646, // ::= - RULE_EXPR = 647, // ::= - RULE_EXPR2 = 648, // ::= - RULE_EXPR3 = 649, // ::= - RULE_EXPR_L1 = 650, // ::= - RULE_EXPR_L12 = 651, // ::= - RULE_SIZEOF_EXPR_TKSIZEOF_TKROUNDOPEN_TKROUNDCLOSE = 652, // ::= tkSizeOf tkRoundOpen tkRoundClose - RULE_TYPEOF_EXPR_TKTYPEOF_TKROUNDOPEN_TKROUNDCLOSE = 653, // ::= tkTypeOf tkRoundOpen tkRoundClose - RULE_QUESTION_EXPR_TKQUESTION_TKCOLON = 654, // ::= tkQuestion tkColon - RULE_OPT_AMPERSEND = 655, // ::= - RULE_OPT_AMPERSEND_TKAMPERSEND = 656, // ::= tkAmpersend - RULE_SIMPLE_OR_TEMPLATE_TYPE_REFERENCE = 657, // ::= - RULE_SIMPLE_OR_TEMPLATE_TYPE_REFERENCE2 = 658, // ::= - RULE_SIMPLE_OR_TEMPLATE_TYPE_REFERENCE_TKAMPERSEND = 659, // ::= tkAmpersend - RULE_OPT_ARRAY_INITIALIZER_TKROUNDOPEN_TKROUNDCLOSE = 660, // ::= tkRoundOpen tkRoundClose - RULE_OPT_ARRAY_INITIALIZER = 661, // ::= - RULE_NEW_EXPR = 662, // ::= - RULE_NEW_EXPR_TKSQUAREOPEN_TKSQUARECLOSE = 663, // ::= tkSquareOpen tkSquareClose - RULE_ARRAY_NAME_FOR_NEW_EXPR = 664, // ::= - RULE_ARRAY_NAME_FOR_NEW_EXPR2 = 665, // ::= - RULE_OPT_TEMPLATE_TYPE_PARAMS = 666, // ::= - RULE_OPT_TEMPLATE_TYPE_PARAMS2 = 667, // ::= - RULE_OPT_EXPR_LIST_WITH_BRACKET = 668, // ::= - RULE_OPT_EXPR_LIST_WITH_BRACKET_TKROUNDOPEN_TKROUNDCLOSE = 669, // ::= tkRoundOpen tkRoundClose - RULE_RELOP_EXPR = 670, // ::= - RULE_RELOP_EXPR2 = 671, // ::= - RULE_FORMAT_EXPR_TKCOLON = 672, // ::= tkColon - RULE_FORMAT_EXPR_TKCOLON_TKCOLON = 673, // ::= tkColon tkColon - RULE_RELOP_TKEQUAL = 674, // ::= tkEqual - RULE_RELOP_TKNOTEQUAL = 675, // ::= tkNotEqual - RULE_RELOP_TKLOWER = 676, // ::= tkLower - RULE_RELOP_TKGREATER = 677, // ::= tkGreater - RULE_RELOP_TKLOWEREQUAL = 678, // ::= tkLowerEqual - RULE_RELOP_TKGREATEREQUAL = 679, // ::= tkGreaterEqual - RULE_RELOP_TKIN = 680, // ::= tkIn - RULE_SIMPLE_EXPR = 681, // ::= - RULE_SIMPLE_EXPR2 = 682, // ::= - RULE_ADDOP_TKPLUS = 683, // ::= tkPlus - RULE_ADDOP_TKMINUS = 684, // ::= tkMinus - RULE_ADDOP_TKOR = 685, // ::= tkOr - RULE_ADDOP_TKXOR = 686, // ::= tkXor - RULE_ADDOP_TKCSHARPSTYLEOR = 687, // ::= tkCSharpStyleOr - RULE_TYPECAST_OP_TKAS = 688, // ::= tkAs - RULE_TYPECAST_OP_TKIS = 689, // ::= tkIs - RULE_AS_IS_EXPR = 690, // ::= - RULE_TERM = 691, // ::= - RULE_TERM2 = 692, // ::= - RULE_TERM3 = 693, // ::= - RULE_TERM4 = 694, // ::= - RULE_MULOP_TKSTAR = 695, // ::= tkStar - RULE_MULOP_TKSLASH = 696, // ::= tkSlash - RULE_MULOP_TKDIV = 697, // ::= tkDiv - RULE_MULOP_TKMOD = 698, // ::= tkMod - RULE_MULOP_TKSHL = 699, // ::= tkShl - RULE_MULOP_TKSHR = 700, // ::= tkShr - RULE_MULOP_TKAND = 701, // ::= tkAnd - RULE_DEFAULT_EXPR_TKDEFAULT_TKROUNDOPEN_TKROUNDCLOSE = 702, // ::= tkDefault tkRoundOpen tkRoundClose - RULE_FACTOR_TKNIL = 703, // ::= tkNil - RULE_FACTOR = 704, // ::= - RULE_FACTOR2 = 705, // ::= - RULE_FACTOR_TKSQUAREOPEN_TKSQUARECLOSE = 706, // ::= tkSquareOpen tkSquareClose - RULE_FACTOR_TKNOT = 707, // ::= tkNot - RULE_FACTOR3 = 708, // ::= - RULE_FACTOR_TKDEREF = 709, // ::= tkDeref - RULE_FACTOR4 = 710, // ::= - RULE_FACTOR_TKROUNDOPEN_TKROUNDCLOSE_TKROUNDOPEN_TKROUNDCLOSE = 711, // ::= tkRoundOpen tkRoundClose tkRoundOpen tkRoundClose - RULE_LITERAL_OR_NUMBER = 712, // ::= - RULE_LITERAL_OR_NUMBER2 = 713, // ::= - RULE_VAR_REFERENCE = 714, // ::= - RULE_VAR_REFERENCE2 = 715, // ::= - RULE_VAR_ADDRESS_TKADDRESSOF = 716, // ::= tkAddressOf - RULE_VAR_ADDRESS_TKADDRESSOF2 = 717, // ::= tkAddressOf - RULE_ATTRIBUTE_VARIABLE = 718, // ::= - RULE_VARIABLE = 719, // ::= - RULE_VARIABLE2 = 720, // ::= - RULE_VARIABLE_TKINHERITED = 721, // ::= tkInherited - RULE_VARIABLE_TKROUNDOPEN_TKROUNDCLOSE = 722, // ::= tkRoundOpen tkRoundClose - RULE_VARIABLE3 = 723, // ::= - RULE_VARIABLE4 = 724, // ::= - RULE_VARIABLE_TKROUNDOPEN_TKROUNDCLOSE2 = 725, // ::= tkRoundOpen tkRoundClose - RULE_VARIABLE_TKPOINT = 726, // ::= tkPoint - RULE_VARIABLE5 = 727, // ::= - RULE_OPT_EXPR_LIST = 728, // ::= - RULE_OPT_EXPR_LIST2 = 729, // ::= - RULE_OPT_ATTR_EXPR_LIST = 730, // ::= - RULE_OPT_ATTR_EXPR_LIST2 = 731, // ::= - RULE_ATTRIBUTE_VAR_SPECIFIERS_TKROUNDOPEN_TKROUNDCLOSE = 732, // ::= tkRoundOpen tkRoundClose - RULE_ATTRIBUTE_VAR_SPECIFIERS_TKPOINT = 733, // ::= tkPoint - RULE_VAR_SPECIFIERS_TKSQUAREOPEN_TKSQUARECLOSE = 734, // ::= tkSquareOpen tkSquareClose - RULE_VAR_SPECIFIERS_TKSQUAREOPEN_TKSQUARECLOSE2 = 735, // ::= tkSquareOpen tkSquareClose - RULE_VAR_SPECIFIERS_TKROUNDOPEN_TKROUNDCLOSE = 736, // ::= tkRoundOpen tkRoundClose - RULE_VAR_SPECIFIERS_TKPOINT = 737, // ::= tkPoint - RULE_VAR_SPECIFIERS_TKDEREF = 738, // ::= tkDeref - RULE_VAR_SPECIFIERS_TKAMPERSEND = 739, // ::= tkAmpersend - RULE_TEMPLATE_TYPE_BACK_VARSPECIFIERS_TKROUNDOPEN_TKROUNDCLOSE = 740, // ::= tkRoundOpen tkRoundClose - RULE_TEMPLATE_TYPE_BACK_VARSPECIFIERS_TKROUNDOPEN_TKROUNDCLOSE2 = 741, // ::= tkRoundOpen tkRoundClose - RULE_ELEM_LIST = 742, // ::= - RULE_ELEM_LIST2 = 743, // ::= - RULE_ELEM_LIST1 = 744, // ::= - RULE_ELEM_LIST1_TKCOMMA = 745, // ::= tkComma - RULE_ELEM = 746, // ::= - RULE_ELEM_TKDOTDOT = 747, // ::= tkDotDot - RULE_ONE_LITERAL_TKSTRINGLITERAL = 748, // ::= tkStringLiteral - RULE_ONE_LITERAL_TKASCIICHAR = 749, // ::= tkAsciiChar - RULE_LITERAL = 750, // ::= - RULE_LITERAL_LIST = 751, // ::= - RULE_LITERAL_LIST2 = 752, // ::= - RULE_OPERATOR_NAME_IDENT_TKOPERATOR = 753, // ::= tkOperator - RULE_OPT_METH_MODIFICATORS_TKSEMICOLON = 754, // ::= tkSemiColon - RULE_OPT_METH_MODIFICATORS_TKSEMICOLON_TKSEMICOLON = 755, // ::= tkSemiColon tkSemiColon - RULE_METH_MODIFICATORS = 756, // ::= - RULE_METH_MODIFICATORS_TKSEMICOLON = 757, // ::= tkSemiColon - RULE_INTEGER_CONST_TKINTEGER = 758, // ::= tkInteger - RULE_INTEGER_CONST_TKINTEGER2 = 759, // ::= tkInteger - RULE_INTEGER_CONST_TKHEX = 760, // ::= tkHex - RULE_INTEGER_CONST_TKHEX2 = 761, // ::= tkHex - RULE_INTEGER_CONST = 762, // ::= - RULE_INTEGER_CONST2 = 763, // ::= - RULE_IDENTIFIER_TKIDENTIFIER = 764, // ::= tkIdentifier - RULE_IDENTIFIER = 765, // ::= - RULE_IDENTIFIER2 = 766, // ::= - RULE_IDENTIFIER3 = 767, // ::= - RULE_IDENTIFIER4 = 768, // ::= - RULE_IDENTIFIER5 = 769, // ::= - RULE_IDENTIFIER6 = 770, // ::= - RULE_IDENTIFIER7 = 771, // ::= - RULE_IDENTIFIER_OR_KEYWORD = 772, // ::= - RULE_IDENTIFIER_OR_KEYWORD2 = 773, // ::= - RULE_IDENTIFIER_OR_KEYWORD3 = 774, // ::= - RULE_IDENTIFIER_KEYWORD_OPERATORNAME = 775, // ::= - RULE_IDENTIFIER_KEYWORD_OPERATORNAME2 = 776, // ::= - RULE_IDENTIFIER_KEYWORD_OPERATORNAME3 = 777, // ::= - RULE_REAL_TYPE_NAME_TKREAL = 778, // ::= tkReal - RULE_REAL_TYPE_NAME_TKSINGLE = 779, // ::= tkSingle - RULE_REAL_TYPE_NAME_TKDOUBLE = 780, // ::= tkDouble - RULE_REAL_TYPE_NAME_TKEXTENDED = 781, // ::= tkExtended - RULE_REAL_TYPE_NAME_TKCOMP = 782, // ::= tkComp - RULE_ORD_TYPE_NAME_TKSHORTINT = 783, // ::= tkShortInt - RULE_ORD_TYPE_NAME_TKSMALLINT = 784, // ::= tkSmallInt - RULE_ORD_TYPE_NAME_TKORDINTEGER = 785, // ::= tkOrdInteger - RULE_ORD_TYPE_NAME_TKBYTE = 786, // ::= tkByte - RULE_ORD_TYPE_NAME_TKLONGINT = 787, // ::= tkLongInt - RULE_ORD_TYPE_NAME_TKINT64 = 788, // ::= tkInt64 - RULE_ORD_TYPE_NAME_TKWORD = 789, // ::= tkWord - RULE_ORD_TYPE_NAME_TKBOOLEAN = 790, // ::= tkBoolean - RULE_ORD_TYPE_NAME_TKCHAR = 791, // ::= tkChar - RULE_ORD_TYPE_NAME_TKWIDECHAR = 792, // ::= tkWideChar - RULE_ORD_TYPE_NAME_TKLONGWORD = 793, // ::= tkLongWord - RULE_ORD_TYPE_NAME_TKPCHAR = 794, // ::= tkPChar - RULE_ORD_TYPE_NAME_TKCARDINAL = 795, // ::= tkCardinal - RULE_VARIANT_TYPE_NAME_TKVARIANT = 796, // ::= tkVariant - RULE_VARIANT_TYPE_NAME_TKOLEVARIANT = 797, // ::= tkOleVariant - RULE_METH_MODIFICATOR_TKABSTRACT = 798, // ::= tkAbstract - RULE_METH_MODIFICATOR_TKOVERLOAD = 799, // ::= tkOverload - RULE_METH_MODIFICATOR_TKREINTRODUCE = 800, // ::= tkReintroduce - RULE_METH_MODIFICATOR_TKOVERRIDE = 801, // ::= tkOverride - RULE_METH_MODIFICATOR_TKVIRTUAL = 802, // ::= tkVirtual - RULE_METH_MODIFICATOR_TKSTATIC = 803, // ::= tkStatic - RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKREAD = 804, // ::= tkRead - RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKWRITE = 805, // ::= tkWrite - RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKSTORED = 806, // ::= tkStored - RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKNODEFAULT = 807, // ::= tkNodefault - RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKIMPLEMENTS = 808, // ::= tkImplements - RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKWRITEONLY = 809, // ::= tkWriteOnly - RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKREADONLY = 810, // ::= tkReadOnly - RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKDISPID = 811, // ::= tkDispid - RULE_NON_RESERVED_TKAT = 812, // ::= tkAt - RULE_NON_RESERVED_TKABSOLUTE = 813, // ::= tkAbsolute - RULE_NON_RESERVED_TKON = 814, // ::= tkOn - RULE_NON_RESERVED_TKNAME = 815, // ::= tkName - RULE_NON_RESERVED_TKINDEX = 816, // ::= tkIndex - RULE_NON_RESERVED_TKMESSAGE = 817, // ::= tkMessage - RULE_NON_RESERVED_TKCONTAINS = 818, // ::= tkContains - RULE_NON_RESERVED_TKREQUIRES = 819, // ::= tkRequires - RULE_NON_RESERVED_TKFORWARD = 820, // ::= tkForward - RULE_NON_RESERVED_TKOUT = 821, // ::= tkOut - RULE_VISIBILITY_SPECIFIER_TKINTERNAL = 822, // ::= tkInternal - RULE_VISIBILITY_SPECIFIER_TKPUBLIC = 823, // ::= tkPublic - RULE_VISIBILITY_SPECIFIER_TKPROTECTED = 824, // ::= tkProtected - RULE_VISIBILITY_SPECIFIER_TKPRIVATE = 825, // ::= tkPrivate - RULE_OTHER_TKPACKAGE = 826, // ::= tkPackage - RULE_OTHER_TKUNIT = 827, // ::= tkUnit - RULE_OTHER_TKLIBRARY = 828, // ::= tkLibrary - RULE_OTHER_TKEXTERNAL = 829, // ::= tkExternal - RULE_OTHER_TKPARAMS = 830, // ::= tkParams - RULE_KEYWORD = 831, // ::= - RULE_KEYWORD_TKFINAL = 832, // ::= tkFinal - RULE_KEYWORD_TKTEMPLATE = 833, // ::= tkTemplate - RULE_KEYWORD_TKOR = 834, // ::= tkOr - RULE_KEYWORD_TKTYPEOF = 835, // ::= tkTypeOf - RULE_KEYWORD_TKSIZEOF = 836, // ::= tkSizeOf - RULE_KEYWORD_TKDEFAULT = 837, // ::= tkDefault - RULE_KEYWORD_TKWHERE = 838, // ::= tkWhere - RULE_KEYWORD_TKXOR = 839, // ::= tkXor - RULE_KEYWORD_TKAND = 840, // ::= tkAnd - RULE_KEYWORD_TKDIV = 841, // ::= tkDiv - RULE_KEYWORD_TKMOD = 842, // ::= tkMod - RULE_KEYWORD_TKSHL = 843, // ::= tkShl - RULE_KEYWORD_TKSHR = 844, // ::= tkShr - RULE_KEYWORD_TKNOT = 845, // ::= tkNot - RULE_KEYWORD_TKAS = 846, // ::= tkAs - RULE_KEYWORD_TKIN = 847, // ::= tkIn - RULE_KEYWORD_TKIS = 848, // ::= tkIs - RULE_KEYWORD_TKARRAY = 849, // ::= tkArray - RULE_KEYWORD_TKBEGIN = 850, // ::= tkBegin - RULE_KEYWORD_TKCASE = 851, // ::= tkCase - RULE_KEYWORD_TKCLASS = 852, // ::= tkClass - RULE_KEYWORD_TKCONST = 853, // ::= tkConst - RULE_KEYWORD_TKCONSTRUCTOR = 854, // ::= tkConstructor - RULE_KEYWORD_TKDESTRUCTOR = 855, // ::= tkDestructor - RULE_KEYWORD_TKDOWNTO = 856, // ::= tkDownto - RULE_KEYWORD_TKDO = 857, // ::= tkDo - RULE_KEYWORD_TKELSE = 858, // ::= tkElse - RULE_KEYWORD_TKEXCEPT = 859, // ::= tkExcept - RULE_KEYWORD_TKFILE = 860, // ::= tkFile - RULE_KEYWORD_TKFINALIZATION = 861, // ::= tkFinalization - RULE_KEYWORD_TKFINALLY = 862, // ::= tkFinally - RULE_KEYWORD_TKFOR = 863, // ::= tkFor - RULE_KEYWORD_TKFOREACH = 864, // ::= tkForeach - RULE_KEYWORD_TKFUNCTION = 865, // ::= tkFunction - RULE_KEYWORD_TKIF = 866, // ::= tkIf - RULE_KEYWORD_TKIMPLEMENTATION = 867, // ::= tkImplementation - RULE_KEYWORD_TKINHERITED = 868, // ::= tkInherited - RULE_KEYWORD_TKINITIALIZATION = 869, // ::= tkInitialization - RULE_KEYWORD_TKINTERFACE = 870, // ::= tkInterface - RULE_KEYWORD_TKPROCEDURE = 871, // ::= tkProcedure - RULE_KEYWORD_TKPROPERTY = 872, // ::= tkProperty - RULE_KEYWORD_TKRAISE = 873, // ::= tkRaise - RULE_KEYWORD_TKRECORD = 874, // ::= tkRecord - RULE_KEYWORD_TKREPEAT = 875, // ::= tkRepeat - RULE_KEYWORD_TKSET = 876, // ::= tkSet - RULE_KEYWORD_TKTRY = 877, // ::= tkTry - RULE_KEYWORD_TKTYPE = 878, // ::= tkType - RULE_KEYWORD_TKTHEN = 879, // ::= tkThen - RULE_KEYWORD_TKTO = 880, // ::= tkTo - RULE_KEYWORD_TKUNTIL = 881, // ::= tkUntil - RULE_KEYWORD_TKUSES = 882, // ::= tkUses - RULE_KEYWORD_TKUSING = 883, // ::= tkUsing - RULE_KEYWORD_TKVAR = 884, // ::= tkVar - RULE_KEYWORD_TKWHILE = 885, // ::= tkWhile - RULE_KEYWORD_TKWITH = 886, // ::= tkWith - RULE_KEYWORD_TKNIL = 887, // ::= tkNil - RULE_KEYWORD_TKGOTO = 888, // ::= tkGoto - RULE_KEYWORD_TKOF = 889, // ::= tkOf - RULE_KEYWORD_TKLABEL = 890, // ::= tkLabel - RULE_KEYWORD_TKPROGRAM = 891, // ::= tkProgram - RULE_RESERVED_KEYWORD_TKOPERATOR = 892, // ::= tkOperator - RULE_RESERVED_KEYWORD_TKEND = 893, // ::= tkEnd - RULE_OVERLOAD_OPERATOR_TKMINUS = 894, // ::= tkMinus - RULE_OVERLOAD_OPERATOR_TKPLUS = 895, // ::= tkPlus - RULE_OVERLOAD_OPERATOR_TKSQUAREOPEN_TKSQUARECLOSE = 896, // ::= tkSquareOpen tkSquareClose - RULE_OVERLOAD_OPERATOR_TKROUNDOPEN_TKROUNDCLOSE = 897, // ::= tkRoundOpen tkRoundClose - RULE_OVERLOAD_OPERATOR_TKSLASH = 898, // ::= tkSlash - RULE_OVERLOAD_OPERATOR_TKSTAR = 899, // ::= tkStar - RULE_OVERLOAD_OPERATOR_TKEQUAL = 900, // ::= tkEqual - RULE_OVERLOAD_OPERATOR_TKGREATER = 901, // ::= tkGreater - RULE_OVERLOAD_OPERATOR_TKGREATEREQUAL = 902, // ::= tkGreaterEqual - RULE_OVERLOAD_OPERATOR_TKLOWER = 903, // ::= tkLower - RULE_OVERLOAD_OPERATOR_TKLOWEREQUAL = 904, // ::= tkLowerEqual - RULE_OVERLOAD_OPERATOR_TKNOTEQUAL = 905, // ::= tkNotEqual - RULE_OVERLOAD_OPERATOR_TKOR = 906, // ::= tkOr - RULE_OVERLOAD_OPERATOR_TKXOR = 907, // ::= tkXor - RULE_OVERLOAD_OPERATOR_TKAND = 908, // ::= tkAnd - RULE_OVERLOAD_OPERATOR_TKDIV = 909, // ::= tkDiv - RULE_OVERLOAD_OPERATOR_TKMOD = 910, // ::= tkMod - RULE_OVERLOAD_OPERATOR_TKSHL = 911, // ::= tkShl - RULE_OVERLOAD_OPERATOR_TKSHR = 912, // ::= tkShr - RULE_OVERLOAD_OPERATOR_TKNOT = 913, // ::= tkNot - RULE_OVERLOAD_OPERATOR_TKIN = 914, // ::= tkIn - RULE_OVERLOAD_OPERATOR_TKADDRESSOF = 915, // ::= tkAddressOf - RULE_OVERLOAD_OPERATOR_TKDEREF = 916, // ::= tkDeref - RULE_OVERLOAD_OPERATOR_TKIMPLICIT = 917, // ::= tkImplicit - RULE_OVERLOAD_OPERATOR_TKEXPLICIT = 918, // ::= tkExplicit - RULE_OVERLOAD_OPERATOR = 919, // ::= - RULE_ASSIGN_OPERATOR_TKASSIGN = 920, // ::= tkAssign - RULE_ASSIGN_OPERATOR_TKPLUSEQUAL = 921, // ::= tkPlusEqual - RULE_ASSIGN_OPERATOR_TKMINUSEQUAL = 922, // ::= tkMinusEqual - RULE_ASSIGN_OPERATOR_TKMULTEQUAL = 923, // ::= tkMultEqual - RULE_ASSIGN_OPERATOR_TKDIVEQUAL = 924, // ::= tkDivEqual - RULE_EMPTY = 925, // ::= - RULE_ERROR_TKERROR = 926, // ::= tkError - RULE_FUNC_DECL_LAMBDA_TKARROW = 927, // ::= tkArrow - RULE_FUNC_DECL_LAMBDA_TKARROW2 = 928, // ::= tkArrow - RULE_FUNC_DECL_LAMBDA_TKROUNDOPEN_TKROUNDCLOSE_TKARROW = 929, // ::= tkRoundOpen tkRoundClose tkArrow - RULE_IDENT_LIST1_TKROUNDOPEN_TKCOMMA_TKROUNDCLOSE = 930, // ::= tkRoundOpen tkComma tkRoundClose - RULE_IDENT_LIST1 = 931, // ::= - RULE_IDENT_LIST1_TKROUNDOPEN_TKCOLON_TKCOMMA_TKROUNDCLOSE = 932, // ::= tkRoundOpen tkColon tkComma tkRoundClose - RULE_IDENT_LIST1_TKROUNDOPEN_TKCOLON_TKROUNDCLOSE = 933, // ::= tkRoundOpen tkColon tkRoundClose - RULE_IDENT_LIST2_TKCOMMA = 934, // ::= tkComma - RULE_IDENT_LIST2 = 935, // ::= - RULE_VAR_OR_IDENTIFIER = 936, // ::= - RULE_VAR_OR_IDENTIFIER_TKCOLON = 937, // ::= tkColon - RULE_LAMBDA_BODY = 938, // ::= - RULE_LAMBDA_BODY2 = 939 // ::= -}; - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -private Object CreateTerminalObject(int TokenSymbolIndex) -{ -switch (TokenSymbolIndex) -{ - case (int)SymbolConstants.SYMBOL_EOF : - //(EOF) - //TERMINAL:EOF - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ERROR : - //(Error) - //TERMINAL:Error - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_WHITESPACE : - //(Whitespace) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Whitespace' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_COMMENTEND : - //(Comment End) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment End' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_COMMENTLINE : - //(Comment Line) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment Line' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_COMMENTSTART : - //(Comment Start) - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'Comment Start' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_TKABSOLUTE : - //tkAbsolute - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKABSTRACT : - //tkAbstract - - { - procedure_attribute _procedure_attribute=new procedure_attribute(proc_attribute.attr_abstract); - - //_procedure_attribute.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _procedure_attribute.source_context=parsertools.GetTokenSourceContext(); - _procedure_attribute.name=LRParser.TokenText; - return _procedure_attribute; - } - - case (int)SymbolConstants.SYMBOL_TKADDRESSOF : - //tkAddressOf - - { - op_type_node _op_type_node=new op_type_node(Operators.AddressOf); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKAMPERSEND : - //tkAmpersend - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKAND : - //tkAnd - - { - op_type_node _op_type_node=new op_type_node(Operators.LogicalAND); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - _op_type_node.text=LRParser.TokenText; - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKARRAY : - //tkArray - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKARROW : - //tkArrow -{token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - pascalABC_lambda_definitions.Add(null);//tasha 7.05.2010 - return _token_info;} - case (int)SymbolConstants.SYMBOL_TKAS : - //tkAs - - { - op_type_node _op_type_node=new op_type_node(Operators.As); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - _op_type_node.text=LRParser.TokenText; - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKASCIICHAR : - //tkAsciiChar -return parsertools.create_sharp_char_const(this); - case (int)SymbolConstants.SYMBOL_TKASMBODY : - //tkAsmBody - //TERMINAL:tkAsmBody - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKASSEMBLER : - //tkAssembler - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKASSIGN : - //tkAssign - - { - op_type_node _op_type_node=new op_type_node(Operators.Assignment); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKAT : - //tkAt - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKAUTOMATED : - //tkAutomated - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKBEGIN : - //tkBegin - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKBOOLEAN : - //tkBoolean - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKBYTE : - //tkByte - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKCARDINAL : - //tkCardinal - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKCASE : - //tkCase - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCHAR : - //tkChar - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKCLASS : - //tkClass - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCOLON : - //tkColon - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCOMMA : - //tkComma - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCOMP : - //tkComp - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKCONST : - //tkConst - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCONSTRUCTOR : - //tkConstructor - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKCONTAINS : - //tkContains - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKCSHARPSTYLEOR : - //tkCSharpStyleOr - - { - op_type_node _op_type_node=new op_type_node(Operators.LogicalOR); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKDEFAULT : - //tkDefault - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKDEREF : - //tkDeref - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKDESTRUCTOR : - //tkDestructor - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKDIRECTIVENAME : - //tkDirectiveName -return parsertools.create_directive_name(this); - case (int)SymbolConstants.SYMBOL_TKDISPID : - //tkDispid - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKDIV : - //tkDiv - - { - op_type_node _op_type_node=new op_type_node(Operators.IntegerDivision); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - _op_type_node.text=LRParser.TokenText; - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKDIVEQUAL : - //tkDivEqual - - { - op_type_node _op_type_node=new op_type_node(Operators.AssignmentDivision); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKDO : - //tkDo - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKDOTDOT : - //tkDotDot - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKDOUBLE : - //tkDouble - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKDOWNTO : - //tkDownto - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKELSE : - //tkElse - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKEND : - //tkEnd - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKEQUAL : - //tkEqual - - { - op_type_node _op_type_node=new op_type_node(Operators.Equal); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKERROR : - //tkError - //TERMINAL:tkError - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TKEVENT : - //tkEvent - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKEXCEPT : - //tkExcept - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKEXPLICIT : - //tkExplicit - - { - op_type_node _op_type_node=new op_type_node(Operators.Explicit); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - _op_type_node.text=LRParser.TokenText; - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKEXPORTS : - //tkExports - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'tkExports' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_TKEXTENDED : - //tkExtended - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKEXTERNAL : - //tkExternal - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKFILE : - //tkFile - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKFINAL : - //tkFinal - - { - token_taginfo _token_taginfo=new token_taginfo(class_attribute.Sealed); - - //_token_taginfo.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_taginfo.source_context=parsertools.GetTokenSourceContext(); - - return _token_taginfo; - } - - case (int)SymbolConstants.SYMBOL_TKFINALIZATION : - //tkFinalization - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKFINALLY : - //tkFinally - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKFLOAT : - //tkFloat -return parsertools.create_double_const(this); - case (int)SymbolConstants.SYMBOL_TKFOR : - //tkFor - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKFOREACH : - //tkForeach - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKFORWARD : - //tkForward - - { - procedure_attribute _procedure_attribute=new procedure_attribute(proc_attribute.attr_forward); - - //_procedure_attribute.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _procedure_attribute.source_context=parsertools.GetTokenSourceContext(); - _procedure_attribute.name=LRParser.TokenText; - return _procedure_attribute; - } - - case (int)SymbolConstants.SYMBOL_TKFUNCTION : - //tkFunction - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKGOTO : - //tkGoto - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKGREATER : - //tkGreater - - { - op_type_node _op_type_node=new op_type_node(Operators.Greater); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKGREATEREQUAL : - //tkGreaterEqual - - { - op_type_node _op_type_node=new op_type_node(Operators.GreaterEqual); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKHEX : - //tkHex -return parsertools.create_hex_const(this); - case (int)SymbolConstants.SYMBOL_TKIDENTIFIER : - //tkIdentifier -return parsertools.create_ident(this); - case (int)SymbolConstants.SYMBOL_TKIF : - //tkIf - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKILCODE : - //tkILCode - - case (int)SymbolConstants.SYMBOL_TKIMPLEMENTATION : - //tkImplementation - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKIMPLEMENTS : - //tkImplements - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKIMPLICIT : - //tkImplicit - - { - op_type_node _op_type_node=new op_type_node(Operators.Implicit); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - _op_type_node.text=LRParser.TokenText; - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKIN : - //tkIn - - { - op_type_node _op_type_node=new op_type_node(Operators.In); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - _op_type_node.text=LRParser.TokenText; - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKINDEX : - //tkIndex - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKINHERITED : - //tkInherited - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKINITIALIZATION : - //tkInitialization - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKINLINE : - //tkInline - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'tkInline' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_TKINT64 : - //tkInt64 - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKINTEGER : - //tkInteger -return parsertools.create_int_const(this); - case (int)SymbolConstants.SYMBOL_TKINTERFACE : - //tkInterface - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKINTERNAL : - //tkInternal - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKIS : - //tkIs - - { - op_type_node _op_type_node=new op_type_node(Operators.Is); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - _op_type_node.text=LRParser.TokenText; - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKLABEL : - //tkLabel - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKLIBRARY : - //tkLibrary - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKLOCK : - //tkLock - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKLONGINT : - //tkLongInt - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKLONGWORD : - //tkLongWord - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKLOWER : - //tkLower - - { - op_type_node _op_type_node=new op_type_node(Operators.Less); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKLOWEREQUAL : - //tkLowerEqual - - { - op_type_node _op_type_node=new op_type_node(Operators.LessEqual); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKMESSAGE : - //tkMessage - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKMINUS : - //tkMinus - - { - op_type_node _op_type_node=new op_type_node(Operators.Minus); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKMINUSEQUAL : - //tkMinusEqual - - { - op_type_node _op_type_node=new op_type_node(Operators.AssignmentSubtraction); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKMOD : - //tkMod - - { - op_type_node _op_type_node=new op_type_node(Operators.ModulusRemainder); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - _op_type_node.text=LRParser.TokenText; - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKMULTEQUAL : - //tkMultEqual - - { - op_type_node _op_type_node=new op_type_node(Operators.AssignmentMultiplication); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKNAME : - //tkName - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKNIL : - //tkNil - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKNODEFAULT : - //tkNodefault - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKNOT : - //tkNot - - { - op_type_node _op_type_node=new op_type_node(Operators.LogicalNOT); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - _op_type_node.text=LRParser.TokenText; - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKNOTEQUAL : - //tkNotEqual - - { - op_type_node _op_type_node=new op_type_node(Operators.NotEqual); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKOF : - //tkOf - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKOLEVARIANT : - //tkOleVariant - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKON : - //tkOn - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKOPERATOR : - //tkOperator - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKOR : - //tkOr - - { - op_type_node _op_type_node=new op_type_node(Operators.LogicalOR); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - _op_type_node.text=LRParser.TokenText; - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKORDINTEGER : - //tkOrdInteger - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKOUT : - //tkOut - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKOVERLOAD : - //tkOverload - - { - procedure_attribute _procedure_attribute=new procedure_attribute(proc_attribute.attr_overload); - - //_procedure_attribute.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _procedure_attribute.source_context=parsertools.GetTokenSourceContext(); - _procedure_attribute.name=LRParser.TokenText; - return _procedure_attribute; - } - - case (int)SymbolConstants.SYMBOL_TKOVERRIDE : - //tkOverride - - { - procedure_attribute _procedure_attribute=new procedure_attribute(proc_attribute.attr_override); - - //_procedure_attribute.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _procedure_attribute.source_context=parsertools.GetTokenSourceContext(); - _procedure_attribute.name=LRParser.TokenText; - return _procedure_attribute; - } - - case (int)SymbolConstants.SYMBOL_TKPACKAGE : - //tkPackage - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKPACKED : - //tkPacked - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'tkPacked' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_TKPARAMS : - //tkParams - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKPARSEMODEEXPRESSION : - //tkParseModeExpression - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'tkParseModeExpression' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_TKPARSEMODESTATEMENT : - //tkParseModeStatement - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'tkParseModeStatement' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_TKPCHAR : - //tkPChar - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKPLUS : - //tkPlus - - { - op_type_node _op_type_node=new op_type_node(Operators.Plus); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKPLUSEQUAL : - //tkPlusEqual - - { - op_type_node _op_type_node=new op_type_node(Operators.AssignmentAddition); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKPOINT : - //tkPoint - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKPRIVATE : - //tkPrivate - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKPROCEDURE : - //tkProcedure - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKPROGRAM : - //tkProgram - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKPROPERTY : - //tkProperty - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKPROTECTED : - //tkProtected - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKPUBLIC : - //tkPublic - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKQUESTION : - //tkQuestion - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKRAISE : - //tkRaise - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKREAD : - //tkRead - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKREADONLY : - //tkReadOnly - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKREAL : - //tkReal - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKRECORD : - //tkRecord - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKREINTRODUCE : - //tkReintroduce - - { - procedure_attribute _procedure_attribute=new procedure_attribute(proc_attribute.attr_reintroduce); - - //_procedure_attribute.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _procedure_attribute.source_context=parsertools.GetTokenSourceContext(); - _procedure_attribute.name=LRParser.TokenText; - return _procedure_attribute; - } - - case (int)SymbolConstants.SYMBOL_TKREPEAT : - //tkRepeat - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKREQUIRES : - //tkRequires - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKRESIDENT : - //tkResident - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKRESOURCESTRING : - //tkResourceString - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'tkResourceString' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_TKROUNDCLOSE : - //tkRoundClose - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKROUNDOPEN : - //tkRoundOpen - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSEMICOLON : - //tkSemiColon - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSET : - //tkSet - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSHL : - //tkShl - - { - op_type_node _op_type_node=new op_type_node(Operators.BitwiseLeftShift); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - _op_type_node.text=LRParser.TokenText; - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKSHORTINT : - //tkShortInt - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKSHR : - //tkShr - - { - op_type_node _op_type_node=new op_type_node(Operators.BitwiseRightShift); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - _op_type_node.text=LRParser.TokenText; - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKSINGLE : - //tkSingle - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKSIZEOF : - //tkSizeOf - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSLASH : - //tkSlash - - { - op_type_node _op_type_node=new op_type_node(Operators.Division); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKSMALLINT : - //tkSmallInt - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKSQUARECLOSE : - //tkSquareClose - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSQUAREOPEN : - //tkSquareOpen - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKSTAR : - //tkStar - - { - op_type_node _op_type_node=new op_type_node(Operators.Multiplication); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_TKSTATIC : - //tkStatic - - { - procedure_attribute _procedure_attribute=new procedure_attribute(proc_attribute.attr_static); - - //_procedure_attribute.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _procedure_attribute.source_context=parsertools.GetTokenSourceContext(); - _procedure_attribute.name=LRParser.TokenText; - return _procedure_attribute; - } - - case (int)SymbolConstants.SYMBOL_TKSTORED : - //tkStored - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKSTRINGLITERAL : - //tkStringLiteral -return parsertools.create_string_const(this); - case (int)SymbolConstants.SYMBOL_TKTEMPLATE : - //tkTemplate - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKTHEN : - //tkThen - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKTHREADVAR : - //tkThreadvar - /*Console.Error.WriteLine("\n\rwarning: TerminalToken 'tkThreadvar' return NULL! \n\r");*/return null; - case (int)SymbolConstants.SYMBOL_TKTO : - //tkTo - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKTRY : - //tkTry - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKTYPE : - //tkType - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKTYPEOF : - //tkTypeOf - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKUNIT : - //tkUnit - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKUNTIL : - //tkUntil - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKUSES : - //tkUses - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKUSING : - //tkUsing - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKVAR : - //tkVar - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKVARIANT : - //tkVariant - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKVIRTUAL : - //tkVirtual - - { - procedure_attribute _procedure_attribute=new procedure_attribute(proc_attribute.attr_virtual); - - //_procedure_attribute.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _procedure_attribute.source_context=parsertools.GetTokenSourceContext(); - _procedure_attribute.name=LRParser.TokenText; - return _procedure_attribute; - } - - case (int)SymbolConstants.SYMBOL_TKWHERE : - //tkWhere - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKWHILE : - //tkWhile - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKWIDECHAR : - //tkWideChar - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKWITH : - //tkWith - - { - token_info _token_info=new token_info(LRParser.TokenText); - - //_token_info.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _token_info.source_context=parsertools.GetTokenSourceContext(); - - return _token_info; - } - - case (int)SymbolConstants.SYMBOL_TKWORD : - //tkWord - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKWRITE : - //tkWrite - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKWRITEONLY : - //tkWriteOnly - - { - ident _ident=new ident(LRParser.TokenText); - - //_ident.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _ident.source_context=parsertools.GetTokenSourceContext(); - - return _ident; - } - - case (int)SymbolConstants.SYMBOL_TKXOR : - //tkXor - - { - op_type_node _op_type_node=new op_type_node(Operators.BitwiseXOR); - - //_op_type_node.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _op_type_node.source_context=parsertools.GetTokenSourceContext(); - _op_type_node.text=LRParser.TokenText; - return _op_type_node; - } - - case (int)SymbolConstants.SYMBOL_ZKCOMMA : - //zkComma - //TERMINAL:zkComma - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_BLOCK : - // - //TERMINAL:abc_block - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_CONSTRUCTOR_DECL : - // - //TERMINAL:abc_constructor_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_DECL_SECT : - // - //TERMINAL:abc_decl_sect - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_DECL_SECT_LIST : - // - //TERMINAL:abc_decl_sect_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_DECL_SECT_LIST1 : - // - //TERMINAL:abc_decl_sect_list1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_DESTRUCTOR_DECL : - // - //TERMINAL:abc_destructor_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_EXTERNAL_DIRECTR : - // - //TERMINAL:abc_external_directr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_FUNC_DECL : - // - //TERMINAL:abc_func_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_FUNC_DECL_NOCLASS : - // - //TERMINAL:abc_func_decl_noclass - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_INTERFACE_PART : - // - //TERMINAL:abc_interface_part - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_METHOD_DECL : - // - //TERMINAL:abc_method_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_PROC_BLOCK : - // - //TERMINAL:abc_proc_block - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_PROC_DECL : - // - //TERMINAL:abc_proc_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ABC_PROC_DECL_NOCLASS : - // - //TERMINAL:abc_proc_decl_noclass - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ADDOP : - // - //TERMINAL:addop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ALLOWABLE_EXPR_AS_STMT : - // - //TERMINAL:allowable_expr_as_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ARRAY_CONST : - // - //TERMINAL:array_const - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ARRAY_NAME_FOR_NEW_EXPR : - // - //TERMINAL:array_name_for_new_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ARRAY_TYPE : - // - //TERMINAL:array_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_AS_IS_CONSTEXPR : - // - //TERMINAL:as_is_constexpr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_AS_IS_EXPR : - // - //TERMINAL:as_is_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ASM_BLOCK : - // - //TERMINAL:asm_block - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ASM_STMT : - // - //TERMINAL:asm_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ASSIGN_OPERATOR : - // - //TERMINAL:assign_operator - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ASSIGNMENT : - // - //TERMINAL:assignment - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ATTR_EXPR_LIST : - // - //TERMINAL:attr_expr_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ATTRIBUTE_DECLARATION : - // - //TERMINAL:attribute_declaration - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ATTRIBUTE_DECLARATIONS : - // - //TERMINAL:attribute_declarations - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ATTRIBUTE_VAR_SPECIFIERS : - // - //TERMINAL:attribute_var_specifiers - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ATTRIBUTE_VARIABLE : - // - //TERMINAL:attribute_variable - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_BASE_CLASS_NAME : - // - //TERMINAL:base_class_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_BASE_CLASSES_NAMES_LIST : - // - //TERMINAL:base_classes_names_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_BLOCK : - // - //TERMINAL:block - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CASE_ITEM : - // - //TERMINAL:case_item - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CASE_LABEL : - // - //TERMINAL:case_label - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CASE_LABEL_LIST : - // - //TERMINAL:case_label_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CASE_LIST : - // - //TERMINAL:case_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CASE_STMT : - // - //TERMINAL:case_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CASE_TAG_LIST : - // - //TERMINAL:case_tag_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CLASS_ATTRIBUTES : - // - //TERMINAL:class_attributes - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CLASS_OR_INTERFACE_KEYWORD : - // - //TERMINAL:class_or_interface_keyword - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_COMPOUND_STMT : - // - //TERMINAL:compound_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_ADDOP : - // - //TERMINAL:const_addop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_DECL : - // - //TERMINAL:const_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_DECL_SECT : - // - //TERMINAL:const_decl_sect - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_ELEM : - // - //TERMINAL:const_elem - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_ELEM_LIST : - // - //TERMINAL:const_elem_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_ELEM_LIST1 : - // - //TERMINAL:const_elem_list1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_EXPR : - // - //TERMINAL:const_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_EXPR_LIST : - // - //TERMINAL:const_expr_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_FACTOR : - // - //TERMINAL:const_factor - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_FIELD : - // - //TERMINAL:const_field - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_FIELD_LIST : - // - //TERMINAL:const_field_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_FIELD_LIST_1 : - // - //TERMINAL:const_field_list_1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_FIELD_NAME : - // - //TERMINAL:const_field_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_FUNC_EXPR_LIST : - // - //TERMINAL:const_func_expr_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_MULOP : - // - //TERMINAL:const_mulop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_NAME : - // - //TERMINAL:const_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_RELOP : - // - //TERMINAL:const_relop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_SET : - // - //TERMINAL:const_set - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_SIMPLE_EXPR : - // - //TERMINAL:const_simple_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_TERM : - // - //TERMINAL:const_term - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_VARIABLE : - // - //TERMINAL:const_variable - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONST_VARIABLE_2 : - // - //TERMINAL:const_variable_2 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONSTRUCTOR_DECL : - // - //TERMINAL:constructor_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONSTRUCTOR_DECL_WITH_ATTR : - // - //TERMINAL:constructor_decl_with_attr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_CONTAINS_CLAUSE : - // - //TERMINAL:contains_clause - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_DECLARED_VAR_NAME : - // - //TERMINAL:declared_var_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_DEFAULT_EXPR : - // - //TERMINAL:default_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_DESTRUCTOR_DECL : - // - //TERMINAL:destructor_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_DESTRUCTOR_DECL_WITH_ATTR : - // - //TERMINAL:destructor_decl_with_attr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ELEM : - // - //TERMINAL:elem - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ELEM_LIST : - // - //TERMINAL:elem_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ELEM_LIST1 : - // - //TERMINAL:elem_list1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ELSE_BRANCH : - // - //TERMINAL:else_branch - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ELSE_CASE : - // - //TERMINAL:else_case - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EMPTY : - // - //TERMINAL:empty - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ENUMERATION_ID : - // - //TERMINAL:enumeration_id - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ENUMERATION_ID_LIST : - // - //TERMINAL:enumeration_id_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ERROR2 : - // - //TERMINAL:error - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXCEPTION_BLOCK : - // - //TERMINAL:exception_block - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXCEPTION_BLOCK_ELSE_BRANCH : - // - //TERMINAL:exception_block_else_branch - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXCEPTION_CLASS_TYPE_IDENTIFIER : - // - //TERMINAL:exception_class_type_identifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXCEPTION_HANDLER : - // - //TERMINAL:exception_handler - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXCEPTION_HANDLER_LIST : - // - //TERMINAL:exception_handler_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXCEPTION_IDENTIFIER : - // - //TERMINAL:exception_identifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXCEPTION_VARIABLE : - // - //TERMINAL:exception_variable - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPORT_CLAUSE : - // - //TERMINAL:export_clause - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPORTS_ENTRY : - // - //TERMINAL:exports_entry - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPORTS_INDEX : - // - //TERMINAL:exports_index - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPORTS_LIST : - // - //TERMINAL:exports_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPORTS_NAME : - // - //TERMINAL:exports_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPORTS_RESIDENT : - // - //TERMINAL:exports_resident - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPR : - // - //TERMINAL:expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPR_AS_STMT : - // - //TERMINAL:expr_as_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPR_L1 : - // - //TERMINAL:expr_l1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXPR_LIST : - // - //TERMINAL:expr_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXTERNAL_DIRECTR : - // - //TERMINAL:external_directr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_EXTERNAL_DIRECTR_IDENT : - // - //TERMINAL:external_directr_ident - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FACTOR : - // - //TERMINAL:factor - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FIELD_ACCESS_MODIFIER : - // - //TERMINAL:field_access_modifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FIELD_LIST : - // - //TERMINAL:field_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FILE_TYPE : - // - //TERMINAL:file_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FILED_OR_CONST_DEFINITION : - // - //TERMINAL:filed_or_const_definition - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FILED_OR_CONST_DEFINITION_OR_AM : - // - //TERMINAL:filed_or_const_definition_or_am - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FIXED_PART : - // - //TERMINAL:fixed_part - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FIXED_PART_2 : - // - //TERMINAL:fixed_part_2 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FOR_CYCLE_TYPE : - // - //TERMINAL:for_cycle_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FOR_STMT : - // - //TERMINAL:for_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FOR_STMT_DECL_OR_ASSIGN : - // - //TERMINAL:for_stmt_decl_or_assign - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FOREACH_STMT : - // - //TERMINAL:foreach_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FOREACH_STMT_IDENT_DYPE_OPT : - // - //TERMINAL:foreach_stmt_ident_dype_opt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FORMAT_EXPR : - // - //TERMINAL:format_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FP_LIST : - // - //TERMINAL:fp_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FP_SECT : - // - //TERMINAL:fp_sect - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FP_SECT_LIST : - // - //TERMINAL:fp_sect_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FPTYPE : - // - //TERMINAL:fptype - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FPTYPE_NEW : - // - //TERMINAL:fptype_new - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_BLOCK : - // - //TERMINAL:func_block - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_CLASS_NAME_IDENT : - // - //TERMINAL:func_class_name_ident - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_DECL : - // - //TERMINAL:func_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_DECL_LAMBDA : - // - //TERMINAL:func_decl_lambda - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_DECL_NOCLASS : - // - //TERMINAL:func_decl_noclass - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_DECL_WITH_ATTR : - // - //TERMINAL:func_decl_with_attr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_HEADING : - // - //TERMINAL:func_heading - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_METH_NAME_IDENT : - // - //TERMINAL:func_meth_name_ident - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_NAME : - // - //TERMINAL:func_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_NAME_IDENT : - // - //TERMINAL:func_name_ident - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_FUNC_NAME_WITH_TEMPLATE_ARGS : - // - //TERMINAL:func_name_with_template_args - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_GOTO_STMT : - // - //TERMINAL:goto_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_HEAD_COMPILER_DIRECTIVES : - // - //TERMINAL:head_compiler_directives - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IDENT_LIST : - // - //TERMINAL:ident_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IDENT_LIST1 : - // - //TERMINAL:ident_list1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IDENT_LIST2 : - // - //TERMINAL:ident_list2 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IDENT_OR_KEYWORD_POINTSEPARATOR_LIST : - // - //TERMINAL:ident_or_keyword_pointseparator_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IDENTIFIER : - // - //TERMINAL:identifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IDENTIFIER_KEYWORD_OPERATORNAME : - // - //TERMINAL:identifier_keyword_operatorname - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IDENTIFIER_OR_KEYWORD : - // - //TERMINAL:identifier_or_keyword - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IF_STMT : - // - //TERMINAL:if_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IF_THEN_ELSE_BRANCH : - // - //TERMINAL:if_then_else_branch - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IMPL_DECL_SECT : - // - //TERMINAL:impl_decl_sect - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IMPL_DECL_SECT_LIST : - // - //TERMINAL:impl_decl_sect_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IMPL_DECL_SECT_LIST1 : - // - //TERMINAL:impl_decl_sect_list1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_IMPLEMENTATION_PART : - // - //TERMINAL:implementation_part - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INHERITED_MESSAGE : - // - //TERMINAL:inherited_message - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INIT_CONST_EXPR : - // - //TERMINAL:init_const_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INITIALIZATION_PART : - // - //TERMINAL:initialization_part - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INT_DECL_SECT : - // - //TERMINAL:int_decl_sect - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INT_DECL_SECT_LIST : - // - //TERMINAL:int_decl_sect_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INT_DECL_SECT_LIST1 : - // - //TERMINAL:int_decl_sect_list1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INT_FUNC_HEADING : - // - //TERMINAL:int_func_heading - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INT_PROC_HEADING : - // - //TERMINAL:int_proc_heading - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INTEGER_CONST : - // - //TERMINAL:integer_const - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_INTERFACE_PART : - // - //TERMINAL:interface_part - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_KEYWORD : - // - //TERMINAL:keyword - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LABEL_DECL_SECT : - // - //TERMINAL:label_decl_sect - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LABEL_LIST : - // - //TERMINAL:label_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LABEL_NAME : - // - //TERMINAL:label_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LAMBDA_BODY : - // - //TERMINAL:lambda_body - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIBRARY_BLOCK : - // - //TERMINAL:library_block - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIBRARY_FILE : - // - //TERMINAL:library_file - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIBRARY_HEADING : - // - //TERMINAL:library_heading - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIBRARY_IMPL_DECL_SECT : - // - //TERMINAL:library_impl_decl_sect - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LIBRARY_IMPL_DECL_SECT_LIST : - // - //TERMINAL:library_impl_decl_sect_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LITERAL : - // - //TERMINAL:literal - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LITERAL_LIST : - // - //TERMINAL:literal_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LITERAL_OR_NUMBER : - // - //TERMINAL:literal_or_number - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_LOCK_STMT : - // - //TERMINAL:lock_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MAIN_USED_UNIT_NAME : - // - //TERMINAL:main_used_unit_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MAIN_USED_UNITS_LIST : - // - //TERMINAL:main_used_units_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MAIN_USES_CLAUSE : - // - //TERMINAL:main_uses_clause - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MAYBE_ERROR : - // - //TERMINAL:maybe_error - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_METH_MODIFICATOR : - // - //TERMINAL:meth_modificator - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_METH_MODIFICATORS : - // - //TERMINAL:meth_modificators - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_MULOP : - // - //TERMINAL:mulop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NEW_EXPR : - // - //TERMINAL:new_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NEW_OBJECT_TYPE : - // - //TERMINAL:new_object_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NEW_RECORD_TYPE : - // - //TERMINAL:new_record_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NON_RESERVED : - // - //TERMINAL:non_reserved - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_ARRAY_DEFAULTPROPERTY : - // - //TERMINAL:not_array_defaultproperty - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_COMPONENT_LIST : - // - //TERMINAL:not_component_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_COMPONENT_LIST_1 : - // - //TERMINAL:not_component_list_1 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_COMPONENT_LIST_2 : - // - //TERMINAL:not_component_list_2 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_COMPONENT_LIST_SEQ : - // - //TERMINAL:not_component_list_seq - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_CONSTRUCTOR_BLOCK_DECL : - // - //TERMINAL:not_constructor_block_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_CONSTRUCTOR_HEADING : - // - //TERMINAL:not_constructor_heading - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_CONSTRUCTOR_HEADING_OBJECT : - // - //TERMINAL:not_constructor_heading_object - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_DESTRUCTOR_HEADING : - // - //TERMINAL:not_destructor_heading - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_FIELD_DEFINITION : - // - //TERMINAL:not_field_definition - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_GUID : - // - //TERMINAL:not_guid - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_METHOD_DEFINITION : - // - //TERMINAL:not_method_definition - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_METHOD_HEADING : - // - //TERMINAL:not_method_heading - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_OBJECT_TYPE : - // - //TERMINAL:not_object_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_OBJECT_TYPE_IDENTIFIER_LIST : - // - //TERMINAL:not_object_type_identifier_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_PARAMETER_DECL : - // - //TERMINAL:not_parameter_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_PARAMETER_DECL_LIST : - // - //TERMINAL:not_parameter_decl_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_PARAMETER_NAME_LIST : - // - //TERMINAL:not_parameter_name_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_PROCFUNC_HEADING : - // - //TERMINAL:not_procfunc_heading - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_PROCFUNC_HEADING_VARIANTS : - // - //TERMINAL:not_procfunc_heading_variants - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_PROPERTY_DEFINITION : - // - //TERMINAL:not_property_definition - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_PROPERTY_INTERFACE : - // - //TERMINAL:not_property_interface - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_PROPERTY_INTERFACE_INDEX : - // - //TERMINAL:not_property_interface_index - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_PROPERTY_PARAMETER_LIST : - // - //TERMINAL:not_property_parameter_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_PROPERTY_SPECIFIERS : - // - //TERMINAL:not_property_specifiers - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_NOT_SIMPLE_PROPERTY_DEFINITION : - // - //TERMINAL:not_simple_property_definition - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OBJECT_TYPE : - // - //TERMINAL:object_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ONE_ATTRIBUTE : - // - //TERMINAL:one_attribute - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ONE_COMPILER_DIRECTIVE : - // - //TERMINAL:one_compiler_directive - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ONE_LITERAL : - // - //TERMINAL:one_literal - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ONE_OR_SOME_ATTRIBUTE : - // - //TERMINAL:one_or_some_attribute - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ONLY_CONST_DECL : - // - //TERMINAL:only_const_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OOT_COMPONENT_LIST : - // - //TERMINAL:oot_component_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OOT_CONSTRUCTOR_HEAD : - // - //TERMINAL:oot_constructor_head - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OOT_DESTRUCTOR_HEAD : - // - //TERMINAL:oot_destructor_head - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OOT_FIELD : - // - //TERMINAL:oot_field - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OOT_FIELD_IDENTIFIER : - // - //TERMINAL:oot_field_identifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OOT_FIELD_LIST : - // - //TERMINAL:oot_field_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OOT_ID_LIST : - // - //TERMINAL:oot_id_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OOT_METHOD : - // - //TERMINAL:oot_method - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OOT_METHOD_HEAD : - // - //TERMINAL:oot_method_head - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OOT_METHOD_LIST : - // - //TERMINAL:oot_method_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OOT_PRIVAT_LIST : - // - //TERMINAL:oot_privat_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OOT_SUCCESSOR : - // - //TERMINAL:oot_successor - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OOT_TYPEIDENTIFIER : - // - //TERMINAL:oot_typeidentifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPERATOR_NAME_IDENT : - // - //TERMINAL:operator_name_ident - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_AMPERSEND : - // - //TERMINAL:opt_ampersend - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_ARRAY_INITIALIZER : - // - //TERMINAL:opt_array_initializer - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_ATTR_EXPR_LIST : - // - //TERMINAL:opt_attr_expr_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_ATTRIBUTE_DECLARATIONS : - // - //TERMINAL:opt_attribute_declarations - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_BASE_CLASSES : - // - //TERMINAL:opt_base_classes - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_CONST_FUNC_EXPR_LIST : - // - //TERMINAL:opt_const_func_expr_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_EXPR_LIST : - // - //TERMINAL:opt_expr_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_EXPR_LIST_WITH_BRACKET : - // - //TERMINAL:opt_expr_list_with_bracket - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_HEAD_COMPILER_DIRECTIVES : - // - //TERMINAL:opt_head_compiler_directives - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_IDENTIFIER : - // - //TERMINAL:opt_identifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_METH_MODIFICATORS : - // - //TERMINAL:opt_meth_modificators - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_NOT_COMPONENT_LIST_SEQ_END : - // - //TERMINAL:opt_not_component_list_seq_end - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_PROC_NAME : - // - //TERMINAL:opt_proc_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_SEMICOLON : - // - //TERMINAL:opt_semicolon - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_TEMPLATE_ARGUMENTS : - // - //TERMINAL:opt_template_arguments - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_TEMPLATE_TYPE_PARAMS : - // - //TERMINAL:opt_template_type_params - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_TK_DO : - // - //TERMINAL:opt_tk_do - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_TK_POINT : - // - //TERMINAL:opt_tk_point - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_VAR : - // - //TERMINAL:opt_var - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPT_WHERE_SECTION : - // - //TERMINAL:opt_where_section - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OPTIONAL_QUALIFIED_IDENTIFIER : - // - //TERMINAL:optional_qualified_identifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_ORD_TYPE_NAME : - // - //TERMINAL:ord_type_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OT_VISIBILITY_SPECIFIER : - // - //TERMINAL:ot_visibility_specifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OTHER : - // - //TERMINAL:other - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_OVERLOAD_OPERATOR : - // - //TERMINAL:overload_operator - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PACKAGE_FILE : - // - //TERMINAL:package_file - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PACKAGE_NAME : - // - //TERMINAL:package_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAM_NAME : - // - //TERMINAL:param_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARAM_NAME_LIST : - // - //TERMINAL:param_name_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARSE_GOAL : - // - //TERMINAL:parse_goal - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PARTS : - // - //TERMINAL:parts - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_POINTER_TYPE : - // - //TERMINAL:pointer_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROC_BLOCK : - // - //TERMINAL:proc_block - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROC_BLOCK_DECL : - // - //TERMINAL:proc_block_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROC_CALL : - // - //TERMINAL:proc_call - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROC_DECL : - // - //TERMINAL:proc_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROC_DECL_NOCLASS : - // - //TERMINAL:proc_decl_noclass - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROC_DECL_WITH_ATTR : - // - //TERMINAL:proc_decl_with_attr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROC_HEADING : - // - //TERMINAL:proc_heading - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROC_NAME : - // - //TERMINAL:proc_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROCEDURAL_TYPE : - // - //TERMINAL:procedural_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROCEDURAL_TYPE_DECL : - // - //TERMINAL:procedural_type_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROCEDURAL_TYPE_KIND : - // - //TERMINAL:procedural_type_kind - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROGRAM_BLOCK : - // - //TERMINAL:program_block - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROGRAM_DECL_SECT_LIST : - // - //TERMINAL:program_decl_sect_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROGRAM_FILE : - // - //TERMINAL:program_file - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROGRAM_HEADING : - // - //TERMINAL:program_heading - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROGRAM_HEADING_2 : - // - //TERMINAL:program_heading_2 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROGRAM_NAME : - // - //TERMINAL:program_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROGRAM_PARAM : - // - //TERMINAL:program_param - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROGRAM_PARAM_LIST : - // - //TERMINAL:program_param_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_PROPERTY_SPECIFIER_DIRECTIVES : - // - //TERMINAL:property_specifier_directives - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_QUALIFIED_IDENTIFIER : - // - //TERMINAL:qualified_identifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_QUESTION_CONSTEXPR : - // - //TERMINAL:question_constexpr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_QUESTION_EXPR : - // - //TERMINAL:question_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RAISE_STMT : - // - //TERMINAL:raise_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RANGE_EXPR : - // - //TERMINAL:range_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RANGE_FACTOR : - // - //TERMINAL:range_factor - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RANGE_METHODNAME : - // - //TERMINAL:range_methodname - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RANGE_TERM : - // - //TERMINAL:range_term - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_REAL_TYPE_NAME : - // - //TERMINAL:real_type_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RECORD_COMPONENT_LIST : - // - //TERMINAL:record_component_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RECORD_CONST : - // - //TERMINAL:record_const - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RECORD_KEYWORD : - // - //TERMINAL:record_keyword - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RECORD_SECTION : - // - //TERMINAL:record_section - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RECORD_SECTION_ID : - // - //TERMINAL:record_section_id - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RECORD_SECTION_ID_LIST : - // - //TERMINAL:record_section_id_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RECORD_TYPE : - // - //TERMINAL:record_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RELOP : - // - //TERMINAL:relop - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RELOP_EXPR : - // - //TERMINAL:relop_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_REPEAT_STMT : - // - //TERMINAL:repeat_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_REQUIRES_CLAUSE : - // - //TERMINAL:requires_clause - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RES_STR_DECL_SECT : - // - //TERMINAL:res_str_decl_sect - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_RESERVED_KEYWORD : - // - //TERMINAL:reserved_keyword - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SET_TYPE : - // - //TERMINAL:set_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIGN : - // - //TERMINAL:sign - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_EXPR : - // - //TERMINAL:simple_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_FILED_OR_CONST_DEFINITION : - // - //TERMINAL:simple_filed_or_const_definition - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_FP_SECT : - // - //TERMINAL:simple_fp_sect - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_NOT_PROPERTY_DEFINITION : - // - //TERMINAL:simple_not_property_definition - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_OR_TEMPLATE_TYPE_REFERENCE : - // - //TERMINAL:simple_or_template_type_reference - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_TYPE : - // - //TERMINAL:simple_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_TYPE_DECL : - // - //TERMINAL:simple_type_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_TYPE_IDENTIFIER : - // - //TERMINAL:simple_type_identifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_TYPE_LIST : - // - //TERMINAL:simple_type_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIMPLE_TYPE_OR_EMPTY : - // - //TERMINAL:simple_type_or_empty - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_SIZEOF_EXPR : - // - //TERMINAL:sizeof_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STMT : - // - //TERMINAL:stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STMT_LIST : - // - //TERMINAL:stmt_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STMT_OR_EXPRESSION : - // - //TERMINAL:stmt_or_expression - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STRING_TYPE : - // - //TERMINAL:string_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_STRUCTURED_TYPE : - // - //TERMINAL:structured_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TAG_FIELD : - // - //TERMINAL:tag_field - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TAG_FIELD_NAME : - // - //TERMINAL:tag_field_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TAG_FIELD_TYPENAME : - // - //TERMINAL:tag_field_typename - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TEMPLATE_ARGUMENTS : - // - //TERMINAL:template_arguments - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TEMPLATE_IDENTIFIER_WITH_EQUAL : - // - //TERMINAL:template_identifier_with_equal - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TEMPLATE_PARAM : - // - //TERMINAL:template_param - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TEMPLATE_PARAM_LIST : - // - //TERMINAL:template_param_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TEMPLATE_TYPE : - // - //TERMINAL:template_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TEMPLATE_TYPE_BACK_VARSPECIFIERS : - // - //TERMINAL:template_type_back_varspecifiers - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TEMPLATE_TYPE_PARAMS : - // - //TERMINAL:template_type_params - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TERM : - // - //TERMINAL:term - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_THEN_BRANCH : - // - //TERMINAL:then_branch - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TRY_HANDLER : - // - //TERMINAL:try_handler - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TRY_STMT : - // - //TERMINAL:try_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TYPE_DECL : - // - //TERMINAL:type_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TYPE_DECL_IDENTIFIER : - // - //TERMINAL:type_decl_identifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TYPE_DECL_SECT : - // - //TERMINAL:type_decl_sect - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TYPE_DECL_TYPE : - // - //TERMINAL:type_decl_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TYPE_REF : - // - //TERMINAL:type_ref - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TYPE_REF_AND_SECIFIC_LIST : - // - //TERMINAL:type_ref_and_secific_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TYPE_REF_OR_SECIFIC : - // - //TERMINAL:type_ref_or_secific - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TYPECAST_OP : - // - //TERMINAL:typecast_op - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TYPED_CONST : - // - //TERMINAL:typed_const - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TYPED_CONST_LIST : - // - //TERMINAL:typed_const_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TYPED_CONST_OR_NEW : - // - //TERMINAL:typed_const_or_new - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_TYPEOF_EXPR : - // - //TERMINAL:typeof_expr - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_UNIT_FILE : - // - //TERMINAL:unit_file - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_UNIT_HEADING : - // - //TERMINAL:unit_heading - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_UNIT_KEY_WORD : - // - //TERMINAL:unit_key_word - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_UNIT_NAME : - // - //TERMINAL:unit_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_UNLABELLED_STMT : - // - //TERMINAL:unlabelled_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_UNPACKED_STRUCTURED_TYPE : - // - //TERMINAL:unpacked_structured_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_UNSIGNED_NUMBER : - // - //TERMINAL:unsigned_number - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_UNSIZED_ARRAY_TYPE : - // - //TERMINAL:unsized_array_type - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_USES_CLAUSE : - // - //TERMINAL:uses_clause - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_USING_CLAUSE : - // - //TERMINAL:using_clause - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_USING_LIST : - // - //TERMINAL:using_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_USING_ONE : - // - //TERMINAL:using_one - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_ADDRESS : - // - //TERMINAL:var_address - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_DECL : - // - //TERMINAL:var_decl - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_DECL_PART : - // - //TERMINAL:var_decl_part - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_DECL_PART_ASSIGN : - // - //TERMINAL:var_decl_part_assign - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_DECL_PART_IN_STMT : - // - //TERMINAL:var_decl_part_in_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_DECL_PART_NORMAL : - // - //TERMINAL:var_decl_part_normal - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_DECL_SECT : - // - //TERMINAL:var_decl_sect - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_INIT_VALUE : - // - //TERMINAL:var_init_value - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_INIT_VALUE_TYPED : - // - //TERMINAL:var_init_value_typed - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_NAME : - // - //TERMINAL:var_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_NAME_LIST : - // - //TERMINAL:var_name_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_OR_IDENTIFIER : - // - //TERMINAL:var_or_identifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_REFERENCE : - // - //TERMINAL:var_reference - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_SPECIFIERS : - // - //TERMINAL:var_specifiers - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VAR_STMT : - // - //TERMINAL:var_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIABLE : - // - //TERMINAL:variable - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIANT : - // - //TERMINAL:variant - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIANT_FIELD_LIST : - // - //TERMINAL:variant_field_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIANT_LIST : - // - //TERMINAL:variant_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIANT_LIST_2 : - // - //TERMINAL:variant_list_2 - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIANT_PART : - // - //TERMINAL:variant_part - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VARIANT_TYPE_NAME : - // - //TERMINAL:variant_type_name - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_VISIBILITY_SPECIFIER : - // - //TERMINAL:visibility_specifier - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_WHERE_PART : - // - //TERMINAL:where_part - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_WHERE_PART_LIST : - // - //TERMINAL:where_part_list - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_WHILE_STMT : - // - //TERMINAL:while_stmt - return null; - //ENDTERMINAL - case (int)SymbolConstants.SYMBOL_WITH_STMT : - // - //TERMINAL:with_stmt - return null; - //ENDTERMINAL -} -throw new SymbolException("Unknown symbol"); -} - - - - - - - - - - - - - - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//CreateNonTerminalObject -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -public Object CreateNonTerminalObject(int ReductionRuleIndex) -{ -switch (ReductionRuleIndex) -{ - case (int)RuleConstants.RULE_PARSE_GOAL : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PARSE_GOAL2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PARSE_GOAL3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PARTS_TKPARSEMODEEXPRESSION : - // ::= tkParseModeExpression -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_PARTS_TKPARSEMODESTATEMENT : - // ::= tkParseModeStatement -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_STMT_OR_EXPRESSION : - // ::= - - { - expression_as_statement _expression_as_statement=new expression_as_statement((expression)LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_expression_as_statement,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _expression_as_statement; - } - - case (int)RuleConstants.RULE_STMT_OR_EXPRESSION2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_STMT_OR_EXPRESSION3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_HEAD_COMPILER_DIRECTIVES : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_OPT_HEAD_COMPILER_DIRECTIVES2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_HEAD_COMPILER_DIRECTIVES : - // ::= -return null; - case (int)RuleConstants.RULE_HEAD_COMPILER_DIRECTIVES2 : - // ::= -return null; - case (int)RuleConstants.RULE_ONE_COMPILER_DIRECTIVE_TKDIRECTIVENAME_TKIDENTIFIER : - // ::= tkDirectiveName tkIdentifier - { - token_info t1 = new token_info(); - t1.text=((ident)LRParser.GetReductionSyntaxNode(0)).name; - t1.source_context = ((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - token_info t2 = new token_info(); - t2.text=((ident)LRParser.GetReductionSyntaxNode(1)).name; - t2.source_context = ((ident)LRParser.GetReductionSyntaxNode(1)).source_context; - compiler_directive cd=new compiler_directive(t1,t2); - parsertools.create_source_context(cd,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - CompilerDirectives.Add(cd); return null; - } - case (int)RuleConstants.RULE_ONE_COMPILER_DIRECTIVE_TKDIRECTIVENAME_TKSTRINGLITERAL : - // ::= tkDirectiveName tkStringLiteral - { - token_info t1 = new token_info(); - t1.text=((ident)LRParser.GetReductionSyntaxNode(0)).name; - t1.source_context = ((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - token_info t2 = new token_info(); - t2.text=((string_const)LRParser.GetReductionSyntaxNode(1)).Value; - t2.source_context = ((string_const)LRParser.GetReductionSyntaxNode(1)).source_context; - compiler_directive cd=new compiler_directive(t1,t2); - parsertools.create_source_context(cd,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - CompilerDirectives.Add(cd); return null; - } - case (int)RuleConstants.RULE_PROGRAM_FILE : - // ::= - - { - program_module _program_module=new program_module(LRParser.GetReductionSyntaxNode(0) as program_name,(uses_list)LRParser.GetReductionSyntaxNode(2),(block)LRParser.GetReductionSyntaxNode(4),LRParser.GetReductionSyntaxNode(3) as using_list); - - _program_module.Language = LanguageId.PascalABCNET; - parsertools.create_source_context(_program_module,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(4)),LRParser.GetReductionSyntaxNode(4)); - if (LRParser.GetReductionSyntaxNode(5) == null && LRParser.GetReductionSyntaxNode(4) != null) - { - file_position fp = (LRParser.GetReductionSyntaxNode(4) as syntax_tree_node).source_context.end_position; - syntax_tree_node err_stn = (syntax_tree_node)LRParser.GetReductionSyntaxNode(4); - if ((LRParser.GetReductionSyntaxNode(4) is block) && (LRParser.GetReductionSyntaxNode(4) as block).program_code != null && (LRParser.GetReductionSyntaxNode(4) as block).program_code.subnodes != null && (LRParser.GetReductionSyntaxNode(4) as block).program_code.subnodes.Count > 0) - err_stn = (LRParser.GetReductionSyntaxNode(4) as block).program_code.subnodes[(LRParser.GetReductionSyntaxNode(4) as block).program_code.subnodes.Count-1]; - errors.Add(new Errors.PABCNETUnexpectedToken(current_file_name, StringResources.Get("TKPOINT"),new SourceContext(fp.line_num, fp.column_num+1, fp.line_num, fp.column_num+1, 0, 0),err_stn)); - } - - return _program_module; - } - - case (int)RuleConstants.RULE_OPT_TK_POINT_TKPOINT : - // ::= tkPoint -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_TK_POINT_TKSEMICOLON : - // ::= tkSemiColon -return null; - case (int)RuleConstants.RULE_OPT_TK_POINT_TKCOLON : - // ::= tkColon -return null; - case (int)RuleConstants.RULE_OPT_TK_POINT_ZKCOMMA : - // ::= zkComma -return null; - case (int)RuleConstants.RULE_OPT_TK_POINT_TKDOTDOT : - // ::= tkDotDot -return null; - case (int)RuleConstants.RULE_OPT_TK_POINT : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PROGRAM_HEADING : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_PROGRAM_HEADING_TKPROGRAM : - // ::= tkProgram - - { - program_name _program_name=new program_name((ident)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_program_name,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _program_name; - } - - case (int)RuleConstants.RULE_PROGRAM_HEADING_2_TKSEMICOLON : - // ::= tkSemiColon -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROGRAM_HEADING_2_TKROUNDOPEN_TKROUNDCLOSE_TKSEMICOLON : - // ::= tkRoundOpen tkRoundClose tkSemiColon -return null; - case (int)RuleConstants.RULE_PROGRAM_NAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROGRAM_PARAM_LIST : - // ::= -return null; - case (int)RuleConstants.RULE_PROGRAM_PARAM_LIST_TKCOMMA : - // ::= tkComma -return null; - case (int)RuleConstants.RULE_PROGRAM_PARAM : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROGRAM_BLOCK : - // ::= - - { - block _block=new block(null,LRParser.GetReductionSyntaxNode(1) as statement_list); - - if (LRParser.GetReductionSyntaxNode(0)!=null) { - _block.defs=LRParser.GetReductionSyntaxNode(0) as declarations; - parsertools.create_source_context(_block,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - }else - parsertools.create_source_context(_block,LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(1)); - //tasha 16.04.2010 - add_lambda_to_program_block(_block); - - return _block; - } - - case (int)RuleConstants.RULE_PROGRAM_DECL_SECT_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_USES_CLAUSE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_USING_CLAUSE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_USING_CLAUSE2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_USING_LIST : - // ::= - - { - using_list _using_list=new using_list(); - - parsertools.create_source_context(_using_list,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - _using_list.namespaces.Add((unit_or_namespace)LRParser.GetReductionSyntaxNode(0)); - return _using_list; - } - - case (int)RuleConstants.RULE_USING_LIST2 : - // ::= - - { - using_list _using_list=(using_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_using_list,_using_list,LRParser.GetReductionSyntaxNode(1)); - _using_list.namespaces.Add((unit_or_namespace)LRParser.GetReductionSyntaxNode(1)); - return _using_list; - } - - case (int)RuleConstants.RULE_USING_ONE_TKUSING_TKSEMICOLON : - // ::= tkUsing tkSemiColon - - { - unit_or_namespace _unit_or_namespace=new unit_or_namespace((ident_list)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_unit_or_namespace,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _unit_or_namespace; - } - - case (int)RuleConstants.RULE_IDENT_OR_KEYWORD_POINTSEPARATOR_LIST : - // ::= - - //TemplateList for ident_list (create) - { - ident_list _ident_list=new ident_list(); - _ident_list.source_context=((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - _ident_list.idents.Add((ident)LRParser.GetReductionSyntaxNode(0)); - return _ident_list; - } - - case (int)RuleConstants.RULE_IDENT_OR_KEYWORD_POINTSEPARATOR_LIST_TKPOINT : - // ::= tkPoint - - //TemplateList for ident_list (add) - { - ident_list _ident_list=(ident_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_ident_list,_ident_list,LRParser.GetReductionSyntaxNode(2)); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(2) as ident); - return _ident_list; - } - - case (int)RuleConstants.RULE_MAIN_USES_CLAUSE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_MAIN_USES_CLAUSE_TKUSES_TKSEMICOLON : - // ::= tkUses tkSemiColon - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2));return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_MAIN_USED_UNITS_LIST_TKCOMMA : - // ::= tkComma - - { - uses_list _uses_list=(uses_list)LRParser.GetReductionSyntaxNode(0); - _uses_list.units.Add((unit_or_namespace)LRParser.GetReductionSyntaxNode(2)); - - return _uses_list; - } - - case (int)RuleConstants.RULE_MAIN_USED_UNITS_LIST : - // ::= - - { - uses_list _uses_list=new uses_list(); - - _uses_list.units.Add((unit_or_namespace)LRParser.GetReductionSyntaxNode(0)); - - return _uses_list; - } - - case (int)RuleConstants.RULE_MAIN_USED_UNIT_NAME : - // ::= - - { - unit_or_namespace _unit_or_namespace=new unit_or_namespace((ident_list)LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_unit_or_namespace,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - - return _unit_or_namespace; - } - - case (int)RuleConstants.RULE_MAIN_USED_UNIT_NAME_TKIN_TKSTRINGLITERAL : - // ::= tkIn tkStringLiteral - - { - uses_unit_in _uses_unit_in=new uses_unit_in(); - parsertools.create_source_context(_uses_unit_in,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - _uses_unit_in.name=(ident_list)LRParser.GetReductionSyntaxNode(0); - _uses_unit_in.in_file=(string_const)LRParser.GetReductionSyntaxNode(2); - - return _uses_unit_in; - } - - case (int)RuleConstants.RULE_LIBRARY_FILE_TKPOINT : - // ::= tkPoint - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkPoint"));}return null; - case (int)RuleConstants.RULE_LIBRARY_HEADING_TKLIBRARY_TKSEMICOLON : - // ::= tkLibrary tkSemiColon - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkLibrary tkSemiColon"));}return null; - case (int)RuleConstants.RULE_LIBRARY_BLOCK : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_LIBRARY_IMPL_DECL_SECT_LIST : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LIBRARY_IMPL_DECL_SECT_LIST2 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_LIBRARY_IMPL_DECL_SECT : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIBRARY_IMPL_DECL_SECT2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIBRARY_IMPL_DECL_SECT3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIBRARY_IMPL_DECL_SECT4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIBRARY_IMPL_DECL_SECT5 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIBRARY_IMPL_DECL_SECT6 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIBRARY_IMPL_DECL_SECT7 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIBRARY_IMPL_DECL_SECT8 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIBRARY_IMPL_DECL_SECT9 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LIBRARY_IMPL_DECL_SECT10 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXPORT_CLAUSE_TKEXPORTS_TKSEMICOLON : - // ::= tkExports tkSemiColon - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkExports tkSemiColon"));}return null; - case (int)RuleConstants.RULE_EXPORTS_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXPORTS_LIST_TKCOMMA : - // ::= tkComma - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkComma "));}return null; - case (int)RuleConstants.RULE_EXPORTS_ENTRY : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_EXPORTS_INDEX : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_EXPORTS_INDEX_TKINDEX : - // ::= tkIndex - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkIndex "));}return null; - case (int)RuleConstants.RULE_EXPORTS_NAME : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_EXPORTS_NAME_TKNAME : - // ::= tkName - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkName "));}return null; - case (int)RuleConstants.RULE_EXPORTS_NAME_TKNAME2 : - // ::= tkName - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkName "));}return null; - case (int)RuleConstants.RULE_EXPORTS_RESIDENT : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_EXPORTS_RESIDENT_TKRESIDENT : - // ::= tkResident -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNIT_FILE_TKPOINT : - // ::= tkPoint - - { - unit_module _unit_module=new unit_module((unit_name)LRParser.GetReductionSyntaxNode(0),(interface_node)LRParser.GetReductionSyntaxNode(1),(implementation_node)LRParser.GetReductionSyntaxNode(2),((initfinal_part)LRParser.GetReductionSyntaxNode(3)).initialization_sect,((initfinal_part)LRParser.GetReductionSyntaxNode(3)).finalization_sect); - - _unit_module.Language = LanguageId.PascalABCNET; - parsertools.create_source_context(_unit_module,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(4)); - - return _unit_module; - } - - case (int)RuleConstants.RULE_UNIT_FILE_TKPOINT2 : - // ::= tkPoint - - { - unit_module _unit_module=new unit_module((unit_name)LRParser.GetReductionSyntaxNode(0),(interface_node)LRParser.GetReductionSyntaxNode(1),null,((initfinal_part)LRParser.GetReductionSyntaxNode(2)).initialization_sect,((initfinal_part)LRParser.GetReductionSyntaxNode(2)).finalization_sect); - - _unit_module.Language = LanguageId.PascalABCNET; - parsertools.create_source_context(_unit_module,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - - return _unit_module; - } - - case (int)RuleConstants.RULE_UNIT_HEADING_TKSEMICOLON : - // ::= tkSemiColon - - { - unit_name _unit_name=new unit_name((ident)LRParser.GetReductionSyntaxNode(1),UnitHeaderKeyword.Unit); - - if(((ident)LRParser.GetReductionSyntaxNode(0)).name.ToLower()=="library") - _unit_name.HeaderKeyword=UnitHeaderKeyword.Library; - parsertools.create_source_context(_unit_name,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _unit_name; - } - - case (int)RuleConstants.RULE_UNIT_KEY_WORD_TKUNIT : - // ::= tkUnit -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNIT_KEY_WORD_TKLIBRARY : - // ::= tkLibrary -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNIT_NAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_INTERFACE_PART_TKINTERFACE : - // ::= tkInterface - - { - interface_node _interface_node=new interface_node(); - - _interface_node.uses_modules=LRParser.GetReductionSyntaxNode(1) as uses_list; - _interface_node.using_namespaces=LRParser.GetReductionSyntaxNode(2) as using_list; - _interface_node.interface_definitions=LRParser.GetReductionSyntaxNode(3) as declarations; - parsertools.create_source_context(_interface_node,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0))); - - return _interface_node; - } - - case (int)RuleConstants.RULE_IMPLEMENTATION_PART_TKIMPLEMENTATION : - // ::= tkImplementation - - { - implementation_node _implementation_node=new implementation_node(); - - _implementation_node.uses_modules=LRParser.GetReductionSyntaxNode(1) as uses_list; - _implementation_node.using_namespaces=LRParser.GetReductionSyntaxNode(2) as using_list; - _implementation_node.implementation_definitions=LRParser.GetReductionSyntaxNode(3) as declarations; - parsertools.create_source_context(_implementation_node,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0))); - - return _implementation_node; - } - - case (int)RuleConstants.RULE_ABC_INTERFACE_PART : - // ::= - - { - interface_node _interface_node=new interface_node(); - - _interface_node.uses_modules=LRParser.GetReductionSyntaxNode(0) as uses_list; - _interface_node.using_namespaces=LRParser.GetReductionSyntaxNode(1) as using_list; - _interface_node.interface_definitions=LRParser.GetReductionSyntaxNode(2) as declarations; - object lt=parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(2)); - object rt=parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0)); - if (lt!=null)parsertools.create_source_context(_interface_node,lt,rt); - - return _interface_node; - } - - case (int)RuleConstants.RULE_INITIALIZATION_PART_TKEND : - // ::= tkEnd - - { - initfinal_part _initfinal_part=new initfinal_part(); - - return _initfinal_part; - } - - case (int)RuleConstants.RULE_INITIALIZATION_PART_TKINITIALIZATION_TKEND : - // ::= tkInitialization tkEnd - - { - initfinal_part _initfinal_part=new initfinal_part((statement_list)LRParser.GetReductionSyntaxNode(1),null); - - ((statement_list)LRParser.GetReductionSyntaxNode(1)).left_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(0); - ((statement_list)LRParser.GetReductionSyntaxNode(1)).right_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(2); - - return _initfinal_part; - } - - case (int)RuleConstants.RULE_INITIALIZATION_PART_TKINITIALIZATION_TKFINALIZATION_TKEND : - // ::= tkInitialization tkFinalization tkEnd - - { - initfinal_part _initfinal_part=new initfinal_part((statement_list)LRParser.GetReductionSyntaxNode(1),(statement_list)LRParser.GetReductionSyntaxNode(3)); - - ((statement_list)LRParser.GetReductionSyntaxNode(1)).left_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(0); - ((statement_list)LRParser.GetReductionSyntaxNode(3)).left_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(2); - ((statement_list)LRParser.GetReductionSyntaxNode(3)).right_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(4); - - return _initfinal_part; - } - - case (int)RuleConstants.RULE_INITIALIZATION_PART_TKBEGIN_TKEND : - // ::= tkBegin tkEnd - - { - initfinal_part _initfinal_part=new initfinal_part((statement_list)LRParser.GetReductionSyntaxNode(1),null); - - ((statement_list)LRParser.GetReductionSyntaxNode(1)).left_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(0); - ((statement_list)LRParser.GetReductionSyntaxNode(1)).right_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(2); - - return _initfinal_part; - } - - case (int)RuleConstants.RULE_PACKAGE_FILE_TKPACKAGE_TKSEMICOLON_TKEND_TKPOINT : - // ::= tkPackage tkSemiColon tkEnd tkPoint - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkPackage tkSemiColon tkEnd tkPoint"));}return null; - case (int)RuleConstants.RULE_PACKAGE_NAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_REQUIRES_CLAUSE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_REQUIRES_CLAUSE_TKREQUIRES : - // ::= tkRequires -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_REQUIRES_CLAUSE_TKREQUIRES_TKSEMICOLON : - // ::= tkRequires tkSemiColon - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRequires tkSemiColon"));}return null; - case (int)RuleConstants.RULE_CONTAINS_CLAUSE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_CONTAINS_CLAUSE_TKCONTAINS : - // ::= tkContains -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONTAINS_CLAUSE_TKCONTAINS_TKSEMICOLON : - // ::= tkContains tkSemiColon - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkContains tkSemiColon"));}return null; - case (int)RuleConstants.RULE_INT_DECL_SECT_LIST : - // ::= -if (((declarations)LRParser.GetReductionSyntaxNode(0)).defs.Count>0) return LRParser.GetReductionSyntaxNode(0); return null; - case (int)RuleConstants.RULE_INT_DECL_SECT_LIST1 : - // ::= - - { - declarations _declarations=new declarations(); - - return _declarations; - } - - case (int)RuleConstants.RULE_INT_DECL_SECT_LIST12 : - // ::= - - { - declarations _declarations=(declarations)LRParser.GetReductionSyntaxNode(0); - _declarations.defs.Add((declaration)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_declarations,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)),LRParser.GetReductionSyntaxNode(1)); - - return _declarations; - } - - case (int)RuleConstants.RULE_IMPL_DECL_SECT_LIST : - // ::= -if (((declarations)LRParser.GetReductionSyntaxNode(0)).defs.Count>0) return LRParser.GetReductionSyntaxNode(0); return null; - case (int)RuleConstants.RULE_IMPL_DECL_SECT_LIST1 : - // ::= - - { - declarations _declarations=new declarations(); - - return _declarations; - } - - case (int)RuleConstants.RULE_IMPL_DECL_SECT_LIST12 : - // ::= - - { - declarations _declarations=(declarations)LRParser.GetReductionSyntaxNode(0); - _declarations.defs.Add((declaration)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_declarations,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)),LRParser.GetReductionSyntaxNode(1)); - - return _declarations; - } - - case (int)RuleConstants.RULE_ABC_DECL_SECT_LIST : - // ::= -if (((declarations)LRParser.GetReductionSyntaxNode(0)).defs.Count>0) return LRParser.GetReductionSyntaxNode(0); return null; - case (int)RuleConstants.RULE_ABC_DECL_SECT_LIST1 : - // ::= - - { - declarations _declarations=new declarations(); - - return _declarations; - } - - case (int)RuleConstants.RULE_ABC_DECL_SECT_LIST12 : - // ::= - - { - declarations _declarations=(declarations)LRParser.GetReductionSyntaxNode(0); - _declarations.defs.Add((declaration)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_declarations,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)),LRParser.GetReductionSyntaxNode(1)); - - return _declarations; - } - - case (int)RuleConstants.RULE_INT_DECL_SECT : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_INT_DECL_SECT2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_INT_DECL_SECT3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_INT_DECL_SECT4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_INT_DECL_SECT5 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_INT_DECL_SECT6 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IMPL_DECL_SECT : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IMPL_DECL_SECT2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IMPL_DECL_SECT3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IMPL_DECL_SECT4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IMPL_DECL_SECT5 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IMPL_DECL_SECT6 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IMPL_DECL_SECT7 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IMPL_DECL_SECT8 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IMPL_DECL_SECT9 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROC_DECL_WITH_ATTR : - // ::= - - { - procedure_definition _procedure_definition; - _procedure_definition=(LRParser.GetReductionSyntaxNode(1) as procedure_definition); - if (_procedure_definition.proc_header != null) - _procedure_definition.proc_header.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - - return _procedure_definition; - } - - case (int)RuleConstants.RULE_FUNC_DECL_WITH_ATTR : - // ::= - - { - procedure_definition _procedure_definition; - _procedure_definition=(LRParser.GetReductionSyntaxNode(1) as procedure_definition); - if (_procedure_definition.proc_header != null) - _procedure_definition.proc_header.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - - return _procedure_definition; - } - - case (int)RuleConstants.RULE_CONSTRUCTOR_DECL_WITH_ATTR : - // ::= - - { - procedure_definition _procedure_definition; - _procedure_definition=(LRParser.GetReductionSyntaxNode(1) as procedure_definition); - if (_procedure_definition.proc_header != null) - _procedure_definition.proc_header.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - - return _procedure_definition; - } - - case (int)RuleConstants.RULE_DESTRUCTOR_DECL_WITH_ATTR : - // ::= - - { - procedure_definition _procedure_definition; - _procedure_definition=(LRParser.GetReductionSyntaxNode(1) as procedure_definition); - if (_procedure_definition.proc_header != null) - _procedure_definition.proc_header.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - - return _procedure_definition; - } - - case (int)RuleConstants.RULE_ABC_DECL_SECT : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ABC_DECL_SECT2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ABC_DECL_SECT3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ABC_DECL_SECT4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ABC_DECL_SECT5 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_INT_PROC_HEADING : - // ::= - - { - declaration _declaration; - _declaration=(LRParser.GetReductionSyntaxNode(1) as declaration); - _declaration.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - - return _declaration; - } - - case (int)RuleConstants.RULE_INT_PROC_HEADING_TKFORWARD_TKSEMICOLON : - // ::= tkForward tkSemiColon - - { - procedure_header _procedure_header; - _procedure_header=(LRParser.GetReductionSyntaxNode(1) as procedure_header); - if (_procedure_header.proc_attributes==null) _procedure_header.proc_attributes=new procedure_attributes_list(); - _procedure_header.proc_attributes.proc_attributes.Add((procedure_attribute)LRParser.GetReductionSyntaxNode(2)); - _procedure_header.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - parsertools.create_source_context(_procedure_header.proc_attributes,parsertools.sc_not_null(_procedure_header.proc_attributes,LRParser.GetReductionSyntaxNode(2)),LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_procedure_header,LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(2)); - return _procedure_header; - } - - case (int)RuleConstants.RULE_INT_FUNC_HEADING : - // ::= - - { - declaration _declaration; - _declaration=(LRParser.GetReductionSyntaxNode(1) as declaration); - _declaration.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - - return _declaration; - } - - case (int)RuleConstants.RULE_INT_FUNC_HEADING_TKFORWARD_TKSEMICOLON : - // ::= tkForward tkSemiColon - - { - procedure_header _procedure_header; - _procedure_header=(LRParser.GetReductionSyntaxNode(1) as procedure_header); - if (_procedure_header.proc_attributes==null) _procedure_header.proc_attributes=new procedure_attributes_list(); - _procedure_header.proc_attributes.proc_attributes.Add((procedure_attribute)LRParser.GetReductionSyntaxNode(2)); - _procedure_header.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - parsertools.create_source_context(_procedure_header.proc_attributes,parsertools.sc_not_null(_procedure_header.proc_attributes,LRParser.GetReductionSyntaxNode(2)),LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_procedure_header,LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(2)); - return _procedure_header; - } - - case (int)RuleConstants.RULE_LABEL_DECL_SECT_TKLABEL_TKSEMICOLON : - // ::= tkLabel tkSemiColon - - { - label_definitions _label_definitions=new label_definitions((ident_list)LRParser.GetReductionSyntaxNode(1)); - - parsertools.create_source_context(_label_definitions,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _label_definitions; - } - - case (int)RuleConstants.RULE_LABEL_LIST : - // ::= - - //TemplateList for ident_list (create) - { - ident_list _ident_list=new ident_list(); - _ident_list.source_context=((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - _ident_list.idents.Add((ident)LRParser.GetReductionSyntaxNode(0)); - return _ident_list; - } - - case (int)RuleConstants.RULE_LABEL_LIST_TKCOMMA : - // ::= tkComma - - //TemplateList for ident_list (add) - { - ident_list _ident_list=(ident_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_ident_list,_ident_list,LRParser.GetReductionSyntaxNode(2)); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(2) as ident); - return _ident_list; - } - - case (int)RuleConstants.RULE_LABEL_NAME_TKINTEGER : - // ::= tkInteger - - { - ident _ident=new ident(); - - if(LRParser.GetReductionSyntaxNode(0) is int32_const) - _ident.name = ((int32_const)LRParser.GetReductionSyntaxNode(0)).val.ToString(); - else - if(LRParser.GetReductionSyntaxNode(0) is int64_const) - _ident.name = ((int64_const)LRParser.GetReductionSyntaxNode(0)).val.ToString(); - else - _ident.name = ((uint64_const)LRParser.GetReductionSyntaxNode(0)).val.ToString(); - parsertools.assign_source_context(_ident,LRParser.GetReductionSyntaxNode(0)); - return _ident; - } - - case (int)RuleConstants.RULE_LABEL_NAME_TKFLOAT : - // ::= tkFloat - - { - ident _ident=new ident(((double_const)LRParser.GetReductionSyntaxNode(0)).val.ToString()); - parsertools.assign_source_context(_ident,LRParser.GetReductionSyntaxNode(0)); - return _ident; - } - - case (int)RuleConstants.RULE_LABEL_NAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_DECL_SECT_TKCONST : - // ::= tkConst - - { - consts_definitions_list _consts_definitions_list=new consts_definitions_list(); - - _consts_definitions_list.const_defs.Add((const_definition)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_consts_definitions_list,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _consts_definitions_list; - } - - case (int)RuleConstants.RULE_CONST_DECL_SECT : - // ::= - - { - consts_definitions_list _consts_definitions_list=(consts_definitions_list)LRParser.GetReductionSyntaxNode(0); - _consts_definitions_list.const_defs.Add((const_definition)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_consts_definitions_list,_consts_definitions_list,LRParser.GetReductionSyntaxNode(1)); - return _consts_definitions_list; - } - - case (int)RuleConstants.RULE_RES_STR_DECL_SECT_TKRESOURCESTRING : - // ::= tkResourceString - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkResourceString "));}return null; - case (int)RuleConstants.RULE_RES_STR_DECL_SECT : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_TYPE_DECL_SECT_TKTYPE : - // ::= tkType - - { - type_declarations _type_declarations=new type_declarations(); - - ///////////////tasha 28.04.2010 - pascalABC_type_declarations.Add((type_declaration)LRParser.GetReductionSyntaxNode(1)); - /////////////////////////////// - _type_declarations.types_decl.Add((type_declaration)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_type_declarations,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _type_declarations; - } - - case (int)RuleConstants.RULE_TYPE_DECL_SECT : - // ::= - - { - type_declarations _type_declarations=(type_declarations)LRParser.GetReductionSyntaxNode(0); - _type_declarations.types_decl.Add((type_declaration)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_type_declarations,_type_declarations,LRParser.GetReductionSyntaxNode(1)); - return _type_declarations; - } - - case (int)RuleConstants.RULE_VAR_DECL_SECT_TKVAR : - // ::= tkVar - - { - variable_definitions _variable_definitions=new variable_definitions(); - - ///////////////tasha 28.04.2010 - pascalABC_var_statements.Add((var_def_statement)LRParser.GetReductionSyntaxNode(1)); - /////////////////////////////// - _variable_definitions.var_definitions.Add((var_def_statement)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_variable_definitions,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _variable_definitions; - } - - case (int)RuleConstants.RULE_VAR_DECL_SECT_TKEVENT : - // ::= tkEvent - - { - variable_definitions _variable_definitions=new variable_definitions(); - - _variable_definitions.var_definitions.Add((var_def_statement)LRParser.GetReductionSyntaxNode(1)); - (LRParser.GetReductionSyntaxNode(1) as var_def_statement).is_event = true; - parsertools.create_source_context(_variable_definitions,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _variable_definitions; - } - - case (int)RuleConstants.RULE_VAR_DECL_SECT : - // ::= - - { - variable_definitions _variable_definitions=(variable_definitions)LRParser.GetReductionSyntaxNode(0); - _variable_definitions.var_definitions.Add((var_def_statement)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_variable_definitions,_variable_definitions,LRParser.GetReductionSyntaxNode(1)); - return _variable_definitions; - } - - case (int)RuleConstants.RULE_CONST_DECL_TKSEMICOLON : - // ::= tkSemiColon -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ONLY_CONST_DECL_TKEQUAL : - // ::= tkEqual - - { - simple_const_definition _simple_const_definition=new simple_const_definition(); - - _simple_const_definition.const_name=(ident)LRParser.GetReductionSyntaxNode(0); - _simple_const_definition.const_value=(expression)LRParser.GetReductionSyntaxNode(2); - parsertools.create_source_context(_simple_const_definition,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _simple_const_definition; - } - - case (int)RuleConstants.RULE_ONLY_CONST_DECL_TKCOLON_TKEQUAL : - // ::= tkColon tkEqual - - { - typed_const_definition _typed_const_definition=new typed_const_definition(); - - _typed_const_definition.const_name=(ident)LRParser.GetReductionSyntaxNode(0); - _typed_const_definition.const_type=(type_definition)LRParser.GetReductionSyntaxNode(2); - _typed_const_definition.const_value=(expression)LRParser.GetReductionSyntaxNode(4); - parsertools.create_source_context(_typed_const_definition,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(4)); - return _typed_const_definition; - } - - case (int)RuleConstants.RULE_INIT_CONST_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_INIT_CONST_EXPR2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_NAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_EXPR2 : - // ::= - - { - bin_expr _bin_expr=new bin_expr((expression)LRParser.GetReductionSyntaxNode(0),(expression)LRParser.GetReductionSyntaxNode(2),((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_CONST_EXPR3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_QUESTION_CONSTEXPR_TKQUESTION_TKCOLON : - // ::= tkQuestion tkColon - - { - question_colon_expression _question_colon_expression=new question_colon_expression((expression)LRParser.GetReductionSyntaxNode(0),(expression)LRParser.GetReductionSyntaxNode(2),(expression)LRParser.GetReductionSyntaxNode(4)); - parsertools.create_source_context(_question_colon_expression,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(4)); - return _question_colon_expression; - } - - case (int)RuleConstants.RULE_CONST_RELOP_TKEQUAL : - // ::= tkEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_RELOP_TKNOTEQUAL : - // ::= tkNotEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_RELOP_TKLOWER : - // ::= tkLower -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_RELOP_TKGREATER : - // ::= tkGreater -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_RELOP_TKLOWEREQUAL : - // ::= tkLowerEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_RELOP_TKGREATEREQUAL : - // ::= tkGreaterEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_RELOP_TKIN : - // ::= tkIn -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_SIMPLE_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_SIMPLE_EXPR2 : - // ::= - - { - bin_expr _bin_expr=new bin_expr((expression)LRParser.GetReductionSyntaxNode(0),(expression)LRParser.GetReductionSyntaxNode(2),((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_CONST_ADDOP_TKPLUS : - // ::= tkPlus -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_ADDOP_TKMINUS : - // ::= tkMinus -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_ADDOP_TKOR : - // ::= tkOr -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_ADDOP_TKXOR : - // ::= tkXor -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_AS_IS_CONSTEXPR : - // ::= - - { - typecast_node _typecast_node=new typecast_node((addressed_value)LRParser.GetReductionSyntaxNode(0),(type_definition)LRParser.GetReductionSyntaxNode(2),(op_typecast)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_typecast_node,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - if (!(LRParser.GetReductionSyntaxNode(0) is addressed_value)) - errors.Add(new Errors.bad_operand_type(current_file_name,((syntax_tree_node)LRParser.GetReductionSyntaxNode(0)).source_context,_typecast_node)); - return _typecast_node; - } - - case (int)RuleConstants.RULE_CONST_TERM : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_TERM2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_TERM3 : - // ::= - - { - bin_expr _bin_expr=new bin_expr((expression)LRParser.GetReductionSyntaxNode(0),(expression)LRParser.GetReductionSyntaxNode(2),((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_CONST_MULOP_TKSTAR : - // ::= tkStar -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_MULOP_TKSLASH : - // ::= tkSlash -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_MULOP_TKDIV : - // ::= tkDiv -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_MULOP_TKMOD : - // ::= tkMod -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_MULOP_TKSHL : - // ::= tkShl -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_MULOP_TKSHR : - // ::= tkShr -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_MULOP_TKAND : - // ::= tkAnd -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_FACTOR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_FACTOR2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_FACTOR3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_FACTOR4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_FACTOR_TKNIL : - // ::= tkNil - - { - nil_const _nil_const=new nil_const(); - parsertools.create_source_context(_nil_const,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _nil_const; - } - - case (int)RuleConstants.RULE_CONST_FACTOR_TKADDRESSOF : - // ::= tkAddressOf - - { - get_address _get_address=new get_address((addressed_value)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_get_address,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _get_address; - } - - case (int)RuleConstants.RULE_CONST_FACTOR_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose - bracket_expr _expr = new bracket_expr((expression)LRParser.GetReductionSyntaxNode(1)); parsertools.create_source_context(_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); return _expr; - case (int)RuleConstants.RULE_CONST_FACTOR_TKNOT : - // ::= tkNot - - { - un_expr _un_expr=new un_expr((expression)LRParser.GetReductionSyntaxNode(1),((op_type_node)LRParser.GetReductionSyntaxNode(0)).type); - parsertools.create_source_context(_un_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _un_expr; - } - - case (int)RuleConstants.RULE_CONST_FACTOR5 : - // ::= - - { - un_expr _un_expr=new un_expr((expression)LRParser.GetReductionSyntaxNode(1),((op_type_node)LRParser.GetReductionSyntaxNode(0)).type); - parsertools.create_source_context(_un_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _un_expr; - } - - case (int)RuleConstants.RULE_CONST_FACTOR_TKDEREF : - // ::= tkDeref - - { - roof_dereference _roof_dereference=new roof_dereference(); - - _roof_dereference.dereferencing_value=(addressed_value)LRParser.GetReductionSyntaxNode(1); - parsertools.create_source_context(_roof_dereference,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _roof_dereference; - } - - case (int)RuleConstants.RULE_CONST_SET_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= tkSquareOpen tkSquareClose - - { - pascal_set_constant _pascal_set_constant=new pascal_set_constant(LRParser.GetReductionSyntaxNode(1) as expression_list); - - parsertools.create_source_context(_pascal_set_constant,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _pascal_set_constant; - } - - case (int)RuleConstants.RULE_SIGN_TKPLUS : - // ::= tkPlus -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIGN_TKMINUS : - // ::= tkMinus -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_VARIABLE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_VARIABLE2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_VARIABLE3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_VARIABLE4 : - // ::= -if (LRParser.GetReductionSyntaxNode(1) is dereference) { - ((dereference)LRParser.GetReductionSyntaxNode(1)).dereferencing_value=(addressed_value)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - } - if (LRParser.GetReductionSyntaxNode(1) is dot_node) { - ((dot_node)LRParser.GetReductionSyntaxNode(1)).left=(addressed_value)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),((dot_node)LRParser.GetReductionSyntaxNode(1)).right); - } - return LRParser.GetReductionSyntaxNode(1); - - case (int)RuleConstants.RULE_CONST_VARIABLE_2_TKPOINT : - // ::= tkPoint - - { - dot_node _dot_node=new dot_node(null,(addressed_value)LRParser.GetReductionSyntaxNode(1)); - - return _dot_node; - } - - case (int)RuleConstants.RULE_CONST_VARIABLE_2_TKDEREF : - // ::= tkDeref - - { - roof_dereference _roof_dereference=new roof_dereference(); - parsertools.assign_source_context(_roof_dereference,LRParser.GetReductionSyntaxNode(0)); - return _roof_dereference; - } - - case (int)RuleConstants.RULE_CONST_VARIABLE_2_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose - - { - method_call _method_call=new method_call((expression_list)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_method_call,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _method_call; - } - - case (int)RuleConstants.RULE_CONST_VARIABLE_2_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= tkSquareOpen tkSquareClose - - { - indexer _indexer=new indexer((expression_list)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_indexer,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _indexer; - } - - case (int)RuleConstants.RULE_OPT_CONST_FUNC_EXPR_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_CONST_FUNC_EXPR_LIST2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_CONST_FUNC_EXPR_LIST : - // ::= - - //TemplateList for expression_list (create) - { - expression_list _expression_list=new expression_list(); - _expression_list.source_context=((expression)LRParser.GetReductionSyntaxNode(0)).source_context; - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(0)); - return _expression_list; - } - - case (int)RuleConstants.RULE_CONST_FUNC_EXPR_LIST_TKCOMMA : - // ::= tkComma - - //TemplateList for expression_list (add) - { - expression_list _expression_list=(expression_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_expression_list,_expression_list,LRParser.GetReductionSyntaxNode(2)); - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(2) as expression); - return _expression_list; - } - - case (int)RuleConstants.RULE_CONST_ELEM_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_ELEM_LIST2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_CONST_ELEM_LIST1 : - // ::= - - //TemplateList for expression_list (create) - { - expression_list _expression_list=new expression_list(); - _expression_list.source_context=((expression)LRParser.GetReductionSyntaxNode(0)).source_context; - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(0)); - return _expression_list; - } - - case (int)RuleConstants.RULE_CONST_ELEM_LIST1_TKCOMMA : - // ::= tkComma - - //TemplateList for expression_list (add) - { - expression_list _expression_list=(expression_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_expression_list,_expression_list,LRParser.GetReductionSyntaxNode(2)); - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(2) as expression); - return _expression_list; - } - - case (int)RuleConstants.RULE_CONST_ELEM : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_ELEM_TKDOTDOT : - // ::= tkDotDot - - { - diapason_expr _diapason_expr=new diapason_expr((expression)LRParser.GetReductionSyntaxNode(0),(expression)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_diapason_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _diapason_expr; - } - - case (int)RuleConstants.RULE_UNSIGNED_NUMBER_TKINTEGER : - // ::= tkInteger -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNSIGNED_NUMBER_TKHEX : - // ::= tkHex -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNSIGNED_NUMBER_TKFLOAT : - // ::= tkFloat -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPED_CONST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPED_CONST2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPED_CONST3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ARRAY_CONST_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose - - { - array_const _array_const=new array_const((expression_list)LRParser.GetReductionSyntaxNode(1)); - - parsertools.create_source_context(_array_const,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _array_const; - } - - case (int)RuleConstants.RULE_ARRAY_CONST_TKROUNDOPEN_TKROUNDCLOSE2 : - // ::= tkRoundOpen tkRoundClose -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_ARRAY_CONST_TKROUNDOPEN_TKROUNDCLOSE3 : - // ::= tkRoundOpen tkRoundClose -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_TYPED_CONST_LIST : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_TYPED_CONST_LIST2 : - // ::= - - { - expression_list _expression_list=new expression_list(); - - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(0)); - //_expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(2)); - //parsertools.create_source_context(_expression_list,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _expression_list; - } - - case (int)RuleConstants.RULE_TYPED_CONST_LIST_TKCOMMA : - // ::= tkComma - - { - expression_list _expression_list=(expression_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_expression_list,_expression_list,LRParser.GetReductionSyntaxNode(2)); - if (_expression_list == null) - { - _expression_list = new expression_list(); - errors.Add(new Errors.PABCNETUnexpectedToken(current_file_name, StringResources.Get("TKIDENTIFIER"),((syntax_tree_node)LRParser.GetReductionSyntaxNode(1)).source_context,_expression_list)); - } - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(2)); - return _expression_list; - } - - case (int)RuleConstants.RULE_RECORD_CONST_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose -parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2));return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_CONST_FIELD_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_FIELD_LIST_TKSEMICOLON : - // ::= tkSemiColon -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_FIELD_LIST_1 : - // ::= - - //TemplateList for record_const (create) - { - record_const _record_const=new record_const(); - _record_const.source_context=((record_const_definition)LRParser.GetReductionSyntaxNode(0)).source_context; - _record_const.rec_consts.Add((record_const_definition)LRParser.GetReductionSyntaxNode(0)); - return _record_const; - } - - case (int)RuleConstants.RULE_CONST_FIELD_LIST_1_TKSEMICOLON : - // ::= tkSemiColon - - //TemplateList for record_const (add) - { - record_const _record_const=(record_const)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_record_const,_record_const,LRParser.GetReductionSyntaxNode(2)); - _record_const.rec_consts.Add(LRParser.GetReductionSyntaxNode(2) as record_const_definition); - return _record_const; - } - - case (int)RuleConstants.RULE_CONST_FIELD_TKCOLON : - // ::= tkColon - - { - record_const_definition _record_const_definition=new record_const_definition((ident)LRParser.GetReductionSyntaxNode(0),(expression)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_record_const_definition,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _record_const_definition; - } - - case (int)RuleConstants.RULE_CONST_FIELD_NAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPE_DECL : - // ::= - - { - declaration _declaration; - _declaration=(LRParser.GetReductionSyntaxNode(1) as declaration); - _declaration.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - - return _declaration; - } - - case (int)RuleConstants.RULE_OPT_ATTRIBUTE_DECLARATIONS : - // ::= - return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_ATTRIBUTE_DECLARATIONS2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ATTRIBUTE_DECLARATIONS : - // ::= - - { - attribute_list _attribute_list=new attribute_list(); - - _attribute_list.attributes.Add((simple_attribute_list)LRParser.GetReductionSyntaxNode(0)); - - return _attribute_list; - } - - case (int)RuleConstants.RULE_ATTRIBUTE_DECLARATIONS2 : - // ::= - - { - attribute_list _attribute_list=(attribute_list)LRParser.GetReductionSyntaxNode(0); - _attribute_list.attributes.Add((simple_attribute_list)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_attribute_list,_attribute_list,LRParser.GetReductionSyntaxNode(1)); - return _attribute_list; - } - - case (int)RuleConstants.RULE_ATTRIBUTE_DECLARATION_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= tkSquareOpen tkSquareClose -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_ONE_OR_SOME_ATTRIBUTE : - // ::= - - //TemplateList for simple_attribute_list (create) - { - simple_attribute_list _simple_attribute_list=new simple_attribute_list(); - _simple_attribute_list.source_context=((attribute)LRParser.GetReductionSyntaxNode(0)).source_context; - _simple_attribute_list.attributes.Add((attribute)LRParser.GetReductionSyntaxNode(0)); - return _simple_attribute_list; - } - - case (int)RuleConstants.RULE_ONE_OR_SOME_ATTRIBUTE_TKCOMMA : - // ::= tkComma - - //TemplateList for simple_attribute_list (add) - { - simple_attribute_list _simple_attribute_list=(simple_attribute_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_simple_attribute_list,_simple_attribute_list,LRParser.GetReductionSyntaxNode(2)); - _simple_attribute_list.attributes.Add(LRParser.GetReductionSyntaxNode(2) as attribute); - return _simple_attribute_list; - } - - case (int)RuleConstants.RULE_ONE_ATTRIBUTE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ONE_ATTRIBUTE_TKCOLON : - // ::= tkColon - - { - attribute _attribute; - _attribute=LRParser.GetReductionSyntaxNode(2) as attribute; - _attribute.qualifier = LRParser.GetReductionSyntaxNode(0) as ident; - - return _attribute; - } - - case (int)RuleConstants.RULE_SIMPLE_TYPE_DECL_TKEQUAL_TKSEMICOLON : - // ::= tkEqual tkSemiColon - - { - type_declaration _type_declaration=new type_declaration((ident)LRParser.GetReductionSyntaxNode(0),(type_definition)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_type_declaration,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _type_declaration; - } - - case (int)RuleConstants.RULE_SIMPLE_TYPE_DECL_TKSEMICOLON : - // ::= tkSemiColon - - { - type_declaration _type_declaration=new type_declaration((ident)LRParser.GetReductionSyntaxNode(0),(type_definition)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_type_declaration,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _type_declaration; - } - - case (int)RuleConstants.RULE_TYPE_DECL_IDENTIFIER : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPE_DECL_IDENTIFIER2 : - // ::= - - { - template_type_name _template_type_name=new template_type_name((ident_list)LRParser.GetReductionSyntaxNode(1)); - - _template_type_name.name=((ident)LRParser.GetReductionSyntaxNode(0)).name; - parsertools.create_source_context(_template_type_name,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _template_type_name; - } - - case (int)RuleConstants.RULE_TEMPLATE_IDENTIFIER_WITH_EQUAL_TKLOWER_TKGREATEREQUAL : - // ::= tkLower tkGreaterEqual - - { - template_type_name _template_type_name=new template_type_name((ident_list)LRParser.GetReductionSyntaxNode(2)); - - _template_type_name.name=((ident)LRParser.GetReductionSyntaxNode(0)).name; - parsertools.create_source_context(_template_type_name,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - - return _template_type_name; - } - - case (int)RuleConstants.RULE_TYPE_DECL_TYPE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPE_DECL_TYPE_TKTYPE : - // ::= tkType -parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1));return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_TYPE_DECL_TYPE2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPE_REF : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPE_REF2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPE_REF3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPE_REF4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPE_REF5 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPE_REF6 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TEMPLATE_TYPE : - // ::= - - { - template_type_reference _template_type_reference=new template_type_reference((named_type_reference)LRParser.GetReductionSyntaxNode(0),(template_param_list)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_template_type_reference,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _template_type_reference; - } - - case (int)RuleConstants.RULE_TEMPLATE_TYPE_PARAMS_TKLOWER_TKGREATER : - // ::= tkLower tkGreater -parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2));return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_TEMPLATE_PARAM_LIST : - // ::= - - //TemplateList for template_param_list (create) - { - template_param_list _template_param_list=new template_param_list(); - _template_param_list.source_context=((type_definition)LRParser.GetReductionSyntaxNode(0)).source_context; - _template_param_list.params_list.Add((type_definition)LRParser.GetReductionSyntaxNode(0)); - return _template_param_list; - } - - case (int)RuleConstants.RULE_TEMPLATE_PARAM_LIST_TKCOMMA : - // ::= tkComma - - //TemplateList for template_param_list (add) - { - template_param_list _template_param_list=(template_param_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_template_param_list,_template_param_list,LRParser.GetReductionSyntaxNode(2)); - _template_param_list.params_list.Add(LRParser.GetReductionSyntaxNode(2) as type_definition); - return _template_param_list; - } - - case (int)RuleConstants.RULE_TEMPLATE_PARAM : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TEMPLATE_PARAM2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_TYPE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_TYPE_TKDOTDOT : - // ::= tkDotDot - - { - diapason _diapason=new diapason((expression)LRParser.GetReductionSyntaxNode(0),(expression)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_diapason,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _diapason; - } - - case (int)RuleConstants.RULE_SIMPLE_TYPE_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose - - { - enum_type_definition _enum_type_definition=new enum_type_definition((enumerator_list)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_enum_type_definition,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _enum_type_definition; - } - - case (int)RuleConstants.RULE_RANGE_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RANGE_EXPR2 : - // ::= - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_RANGE_TERM : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RANGE_TERM2 : - // ::= - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_RANGE_FACTOR : - // ::= - if(((named_type_reference)LRParser.GetReductionSyntaxNode(0)).names.Count>0) - return ((named_type_reference)LRParser.GetReductionSyntaxNode(0)).names[0]; - else - return null; - - case (int)RuleConstants.RULE_RANGE_FACTOR2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RANGE_FACTOR3 : - // ::= - - { - un_expr _un_expr=new un_expr((expression)LRParser.GetReductionSyntaxNode(1),((op_type_node)LRParser.GetReductionSyntaxNode(0)).type); - parsertools.create_source_context(_un_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _un_expr; - } - - case (int)RuleConstants.RULE_RANGE_FACTOR4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RANGE_FACTOR_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose - - { - method_call _method_call=new method_call((expression_list)LRParser.GetReductionSyntaxNode(2)); - - _method_call.dereferencing_value=(addressed_value)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_method_call,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - - return _method_call; - } - - case (int)RuleConstants.RULE_RANGE_FACTOR_TKROUNDOPEN_TKROUNDCLOSE2 : - // ::= tkRoundOpen tkRoundClose - return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_RANGE_METHODNAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RANGE_METHODNAME_TKPOINT : - // ::= tkPoint - - { - dot_node _dot_node=new dot_node((ident)LRParser.GetReductionSyntaxNode(0),(ident)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_dot_node,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _dot_node; - } - - case (int)RuleConstants.RULE_SIMPLE_TYPE_IDENTIFIER : - // ::= - - //TemplateList for named_type_reference (create) - { - named_type_reference _named_type_reference=new named_type_reference(); - _named_type_reference.source_context=((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - _named_type_reference.names.Add((ident)LRParser.GetReductionSyntaxNode(0)); - return _named_type_reference; - } - - case (int)RuleConstants.RULE_SIMPLE_TYPE_IDENTIFIER_TKPOINT : - // ::= tkPoint - - //TemplateList for named_type_reference (add) - { - named_type_reference _named_type_reference=(named_type_reference)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_named_type_reference,_named_type_reference,LRParser.GetReductionSyntaxNode(2)); - _named_type_reference.names.Add(LRParser.GetReductionSyntaxNode(2) as ident); - return _named_type_reference; - } - - case (int)RuleConstants.RULE_ENUMERATION_ID_LIST_TKCOMMA : - // ::= tkComma - - { - enumerator_list _enumerator_list=new enumerator_list(); - - _enumerator_list.enumerators.Add((enumerator)LRParser.GetReductionSyntaxNode(0)); - _enumerator_list.enumerators.Add((enumerator)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_enumerator_list,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _enumerator_list; - } - - case (int)RuleConstants.RULE_ENUMERATION_ID_LIST_TKCOMMA2 : - // ::= tkComma - - { - enumerator_list _enumerator_list=(enumerator_list)LRParser.GetReductionSyntaxNode(0); - _enumerator_list.enumerators.Add((enumerator)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_enumerator_list,_enumerator_list,LRParser.GetReductionSyntaxNode(2)); - - return _enumerator_list; - } - - case (int)RuleConstants.RULE_ENUMERATION_ID : - // ::= - - { - enumerator _enumerator=new enumerator(LRParser.GetReductionSyntaxNode(0) as ident,null); - parsertools.create_source_context(_enumerator,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - - return _enumerator; - } - - case (int)RuleConstants.RULE_ENUMERATION_ID_TKEQUAL : - // ::= tkEqual - - { - enumerator _enumerator=new enumerator(LRParser.GetReductionSyntaxNode(0) as ident,LRParser.GetReductionSyntaxNode(2) as expression); - parsertools.create_source_context(_enumerator,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _enumerator; - } - - case (int)RuleConstants.RULE_POINTER_TYPE_TKDEREF : - // ::= tkDeref - - { - ref_type _ref_type=new ref_type((type_definition)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_ref_type,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _ref_type; - } - - case (int)RuleConstants.RULE_STRUCTURED_TYPE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_STRUCTURED_TYPE_TKPACKED : - // ::= tkPacked - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkPacked "));}return null; - case (int)RuleConstants.RULE_UNPACKED_STRUCTURED_TYPE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNPACKED_STRUCTURED_TYPE2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNPACKED_STRUCTURED_TYPE3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNPACKED_STRUCTURED_TYPE4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ARRAY_TYPE_TKARRAY_TKSQUAREOPEN_TKSQUARECLOSE_TKOF : - // ::= tkArray tkSquareOpen tkSquareClose tkOf - - { - array_type _array_type=new array_type((indexers_types)LRParser.GetReductionSyntaxNode(2),(type_definition)LRParser.GetReductionSyntaxNode(5)); - - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_array_type,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(5)); - - return _array_type; - } - - case (int)RuleConstants.RULE_ARRAY_TYPE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNSIZED_ARRAY_TYPE_TKARRAY_TKOF : - // ::= tkArray tkOf - - { - array_type _array_type=new array_type(null,(type_definition)LRParser.GetReductionSyntaxNode(2)); - - parsertools.create_source_context(_array_type,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _array_type; - } - - case (int)RuleConstants.RULE_SIMPLE_TYPE_LIST : - // ::= - - { - indexers_types _indexers_types=new indexers_types(); - - _indexers_types.indexers.Add((type_definition)LRParser.GetReductionSyntaxNode(0)); - - return _indexers_types; - } - - case (int)RuleConstants.RULE_SIMPLE_TYPE_LIST_TKCOMMA : - // ::= tkComma - - { - indexers_types _indexers_types=(indexers_types)LRParser.GetReductionSyntaxNode(0); - _indexers_types.indexers.Add((type_definition)LRParser.GetReductionSyntaxNode(2)); - - return _indexers_types; - } - - case (int)RuleConstants.RULE_SIMPLE_TYPE_OR_EMPTY : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_TYPE_OR_EMPTY2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_RECORD_TYPE_TKRECORD_TKEND : - // ::= tkRecord tkEnd - - { - record_type _record_type=new record_type((record_type_parts)LRParser.GetReductionSyntaxNode(1),null); - parsertools.create_source_context(_record_type,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _record_type; - } - - case (int)RuleConstants.RULE_RECORD_TYPE_TKRECORD_TKEND2 : - // ::= tkRecord tkEnd - - { - record_type _record_type=new record_type(null,null); - parsertools.create_source_context(_record_type,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _record_type; - } - - case (int)RuleConstants.RULE_FIELD_LIST : - // ::= - - { - record_type_parts _record_type_parts=new record_type_parts((var_def_list)LRParser.GetReductionSyntaxNode(0),null); - parsertools.create_source_context(_record_type_parts,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _record_type_parts; - } - - case (int)RuleConstants.RULE_FIELD_LIST2 : - // ::= - - { - record_type_parts _record_type_parts=new record_type_parts(null,(variant_record_type)LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_record_type_parts,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _record_type_parts; - } - - case (int)RuleConstants.RULE_FIELD_LIST_TKSEMICOLON : - // ::= tkSemiColon - - { - record_type_parts _record_type_parts=new record_type_parts((var_def_list)LRParser.GetReductionSyntaxNode(0),(variant_record_type)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_record_type_parts,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _record_type_parts; - } - - case (int)RuleConstants.RULE_FIXED_PART : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FIXED_PART_TKSEMICOLON : - // ::= tkSemiColon -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FIXED_PART_2 : - // ::= - - //TemplateList for var_def_list (create) - { - var_def_list _var_def_list=new var_def_list(); - _var_def_list.source_context=((var_def_statement)LRParser.GetReductionSyntaxNode(0)).source_context; - _var_def_list.vars.Add((var_def_statement)LRParser.GetReductionSyntaxNode(0)); - return _var_def_list; - } - - case (int)RuleConstants.RULE_FIXED_PART_2_TKSEMICOLON : - // ::= tkSemiColon - - //TemplateList for var_def_list (add) - { - var_def_list _var_def_list=(var_def_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_var_def_list,_var_def_list,LRParser.GetReductionSyntaxNode(2)); - _var_def_list.vars.Add(LRParser.GetReductionSyntaxNode(2) as var_def_statement); - return _var_def_list; - } - - case (int)RuleConstants.RULE_RECORD_SECTION_TKCOLON : - // ::= tkColon - - { - var_def_statement _var_def_statement=new var_def_statement((ident_list)LRParser.GetReductionSyntaxNode(0),(type_definition)LRParser.GetReductionSyntaxNode(2),null,definition_attribute.None,false); - - parsertools.create_source_context(_var_def_statement,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _var_def_statement; - } - - case (int)RuleConstants.RULE_RECORD_SECTION_ID_LIST : - // ::= - - //TemplateList for ident_list (create) - { - ident_list _ident_list=new ident_list(); - _ident_list.source_context=((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - _ident_list.idents.Add((ident)LRParser.GetReductionSyntaxNode(0)); - return _ident_list; - } - - case (int)RuleConstants.RULE_RECORD_SECTION_ID_LIST_TKCOMMA : - // ::= tkComma - - //TemplateList for ident_list (add) - { - ident_list _ident_list=(ident_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_ident_list,_ident_list,LRParser.GetReductionSyntaxNode(2)); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(2) as ident); - return _ident_list; - } - - case (int)RuleConstants.RULE_RECORD_SECTION_ID : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIANT_PART_TKCASE_TKOF : - // ::= tkCase tkOf - - { - variant_record_type _variant_record_type; - _variant_record_type=(variant_record_type)LRParser.GetReductionSyntaxNode(1); - _variant_record_type.vars=LRParser.GetReductionSyntaxNode(3) as variant_types; - parsertools.create_source_context(_variant_record_type,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(2))); - - return _variant_record_type; - } - - case (int)RuleConstants.RULE_TAG_FIELD : - // ::= - - { - variant_record_type _variant_record_type=new variant_record_type((ident)LRParser.GetReductionSyntaxNode(0),null,null); - - return _variant_record_type; - } - - case (int)RuleConstants.RULE_TAG_FIELD_TKCOLON : - // ::= tkColon - - { - variant_record_type _variant_record_type=new variant_record_type((ident)LRParser.GetReductionSyntaxNode(0),(type_definition)LRParser.GetReductionSyntaxNode(2),null); - - return _variant_record_type; - } - - case (int)RuleConstants.RULE_TAG_FIELD_NAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TAG_FIELD_TYPENAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIANT_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIANT_LIST_TKSEMICOLON : - // ::= tkSemiColon -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIANT_LIST_2 : - // ::= - - //TemplateList for variant_types (create) - { - variant_types _variant_types=new variant_types(); - _variant_types.source_context=((variant_type)LRParser.GetReductionSyntaxNode(0)).source_context; - _variant_types.vars.Add((variant_type)LRParser.GetReductionSyntaxNode(0)); - return _variant_types; - } - - case (int)RuleConstants.RULE_VARIANT_LIST_2_TKSEMICOLON : - // ::= tkSemiColon - - //TemplateList for variant_types (add) - { - variant_types _variant_types=(variant_types)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_variant_types,_variant_types,LRParser.GetReductionSyntaxNode(2)); - _variant_types.vars.Add(LRParser.GetReductionSyntaxNode(2) as variant_type); - return _variant_types; - } - - case (int)RuleConstants.RULE_VARIANT_TKCOLON_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkColon tkRoundOpen tkRoundClose - - { - variant_type _variant_type=new variant_type((expression_list)LRParser.GetReductionSyntaxNode(0),(record_type_parts)LRParser.GetReductionSyntaxNode(3)); - - parsertools.create_source_context(_variant_type,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(4)); - - return _variant_type; - } - - case (int)RuleConstants.RULE_VARIANT_FIELD_LIST : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_VARIANT_FIELD_LIST2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CASE_TAG_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONST_EXPR_LIST : - // ::= - - //TemplateList for expression_list (create) - { - expression_list _expression_list=new expression_list(); - _expression_list.source_context=((expression)LRParser.GetReductionSyntaxNode(0)).source_context; - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(0)); - return _expression_list; - } - - case (int)RuleConstants.RULE_CONST_EXPR_LIST_TKCOMMA : - // ::= tkComma - - //TemplateList for expression_list (add) - { - expression_list _expression_list=(expression_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_expression_list,_expression_list,LRParser.GetReductionSyntaxNode(2)); - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(2) as expression); - return _expression_list; - } - - case (int)RuleConstants.RULE_SET_TYPE_TKSET_TKOF : - // ::= tkSet tkOf - - { - set_type_definition _set_type_definition=new set_type_definition((type_definition)LRParser.GetReductionSyntaxNode(2)); - - parsertools.create_source_context(_set_type_definition,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _set_type_definition; - } - - case (int)RuleConstants.RULE_FILE_TYPE_TKFILE_TKOF : - // ::= tkFile tkOf - - { - file_type _file_type=new file_type((type_definition)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_file_type,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _file_type; - } - - case (int)RuleConstants.RULE_FILE_TYPE_TKFILE : - // ::= tkFile - - { - file_type _file_type=new file_type(); - parsertools.assign_source_context(_file_type,LRParser.GetReductionSyntaxNode(0)); - return _file_type; - } - - case (int)RuleConstants.RULE_STRING_TYPE_TKIDENTIFIER_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= tkIdentifier tkSquareOpen tkSquareClose - - { - string_num_definition _string_num_definition=new string_num_definition((expression)LRParser.GetReductionSyntaxNode(2),(ident)LRParser.GetReductionSyntaxNode(0)); - - parsertools.create_source_context(_string_num_definition,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - return _string_num_definition; - } - - case (int)RuleConstants.RULE_PROCEDURAL_TYPE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROCEDURAL_TYPE_KIND : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROCEDURAL_TYPE_DECL_TKPROCEDURE : - // ::= tkProcedure - - { - procedure_header _procedure_header=new procedure_header((formal_parameters)LRParser.GetReductionSyntaxNode(1),null,null,false,false,null,null); - - object rt=LRParser.GetReductionSyntaxNode(0); - if (LRParser.GetReductionSyntaxNode(1)!=null) rt=LRParser.GetReductionSyntaxNode(1); - parsertools.create_source_context(_procedure_header,LRParser.GetReductionSyntaxNode(0),rt); - if(LRParser.GetReductionSyntaxNode(2)!=null) - (LRParser.GetReductionSyntaxNode(2) as SyntaxError).bad_node=_procedure_header; - - return _procedure_header; - } - - case (int)RuleConstants.RULE_PROCEDURAL_TYPE_DECL_TKFUNCTION_TKCOLON : - // ::= tkFunction tkColon - - { - function_header _function_header=new function_header(); - - if (LRParser.GetReductionSyntaxNode(1)!=null) - _function_header.parameters=(formal_parameters)LRParser.GetReductionSyntaxNode(1); - if (LRParser.GetReductionSyntaxNode(3)!=null) - _function_header.return_type=(type_definition)LRParser.GetReductionSyntaxNode(3); - _function_header.of_object=false; - _function_header.class_keyword=false; - parsertools.create_source_context(_function_header,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - - return _function_header; - } - - case (int)RuleConstants.RULE_MAYBE_ERROR_TKCOLON : - // ::= tkColon - Errors.unexpected_return_value er=new Errors.unexpected_return_value(current_file_name,((syntax_tree_node)LRParser.GetReductionSyntaxNode(1)).source_context,null); errors.Add(er);return er; - case (int)RuleConstants.RULE_MAYBE_ERROR : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_OBJECT_TYPE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OOT_PRIVAT_LIST : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_OOT_PRIVAT_LIST_TKPRIVATE : - // ::= tkPrivate - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkPrivate "));}return null; - case (int)RuleConstants.RULE_OOT_COMPONENT_LIST : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_OOT_COMPONENT_LIST2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OOT_COMPONENT_LIST3 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_OOT_COMPONENT_LIST4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OOT_SUCCESSOR_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkRoundClose"));}return null; - case (int)RuleConstants.RULE_OOT_TYPEIDENTIFIER : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OOT_FIELD_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OOT_FIELD_LIST2 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_OOT_FIELD_TKCOLON_TKSEMICOLON : - // ::= tkColon tkSemiColon - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkColon tkSemiColon"));}return null; - case (int)RuleConstants.RULE_OOT_ID_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OOT_ID_LIST_TKCOMMA : - // ::= tkComma - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkComma "));}return null; - case (int)RuleConstants.RULE_OOT_FIELD_IDENTIFIER : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OOT_METHOD_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OOT_METHOD_LIST2 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_OOT_METHOD : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OOT_METHOD_HEAD : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OOT_METHOD_HEAD2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OOT_METHOD_HEAD3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OOT_METHOD_HEAD4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OOT_CONSTRUCTOR_HEAD_TKCONSTRUCTOR : - // ::= tkConstructor - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkConstructor "));}return null; - case (int)RuleConstants.RULE_OOT_DESTRUCTOR_HEAD_TKDESTRUCTOR : - // ::= tkDestructor - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkDestructor "));}return null; - case (int)RuleConstants.RULE_NEW_OBJECT_TYPE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_OBJECT_TYPE : - // ::= - - { - class_definition _class_definition=new class_definition(LRParser.GetReductionSyntaxNode(2) as named_type_reference_list,LRParser.GetReductionSyntaxNode(4) as class_body,class_keyword.Class,null,LRParser.GetReductionSyntaxNode(3) as where_definition_list, class_attribute.None,false); - - string kw=(LRParser.GetReductionSyntaxNode(1) as token_info).text.ToLower(); - if(LRParser.GetReductionSyntaxNode(0)!=null) - _class_definition.attribute=(class_attribute)((LRParser.GetReductionSyntaxNode(0) as token_taginfo).tag); - if (kw=="record") - _class_definition.keyword=class_keyword.Record; - else - if (kw=="interface") - _class_definition.keyword=class_keyword.Interface; - else - if (kw=="i<>") - _class_definition.keyword=class_keyword.TemplateInterface; - else - if (kw=="r<>") - _class_definition.keyword=class_keyword.TemplateRecord; - else - if (kw=="c<>") - _class_definition.keyword=class_keyword.TemplateClass; - if (_class_definition.body!=null && _class_definition.body.class_def_blocks!=null && - _class_definition.body.class_def_blocks.Count>0 && _class_definition.body.class_def_blocks[0].access_mod==null) - { - if(_class_definition.keyword==class_keyword.Class) - _class_definition.body.class_def_blocks[0].access_mod = new access_modifer_node(access_modifer.internal_modifer); - else - _class_definition.body.class_def_blocks[0].access_mod = new access_modifer_node(access_modifer.none); - } - parsertools.create_source_context(_class_definition,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(4),LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0))); - return _class_definition; - } - - case (int)RuleConstants.RULE_NEW_RECORD_TYPE_TKEND : - // ::= tkEnd - - { - class_definition _class_definition=new class_definition(LRParser.GetReductionSyntaxNode(1) as named_type_reference_list,LRParser.GetReductionSyntaxNode(3) as class_body,class_keyword.Record,null,LRParser.GetReductionSyntaxNode(2) as where_definition_list, class_attribute.None,false); - - if (_class_definition.body!=null && _class_definition.body.class_def_blocks!=null && - _class_definition.body.class_def_blocks.Count>0 && _class_definition.body.class_def_blocks[0].access_mod==null) - { - _class_definition.body.class_def_blocks[0].access_mod = new access_modifer_node(access_modifer.public_modifer); - } - parsertools.create_source_context(_class_definition,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(4)); - return _class_definition; - } - - case (int)RuleConstants.RULE_CLASS_ATTRIBUTES_TKFINAL : - // ::= tkFinal -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CLASS_ATTRIBUTES : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_CLASS_OR_INTERFACE_KEYWORD_TKCLASS : - // ::= tkClass -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CLASS_OR_INTERFACE_KEYWORD_TKINTERFACE : - // ::= tkInterface -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CLASS_OR_INTERFACE_KEYWORD_TKTEMPLATE : - // ::= tkTemplate - - { - token_info _token_info=(token_info)LRParser.GetReductionSyntaxNode(0);_token_info.text="c<>"; - return _token_info; - } - - case (int)RuleConstants.RULE_CLASS_OR_INTERFACE_KEYWORD_TKTEMPLATE_TKCLASS : - // ::= tkTemplate tkClass - - { - token_info _token_info=(token_info)LRParser.GetReductionSyntaxNode(0);_token_info.text="c<>";parsertools.create_source_context(_token_info,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _token_info; - } - - case (int)RuleConstants.RULE_CLASS_OR_INTERFACE_KEYWORD_TKTEMPLATE_TKRECORD : - // ::= tkTemplate tkRecord - - { - token_info _token_info=(token_info)LRParser.GetReductionSyntaxNode(0);_token_info.text="r<>";parsertools.create_source_context(_token_info,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _token_info; - } - - case (int)RuleConstants.RULE_CLASS_OR_INTERFACE_KEYWORD_TKTEMPLATE_TKINTERFACE : - // ::= tkTemplate tkInterface - - { - token_info _token_info=(token_info)LRParser.GetReductionSyntaxNode(0);_token_info.text="i<>";parsertools.create_source_context(_token_info,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _token_info; - } - - case (int)RuleConstants.RULE_RECORD_KEYWORD_TKRECORD : - // ::= tkRecord -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_NOT_COMPONENT_LIST_SEQ_END : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_OPT_NOT_COMPONENT_LIST_SEQ_END_TKEND : - // ::= tkEnd -parsertools.create_source_context(LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)),LRParser.GetReductionSyntaxNode(1));return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_BASE_CLASSES : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_OPT_BASE_CLASSES_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_BASE_CLASSES_NAMES_LIST : - // ::= - - //TemplateList for named_type_reference_list (create) - { - named_type_reference_list _named_type_reference_list=new named_type_reference_list(); - _named_type_reference_list.source_context=((named_type_reference)LRParser.GetReductionSyntaxNode(0)).source_context; - _named_type_reference_list.types.Add((named_type_reference)LRParser.GetReductionSyntaxNode(0)); - return _named_type_reference_list; - } - - case (int)RuleConstants.RULE_BASE_CLASSES_NAMES_LIST_TKCOMMA : - // ::= tkComma - - //TemplateList for named_type_reference_list (add) - { - named_type_reference_list _named_type_reference_list=(named_type_reference_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_named_type_reference_list,_named_type_reference_list,LRParser.GetReductionSyntaxNode(2)); - _named_type_reference_list.types.Add(LRParser.GetReductionSyntaxNode(2) as named_type_reference); - return _named_type_reference_list; - } - - case (int)RuleConstants.RULE_BASE_CLASS_NAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_BASE_CLASS_NAME2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_TEMPLATE_ARGUMENTS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_OPT_TEMPLATE_ARGUMENTS2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TEMPLATE_ARGUMENTS_TKLOWER_TKGREATER : - // ::= tkLower tkGreater -parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2));return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_OPT_WHERE_SECTION : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_OPT_WHERE_SECTION2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_WHERE_PART_LIST : - // ::= - - { - where_definition_list _where_definition_list=new where_definition_list(); - - parsertools.create_source_context(_where_definition_list,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - _where_definition_list.defs.Add((where_definition)LRParser.GetReductionSyntaxNode(0)); - return _where_definition_list; - } - - case (int)RuleConstants.RULE_WHERE_PART_LIST2 : - // ::= - - { - where_definition_list _where_definition_list=(where_definition_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_where_definition_list,_where_definition_list,LRParser.GetReductionSyntaxNode(1)); - _where_definition_list.defs.Add((where_definition)LRParser.GetReductionSyntaxNode(1)); - return _where_definition_list; - } - - case (int)RuleConstants.RULE_WHERE_PART_TKWHERE_TKCOLON_TKSEMICOLON : - // ::= tkWhere tkColon tkSemiColon - - { - where_definition _where_definition=new where_definition((ident_list)LRParser.GetReductionSyntaxNode(1),(type_definition_list)LRParser.GetReductionSyntaxNode(3)); - - parsertools.create_source_context(_where_definition,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(4)); - return _where_definition; - } - - case (int)RuleConstants.RULE_TYPE_REF_AND_SECIFIC_LIST : - // ::= - - //TemplateList for type_definition_list (create) - { - type_definition_list _type_definition_list=new type_definition_list(); - _type_definition_list.source_context=((type_definition)LRParser.GetReductionSyntaxNode(0)).source_context; - _type_definition_list.defs.Add((type_definition)LRParser.GetReductionSyntaxNode(0)); - return _type_definition_list; - } - - case (int)RuleConstants.RULE_TYPE_REF_AND_SECIFIC_LIST_TKCOMMA : - // ::= tkComma - - //TemplateList for type_definition_list (add) - { - type_definition_list _type_definition_list=(type_definition_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_type_definition_list,_type_definition_list,LRParser.GetReductionSyntaxNode(2)); - _type_definition_list.defs.Add(LRParser.GetReductionSyntaxNode(2) as type_definition); - return _type_definition_list; - } - - case (int)RuleConstants.RULE_TYPE_REF_OR_SECIFIC : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPE_REF_OR_SECIFIC_TKCLASS : - // ::= tkClass - - { - declaration_specificator _declaration_specificator=new declaration_specificator(DeclarationSpecificator.WhereDefClass, (LRParser.GetReductionSyntaxNode(0) as token_info).text); - - parsertools.assign_source_context(_declaration_specificator,LRParser.GetReductionSyntaxNode(0)); - return _declaration_specificator; - } - - case (int)RuleConstants.RULE_TYPE_REF_OR_SECIFIC_TKRECORD : - // ::= tkRecord - - { - declaration_specificator _declaration_specificator=new declaration_specificator(DeclarationSpecificator.WhereDefValueType, (LRParser.GetReductionSyntaxNode(0) as token_info).text); - - parsertools.assign_source_context(_declaration_specificator,LRParser.GetReductionSyntaxNode(0)); - return _declaration_specificator; - } - - case (int)RuleConstants.RULE_TYPE_REF_OR_SECIFIC_TKCONSTRUCTOR : - // ::= tkConstructor - - { - declaration_specificator _declaration_specificator=new declaration_specificator(DeclarationSpecificator.WhereDefConstructor, (LRParser.GetReductionSyntaxNode(0) as token_info).text); - - parsertools.assign_source_context(_declaration_specificator,LRParser.GetReductionSyntaxNode(0)); - return _declaration_specificator; - } - - case (int)RuleConstants.RULE_RECORD_COMPONENT_LIST : - // ::= - - { - class_body _class_body=new class_body(); - - if (LRParser.GetReductionSyntaxNode(0)!=null) { - access_modifer_node acn=new access_modifer_node(access_modifer.public_modifer); - ((class_members)LRParser.GetReductionSyntaxNode(0)).access_mod = acn; - _class_body.class_def_blocks.Add((class_members)LRParser.GetReductionSyntaxNode(0)); - parsertools.assign_source_context(_class_body,LRParser.GetReductionSyntaxNode(0)); - } - - return _class_body; - } - - case (int)RuleConstants.RULE_NOT_COMPONENT_LIST_SEQ : - // ::= - - { - class_body _class_body=new class_body(); - - if (LRParser.GetReductionSyntaxNode(0)!=null) { - _class_body.class_def_blocks.Add((class_members)LRParser.GetReductionSyntaxNode(0)); - parsertools.assign_source_context(_class_body,LRParser.GetReductionSyntaxNode(0)); - } - - return _class_body; - } - - case (int)RuleConstants.RULE_NOT_COMPONENT_LIST_SEQ2 : - // ::= - - { - class_body _class_body=(class_body)LRParser.GetReductionSyntaxNode(0); - class_members cl=(class_members)LRParser.GetReductionSyntaxNode(2); - if (cl==null) - { - cl=new class_members(); - parsertools.create_source_context(cl,LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(1)); - } - cl.access_mod=(access_modifer_node)LRParser.GetReductionSyntaxNode(1); - _class_body.class_def_blocks.Add(cl); - parsertools.create_source_context(_class_body,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)),parsertools.sc_not_null(cl,LRParser.GetReductionSyntaxNode(1))); - - return _class_body; - } - - case (int)RuleConstants.RULE_OT_VISIBILITY_SPECIFIER_TKINTERNAL : - // ::= tkInternal - - { - access_modifer_node _access_modifer_node=new access_modifer_node(access_modifer.internal_modifer); - parsertools.assign_source_context(_access_modifer_node,LRParser.GetReductionSyntaxNode(0)); - return _access_modifer_node; - } - - case (int)RuleConstants.RULE_OT_VISIBILITY_SPECIFIER_TKPUBLIC : - // ::= tkPublic - - { - access_modifer_node _access_modifer_node=new access_modifer_node(access_modifer.public_modifer); - parsertools.assign_source_context(_access_modifer_node,LRParser.GetReductionSyntaxNode(0)); - return _access_modifer_node; - } - - case (int)RuleConstants.RULE_OT_VISIBILITY_SPECIFIER_TKPROTECTED : - // ::= tkProtected - - { - access_modifer_node _access_modifer_node=new access_modifer_node(access_modifer.protected_modifer); - parsertools.assign_source_context(_access_modifer_node,LRParser.GetReductionSyntaxNode(0)); - return _access_modifer_node; - } - - case (int)RuleConstants.RULE_OT_VISIBILITY_SPECIFIER_TKPRIVATE : - // ::= tkPrivate - - { - access_modifer_node _access_modifer_node=new access_modifer_node(access_modifer.private_modifer); - parsertools.assign_source_context(_access_modifer_node,LRParser.GetReductionSyntaxNode(0)); - return _access_modifer_node; - } - - case (int)RuleConstants.RULE_NOT_OBJECT_TYPE_IDENTIFIER_LIST : - // ::= - - //TemplateList for named_type_reference_list (create) - { - named_type_reference_list _named_type_reference_list=new named_type_reference_list(); - _named_type_reference_list.source_context=((named_type_reference)LRParser.GetReductionSyntaxNode(0)).source_context; - _named_type_reference_list.types.Add((named_type_reference)LRParser.GetReductionSyntaxNode(0)); - return _named_type_reference_list; - } - - case (int)RuleConstants.RULE_NOT_OBJECT_TYPE_IDENTIFIER_LIST_TKCOMMA : - // ::= tkComma - - //TemplateList for named_type_reference_list (add) - { - named_type_reference_list _named_type_reference_list=(named_type_reference_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_named_type_reference_list,_named_type_reference_list,LRParser.GetReductionSyntaxNode(2)); - _named_type_reference_list.types.Add(LRParser.GetReductionSyntaxNode(2) as named_type_reference); - return _named_type_reference_list; - } - - case (int)RuleConstants.RULE_IDENT_LIST : - // ::= - - //TemplateList for ident_list (create) - { - ident_list _ident_list=new ident_list(); - _ident_list.source_context=((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - _ident_list.idents.Add((ident)LRParser.GetReductionSyntaxNode(0)); - return _ident_list; - } - - case (int)RuleConstants.RULE_IDENT_LIST_TKCOMMA : - // ::= tkComma - - //TemplateList for ident_list (add) - { - ident_list _ident_list=(ident_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_ident_list,_ident_list,LRParser.GetReductionSyntaxNode(2)); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(2) as ident); - return _ident_list; - } - - case (int)RuleConstants.RULE_NOT_COMPONENT_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_COMPONENT_LIST2 : - // ::= -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_NOT_COMPONENT_LIST3 : - // ::= -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_NOT_COMPONENT_LIST_TKSEMICOLON : - // ::= tkSemiColon - - { - class_members _class_members; - _class_members=(class_members)LRParser.GetReductionSyntaxNode(1); - for (int i=0;i<((class_members)LRParser.GetReductionSyntaxNode(3)).members.Count;i++) - _class_members.members.Add(((class_members)LRParser.GetReductionSyntaxNode(3)).members[i]); - parsertools.create_source_context(_class_members,LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(3)); - - return _class_members; - } - - case (int)RuleConstants.RULE_OPT_SEMICOLON : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_OPT_SEMICOLON_TKSEMICOLON : - // ::= tkSemiColon -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_GUID : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_NOT_COMPONENT_LIST_1 : - // ::= - - { - class_members _class_members=new class_members(); - - _class_members.members.Add((declaration)LRParser.GetReductionSyntaxNode(0)); - parsertools.assign_source_context(_class_members,LRParser.GetReductionSyntaxNode(0)); - - return _class_members; - } - - case (int)RuleConstants.RULE_NOT_COMPONENT_LIST_1_TKSEMICOLON : - // ::= tkSemiColon - - { - class_members _class_members=(class_members)LRParser.GetReductionSyntaxNode(0); - if(LRParser.GetReductionSyntaxNode(2) is declaration) - _class_members.members.Add((declaration)LRParser.GetReductionSyntaxNode(2)); - else - (_class_members.members[_class_members.members.Count-1] as var_def_statement).var_attr=definition_attribute.Static; - parsertools.create_source_context(_class_members,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _class_members; - } - - case (int)RuleConstants.RULE_NOT_COMPONENT_LIST_2 : - // ::= - - { - class_members _class_members=new class_members(); - - _class_members.members.Add((declaration)LRParser.GetReductionSyntaxNode(0)); - parsertools.assign_source_context(_class_members,LRParser.GetReductionSyntaxNode(0)); - - return _class_members; - } - - case (int)RuleConstants.RULE_NOT_COMPONENT_LIST_22 : - // ::= - - { - class_members _class_members=new class_members(); - - _class_members.members.Add((declaration)LRParser.GetReductionSyntaxNode(0)); - parsertools.assign_source_context(_class_members,LRParser.GetReductionSyntaxNode(0)); - - return _class_members; - } - - case (int)RuleConstants.RULE_NOT_COMPONENT_LIST_23 : - // ::= - - { - class_members _class_members=(class_members)LRParser.GetReductionSyntaxNode(0); - _class_members.members.Add((declaration)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_class_members,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _class_members; - } - - case (int)RuleConstants.RULE_NOT_COMPONENT_LIST_24 : - // ::= - - { - class_members _class_members=(class_members)LRParser.GetReductionSyntaxNode(0); - _class_members.members.Add((declaration)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_class_members,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _class_members; - } - - case (int)RuleConstants.RULE_FILED_OR_CONST_DEFINITION : - // ::= - - { - declaration _declaration; - _declaration=LRParser.GetReductionSyntaxNode(1) as declaration; - _declaration.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - - return _declaration; - } - - case (int)RuleConstants.RULE_SIMPLE_FILED_OR_CONST_DEFINITION_TKCONST : - // ::= tkConst - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_SIMPLE_FILED_OR_CONST_DEFINITION : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_FILED_OR_CONST_DEFINITION_TKCLASS : - // ::= tkClass - - { - var_def_statement _var_def_statement=(var_def_statement)LRParser.GetReductionSyntaxNode(1); - _var_def_statement.var_attr = definition_attribute.Static; - parsertools.create_source_context(_var_def_statement,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _var_def_statement; - } - - case (int)RuleConstants.RULE_FILED_OR_CONST_DEFINITION_OR_AM : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FILED_OR_CONST_DEFINITION_OR_AM2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_FIELD_DEFINITION : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_FIELD_DEFINITION_TKEVENT_TKCOLON : - // ::= tkEvent tkColon - - { - var_def_statement _var_def_statement=new var_def_statement((ident_list)LRParser.GetReductionSyntaxNode(1),(type_definition)LRParser.GetReductionSyntaxNode(3),null,definition_attribute.None,true); - - parsertools.create_source_context(_var_def_statement,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - - return _var_def_statement; - } - - case (int)RuleConstants.RULE_FIELD_ACCESS_MODIFIER_TKSTATIC : - // ::= tkStatic -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_METHOD_DEFINITION : - // ::= - - { - declaration _declaration; - _declaration=(LRParser.GetReductionSyntaxNode(1) as declaration); - if (_declaration != null) - _declaration.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - - return _declaration; - } - - case (int)RuleConstants.RULE_NOT_METHOD_DEFINITION2 : - // ::= - - { - procedure_definition _procedure_definition; - _procedure_definition=(LRParser.GetReductionSyntaxNode(1) as procedure_definition); - if (_procedure_definition != null && _procedure_definition.proc_header != null) - _procedure_definition.proc_header.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - - return _procedure_definition; - } - - case (int)RuleConstants.RULE_ABC_METHOD_DECL : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ABC_METHOD_DECL2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ABC_METHOD_DECL3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ABC_METHOD_DECL4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_METHOD_HEADING_TKCLASS : - // ::= tkClass - ((procedure_header)LRParser.GetReductionSyntaxNode(1)).class_keyword=true;return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_NOT_METHOD_HEADING : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_METHOD_HEADING2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_METHOD_HEADING3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_PROCFUNC_HEADING : - // ::= - ((procedure_header)LRParser.GetReductionSyntaxNode(0)).name.explicit_interface_name=((procedure_header)LRParser.GetReductionSyntaxNode(0)).name.class_name; - ((procedure_header)LRParser.GetReductionSyntaxNode(0)).name.class_name=null; - return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_PROCFUNC_HEADING_VARIANTS : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_PROCFUNC_HEADING_VARIANTS2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPTIONAL_QUALIFIED_IDENTIFIER : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPTIONAL_QUALIFIED_IDENTIFIER2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_NOT_CONSTRUCTOR_HEADING : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_CONSTRUCTOR_HEADING_TKCLASS : - // ::= tkClass - ((procedure_header)LRParser.GetReductionSyntaxNode(1)).class_keyword=true;return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_OPT_PROC_NAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_PROC_NAME2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_NOT_CONSTRUCTOR_HEADING_OBJECT_TKCONSTRUCTOR : - // ::= tkConstructor - - { - constructor _constructor=new constructor(); - - object rt=LRParser.GetReductionSyntaxNode(1); - _constructor.name=LRParser.GetReductionSyntaxNode(1) as method_name; - if (LRParser.GetReductionSyntaxNode(2)!=null) { - rt=LRParser.GetReductionSyntaxNode(2); - _constructor.parameters=(formal_parameters)LRParser.GetReductionSyntaxNode(2); - } - if (LRParser.GetReductionSyntaxNode(3)!=null) { - rt=LRParser.GetReductionSyntaxNode(3); - if (((procedure_attributes_list)LRParser.GetReductionSyntaxNode(3)).proc_attributes.Count>0) - _constructor.proc_attributes=(procedure_attributes_list)LRParser.GetReductionSyntaxNode(3); - } - parsertools.create_source_context(_constructor,LRParser.GetReductionSyntaxNode(0),rt); - - return _constructor; - } - - case (int)RuleConstants.RULE_NOT_DESTRUCTOR_HEADING_TKDESTRUCTOR : - // ::= tkDestructor - - { - destructor _destructor=new destructor(); - - object rt=LRParser.GetReductionSyntaxNode(1); - _destructor.name=LRParser.GetReductionSyntaxNode(1) as method_name; - if (LRParser.GetReductionSyntaxNode(2)!=null) { - rt=LRParser.GetReductionSyntaxNode(2); - _destructor.parameters=(formal_parameters)LRParser.GetReductionSyntaxNode(2); - } - if (LRParser.GetReductionSyntaxNode(3)!=null) { - rt=LRParser.GetReductionSyntaxNode(3); - if (((procedure_attributes_list)LRParser.GetReductionSyntaxNode(3)).proc_attributes.Count>0) - _destructor.proc_attributes=(procedure_attributes_list)LRParser.GetReductionSyntaxNode(3); - } - parsertools.create_source_context(_destructor,LRParser.GetReductionSyntaxNode(0),rt); - - return _destructor; - } - - case (int)RuleConstants.RULE_QUALIFIED_IDENTIFIER : - // ::= - - { - method_name _method_name=new method_name(null,null,(ident)LRParser.GetReductionSyntaxNode(0),null); - parsertools.create_source_context(_method_name,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - - return _method_name; - } - - case (int)RuleConstants.RULE_QUALIFIED_IDENTIFIER2 : - // ::= - - { - method_name _method_name=new method_name(null,null,(ident)LRParser.GetReductionSyntaxNode(0),null); - parsertools.create_source_context(_method_name,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - - return _method_name; - } - - case (int)RuleConstants.RULE_QUALIFIED_IDENTIFIER_TKPOINT : - // ::= tkPoint -{ - method_name mn=(method_name)LRParser.GetReductionSyntaxNode(0); - mn.class_name=mn.meth_name; - mn.meth_name=(ident)LRParser.GetReductionSyntaxNode(2); - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return LRParser.GetReductionSyntaxNode(0); - } - case (int)RuleConstants.RULE_QUALIFIED_IDENTIFIER_TKPOINT2 : - // ::= tkPoint -{ - method_name mn=(method_name)LRParser.GetReductionSyntaxNode(0); - mn.class_name=mn.meth_name; - mn.meth_name=(ident)LRParser.GetReductionSyntaxNode(2); - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return LRParser.GetReductionSyntaxNode(0); - } - case (int)RuleConstants.RULE_NOT_PROPERTY_DEFINITION : - // ::= - - { - declaration _declaration; - _declaration=LRParser.GetReductionSyntaxNode(1) as declaration; - _declaration.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - - return _declaration; - } - - case (int)RuleConstants.RULE_SIMPLE_NOT_PROPERTY_DEFINITION : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_NOT_PROPERTY_DEFINITION_TKCLASS : - // ::= tkClass - - { - simple_property _simple_property=(simple_property)LRParser.GetReductionSyntaxNode(1); - _simple_property.attr=definition_attribute.Static; - parsertools.create_source_context(_simple_property,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _simple_property; - } - - case (int)RuleConstants.RULE_NOT_SIMPLE_PROPERTY_DEFINITION_TKPROPERTY_TKSEMICOLON : - // ::= tkProperty tkSemiColon - - { - simple_property _simple_property=new simple_property(); - - _simple_property.property_name=((method_name)LRParser.GetReductionSyntaxNode(1)).meth_name; - if (LRParser.GetReductionSyntaxNode(2)!=null){ - _simple_property.parameter_list=((property_interface)LRParser.GetReductionSyntaxNode(2)).parameter_list; - _simple_property.property_type=((property_interface)LRParser.GetReductionSyntaxNode(2)).property_type; - _simple_property.index_expression=((property_interface)LRParser.GetReductionSyntaxNode(2)).index_expression; - } - if (LRParser.GetReductionSyntaxNode(3)!=null) _simple_property.accessors=(property_accessors)LRParser.GetReductionSyntaxNode(3); - if (LRParser.GetReductionSyntaxNode(5)!=null) _simple_property.array_default=(property_array_default)LRParser.GetReductionSyntaxNode(5); - parsertools.create_source_context(_simple_property,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(5),LRParser.GetReductionSyntaxNode(4),LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0))); - - return _simple_property; - } - - case (int)RuleConstants.RULE_NOT_ARRAY_DEFAULTPROPERTY : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_NOT_ARRAY_DEFAULTPROPERTY_TKDEFAULT_TKSEMICOLON : - // ::= tkDefault tkSemiColon - - { - property_array_default _property_array_default=new property_array_default(); - parsertools.create_source_context(_property_array_default,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _property_array_default; - } - - case (int)RuleConstants.RULE_NOT_PROPERTY_INTERFACE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_NOT_PROPERTY_INTERFACE_TKCOLON : - // ::= tkColon - - { - property_interface _property_interface=new property_interface(); - - _property_interface.parameter_list=(property_parameter_list)LRParser.GetReductionSyntaxNode(0); - _property_interface.property_type=(type_definition)LRParser.GetReductionSyntaxNode(2); - _property_interface.index_expression=(expression)LRParser.GetReductionSyntaxNode(3); - parsertools.create_source_context(_property_interface,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(3)),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0))); - - return _property_interface; - } - - case (int)RuleConstants.RULE_NOT_PROPERTY_INTERFACE_INDEX : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_NOT_PROPERTY_INTERFACE_INDEX_TKINDEX : - // ::= tkIndex -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_NOT_PROPERTY_PARAMETER_LIST : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_NOT_PROPERTY_PARAMETER_LIST_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= tkSquareOpen tkSquareClose -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_NOT_PARAMETER_DECL_LIST : - // ::= - - //TemplateList for property_parameter_list (create) - { - property_parameter_list _property_parameter_list=new property_parameter_list(); - _property_parameter_list.source_context=((property_parameter)LRParser.GetReductionSyntaxNode(0)).source_context; - _property_parameter_list.parameters.Add((property_parameter)LRParser.GetReductionSyntaxNode(0)); - return _property_parameter_list; - } - - case (int)RuleConstants.RULE_NOT_PARAMETER_DECL_LIST_TKSEMICOLON : - // ::= tkSemiColon - - //TemplateList for property_parameter_list (add) - { - property_parameter_list _property_parameter_list=(property_parameter_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_property_parameter_list,_property_parameter_list,LRParser.GetReductionSyntaxNode(2)); - _property_parameter_list.parameters.Add(LRParser.GetReductionSyntaxNode(2) as property_parameter); - return _property_parameter_list; - } - - case (int)RuleConstants.RULE_NOT_PARAMETER_DECL_TKCOLON : - // ::= tkColon - - { - property_parameter _property_parameter=new property_parameter((ident_list)LRParser.GetReductionSyntaxNode(0),(type_definition)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_property_parameter,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _property_parameter; - } - - case (int)RuleConstants.RULE_NOT_PARAMETER_DECL_TKCONST_TKCOLON : - // ::= tkConst tkColon - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkConst tkColon "));}return null; - case (int)RuleConstants.RULE_NOT_PARAMETER_DECL_TKVAR_TKCOLON : - // ::= tkVar tkColon - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkVar tkColon "));}return null; - case (int)RuleConstants.RULE_NOT_PARAMETER_DECL_TKOUT_TKCOLON : - // ::= tkOut tkColon - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkOut tkColon "));}return null; - case (int)RuleConstants.RULE_NOT_PARAMETER_NAME_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_IDENTIFIER : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_IDENTIFIER2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_NOT_PROPERTY_SPECIFIERS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_NOT_PROPERTY_SPECIFIERS_TKREADONLY : - // ::= tkReadOnly - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkReadOnly "));}return null; - case (int)RuleConstants.RULE_NOT_PROPERTY_SPECIFIERS_TKWRITEONLY : - // ::= tkWriteOnly - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkWriteOnly "));}return null; - case (int)RuleConstants.RULE_NOT_PROPERTY_SPECIFIERS_TKDEFAULT : - // ::= tkDefault - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkDefault "));}return null; - case (int)RuleConstants.RULE_NOT_PROPERTY_SPECIFIERS_TKREAD : - // ::= tkRead - - { - property_accessors _property_accessors; - - property_accessors _pa=LRParser.GetReductionSyntaxNode(2) as property_accessors; - if (_pa==null) { - _pa=new property_accessors();parsertools.create_source_context(_pa,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0))); - } - _property_accessors=_pa; - if(LRParser.GetReductionSyntaxNode(1)!=null && ((ident)LRParser.GetReductionSyntaxNode(1)).name.ToLower()=="write") - { - _property_accessors.read_accessor=new read_accessor_name(null); - _property_accessors.write_accessor=new write_accessor_name(null); - parsertools.create_source_context(_property_accessors.read_accessor,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_property_accessors.write_accessor,LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_property_accessors,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - } - else - { - _property_accessors.read_accessor=new read_accessor_name((ident)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_property_accessors.read_accessor,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0))); - parsertools.create_source_context(_property_accessors,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0))); - } - - return _property_accessors; - } - - case (int)RuleConstants.RULE_NOT_PROPERTY_SPECIFIERS_TKWRITE : - // ::= tkWrite - - { - property_accessors _property_accessors; - - property_accessors _pa=LRParser.GetReductionSyntaxNode(2) as property_accessors; - if (_pa==null) { - _pa=new property_accessors();parsertools.create_source_context(_pa,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0))); - } - _property_accessors=_pa; - _property_accessors.write_accessor=new write_accessor_name((ident)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_property_accessors.write_accessor,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0))); - parsertools.create_source_context(_property_accessors,LRParser.GetReductionSyntaxNode(0),_pa); - - return _property_accessors; - } - - case (int)RuleConstants.RULE_VAR_DECL_TKSEMICOLON : - // ::= tkSemiColon -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VAR_DECL_PART : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VAR_DECL_PART2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VAR_DECL_PART_TKCOLON_TKASSIGN : - // ::= tkColon tkAssign - - { - var_def_statement _var_def_statement=new var_def_statement((ident_list)LRParser.GetReductionSyntaxNode(0),(type_definition)LRParser.GetReductionSyntaxNode(2),(expression)LRParser.GetReductionSyntaxNode(4),definition_attribute.None,false); - parsertools.create_source_context(_var_def_statement,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(4)); - - return _var_def_statement; - } - - case (int)RuleConstants.RULE_VAR_DECL_PART_IN_STMT : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VAR_DECL_PART_ASSIGN_TKASSIGN : - // ::= tkAssign - - { - var_def_statement _var_def_statement=new var_def_statement((ident_list)LRParser.GetReductionSyntaxNode(0),null,(expression)LRParser.GetReductionSyntaxNode(2),definition_attribute.None,false); - parsertools.create_source_context(_var_def_statement,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _var_def_statement; - } - - case (int)RuleConstants.RULE_VAR_DECL_PART_NORMAL_TKCOLON : - // ::= tkColon - - { - var_def_statement _var_def_statement=new var_def_statement((ident_list)LRParser.GetReductionSyntaxNode(0),(type_definition)LRParser.GetReductionSyntaxNode(2),null,definition_attribute.None,false); - parsertools.create_source_context(_var_def_statement,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _var_def_statement; - } - - case (int)RuleConstants.RULE_VAR_INIT_VALUE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VAR_INIT_VALUE_TYPED : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPED_CONST_OR_NEW : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPED_CONST_OR_NEW2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPED_CONST_OR_NEW3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VAR_NAME_LIST : - // ::= - - { - ident_list _ident_list=new ident_list(); - parsertools.create_source_context(_ident_list,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - - _ident_list.idents.Add((ident)LRParser.GetReductionSyntaxNode(0)); - return _ident_list; - } - - case (int)RuleConstants.RULE_VAR_NAME_LIST_TKCOMMA : - // ::= tkComma - - { - ident_list _ident_list=(ident_list)LRParser.GetReductionSyntaxNode(0); - _ident_list.idents.Add((ident)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_ident_list,_ident_list,LRParser.GetReductionSyntaxNode(2)); - return _ident_list; - } - - case (int)RuleConstants.RULE_VAR_NAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_DECLARED_VAR_NAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CONSTRUCTOR_DECL : - // ::= - - //procedure_definition create - { - procedure_definition _procedure_definition=new procedure_definition((procedure_header)LRParser.GetReductionSyntaxNode(0),null); - object rt=LRParser.GetReductionSyntaxNode(0); - if(LRParser.GetReductionSyntaxNode(1)!=null) { - rt=LRParser.GetReductionSyntaxNode(1); - if(LRParser.GetReductionSyntaxNode(1) is proc_block) _procedure_definition.proc_body=(proc_block)LRParser.GetReductionSyntaxNode(1); - if(LRParser.GetReductionSyntaxNode(1) is procedure_attribute) { - procedure_header ph=_procedure_definition.proc_header; - if(ph.proc_attributes==null) { - ph.proc_attributes=new procedure_attributes_list(); - parsertools.assign_source_context(ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - ph.proc_attributes.proc_attributes.Add((procedure_attribute)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(ph.proc_attributes,ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - } - parsertools.create_source_context(_procedure_definition,LRParser.GetReductionSyntaxNode(0),rt); - - return _procedure_definition; - } - - case (int)RuleConstants.RULE_ABC_CONSTRUCTOR_DECL : - // ::= - - //procedure_definition create - { - procedure_definition _procedure_definition=new procedure_definition((procedure_header)LRParser.GetReductionSyntaxNode(0),null); - object rt=LRParser.GetReductionSyntaxNode(0); - if(LRParser.GetReductionSyntaxNode(1)!=null) { - rt=LRParser.GetReductionSyntaxNode(1); - if(LRParser.GetReductionSyntaxNode(1) is proc_block) _procedure_definition.proc_body=(proc_block)LRParser.GetReductionSyntaxNode(1); - if(LRParser.GetReductionSyntaxNode(1) is procedure_attribute) { - procedure_header ph=_procedure_definition.proc_header; - if(ph.proc_attributes==null) { - ph.proc_attributes=new procedure_attributes_list(); - parsertools.assign_source_context(ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - ph.proc_attributes.proc_attributes.Add((procedure_attribute)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(ph.proc_attributes,ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - } - parsertools.create_source_context(_procedure_definition,LRParser.GetReductionSyntaxNode(0),rt); - - return _procedure_definition; - } - - case (int)RuleConstants.RULE_DESTRUCTOR_DECL : - // ::= - - //procedure_definition create - { - procedure_definition _procedure_definition=new procedure_definition((procedure_header)LRParser.GetReductionSyntaxNode(0),null); - object rt=LRParser.GetReductionSyntaxNode(0); - if(LRParser.GetReductionSyntaxNode(1)!=null) { - rt=LRParser.GetReductionSyntaxNode(1); - if(LRParser.GetReductionSyntaxNode(1) is proc_block) _procedure_definition.proc_body=(proc_block)LRParser.GetReductionSyntaxNode(1); - if(LRParser.GetReductionSyntaxNode(1) is procedure_attribute) { - procedure_header ph=_procedure_definition.proc_header; - if(ph.proc_attributes==null) { - ph.proc_attributes=new procedure_attributes_list(); - parsertools.assign_source_context(ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - ph.proc_attributes.proc_attributes.Add((procedure_attribute)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(ph.proc_attributes,ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - } - parsertools.create_source_context(_procedure_definition,LRParser.GetReductionSyntaxNode(0),rt); - - return _procedure_definition; - } - - case (int)RuleConstants.RULE_ABC_DESTRUCTOR_DECL : - // ::= - - //procedure_definition create - { - procedure_definition _procedure_definition=new procedure_definition((procedure_header)LRParser.GetReductionSyntaxNode(0),null); - object rt=LRParser.GetReductionSyntaxNode(0); - if(LRParser.GetReductionSyntaxNode(1)!=null) { - rt=LRParser.GetReductionSyntaxNode(1); - if(LRParser.GetReductionSyntaxNode(1) is proc_block) _procedure_definition.proc_body=(proc_block)LRParser.GetReductionSyntaxNode(1); - if(LRParser.GetReductionSyntaxNode(1) is procedure_attribute) { - procedure_header ph=_procedure_definition.proc_header; - if(ph.proc_attributes==null) { - ph.proc_attributes=new procedure_attributes_list(); - parsertools.assign_source_context(ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - ph.proc_attributes.proc_attributes.Add((procedure_attribute)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(ph.proc_attributes,ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - } - parsertools.create_source_context(_procedure_definition,LRParser.GetReductionSyntaxNode(0),rt); - - return _procedure_definition; - } - - case (int)RuleConstants.RULE_NOT_CONSTRUCTOR_BLOCK_DECL : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_CONSTRUCTOR_BLOCK_DECL2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NOT_CONSTRUCTOR_BLOCK_DECL3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROC_DECL : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROC_DECL_TKCLASS : - // ::= tkClass - ((LRParser.GetReductionSyntaxNode(1) as procedure_definition).proc_header as procedure_header).class_keyword=true;return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_PROC_DECL_NOCLASS : - // ::= -{ - procedure_definition _procedure_definition=new procedure_definition((procedure_header)LRParser.GetReductionSyntaxNode(0),null); - object rt=LRParser.GetReductionSyntaxNode(0); - if(LRParser.GetReductionSyntaxNode(1)!=null) { - rt=LRParser.GetReductionSyntaxNode(1); - if (LRParser.GetReductionSyntaxNode(1) is proc_block) - { - add_lambda(LRParser.GetReductionSyntaxNode(1), _procedure_definition);//tasha 16.04.2010 - } - if(LRParser.GetReductionSyntaxNode(1) is procedure_attribute) { - procedure_header ph=_procedure_definition.proc_header; - if(ph.proc_attributes==null) { - ph.proc_attributes=new procedure_attributes_list(); - parsertools.assign_source_context(ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - ph.proc_attributes.proc_attributes.Add((procedure_attribute)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(ph.proc_attributes,ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - } - parsertools.create_source_context(_procedure_definition,LRParser.GetReductionSyntaxNode(0),rt); - - return _procedure_definition; - } - case (int)RuleConstants.RULE_ABC_PROC_DECL : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ABC_PROC_DECL_TKCLASS : - // ::= tkClass - ((LRParser.GetReductionSyntaxNode(1) as procedure_definition).proc_header as procedure_header).class_keyword=true;return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_ABC_PROC_DECL_NOCLASS : - // ::= -{procedure_definition _procedure_definition=new procedure_definition((procedure_header)LRParser.GetReductionSyntaxNode(0),null); - object rt=LRParser.GetReductionSyntaxNode(0); - if(LRParser.GetReductionSyntaxNode(1)!=null) { - rt=LRParser.GetReductionSyntaxNode(1); - if (LRParser.GetReductionSyntaxNode(1) is proc_block) - { - add_lambda(LRParser.GetReductionSyntaxNode(1), _procedure_definition);//tasha 16.04.2010 - } - if(LRParser.GetReductionSyntaxNode(1) is procedure_attribute) { - procedure_header ph=_procedure_definition.proc_header; - if(ph.proc_attributes==null) { - ph.proc_attributes=new procedure_attributes_list(); - parsertools.assign_source_context(ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - ph.proc_attributes.proc_attributes.Add((procedure_attribute)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(ph.proc_attributes,ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - } - parsertools.create_source_context(_procedure_definition,LRParser.GetReductionSyntaxNode(0),rt); - - return _procedure_definition;} - case (int)RuleConstants.RULE_FUNC_DECL : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FUNC_DECL_TKCLASS : - // ::= tkClass - ((LRParser.GetReductionSyntaxNode(1) as procedure_definition).proc_header as procedure_header).class_keyword=true;return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_FUNC_DECL_NOCLASS : - // ::= -{ - procedure_definition _procedure_definition=new procedure_definition((function_header)LRParser.GetReductionSyntaxNode(0),null); - object rt=LRParser.GetReductionSyntaxNode(0); - if(LRParser.GetReductionSyntaxNode(1)!=null) { - rt=LRParser.GetReductionSyntaxNode(1); - if (LRParser.GetReductionSyntaxNode(1) is proc_block) - { - add_lambda(LRParser.GetReductionSyntaxNode(1), _procedure_definition);//tasha 16.04.2010 - } - if(LRParser.GetReductionSyntaxNode(1) is procedure_attribute) { - procedure_header ph=_procedure_definition.proc_header; - if(ph.proc_attributes==null) { - ph.proc_attributes=new procedure_attributes_list(); - parsertools.assign_source_context(ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - ph.proc_attributes.proc_attributes.Add((procedure_attribute)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(ph.proc_attributes,ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - } - parsertools.create_source_context(_procedure_definition,LRParser.GetReductionSyntaxNode(0),rt); - - return _procedure_definition;} - case (int)RuleConstants.RULE_ABC_FUNC_DECL : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ABC_FUNC_DECL_TKCLASS : - // ::= tkClass - ((LRParser.GetReductionSyntaxNode(1) as procedure_definition).proc_header as procedure_header).class_keyword=true;return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_ABC_FUNC_DECL_NOCLASS : - // ::= -{ - procedure_definition _procedure_definition=new procedure_definition((function_header)LRParser.GetReductionSyntaxNode(0),null); - object rt=LRParser.GetReductionSyntaxNode(0); - if(LRParser.GetReductionSyntaxNode(1)!=null) { - rt=LRParser.GetReductionSyntaxNode(1); - if (LRParser.GetReductionSyntaxNode(1) is proc_block) - { - add_lambda(LRParser.GetReductionSyntaxNode(1), _procedure_definition);//tasha 16.04.2010 - } - if(LRParser.GetReductionSyntaxNode(1) is procedure_attribute) { - procedure_header ph=_procedure_definition.proc_header; - if(ph.proc_attributes==null) { - ph.proc_attributes=new procedure_attributes_list(); - parsertools.assign_source_context(ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - ph.proc_attributes.proc_attributes.Add((procedure_attribute)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(ph.proc_attributes,ph.proc_attributes,LRParser.GetReductionSyntaxNode(1)); - } - } - parsertools.create_source_context(_procedure_definition,LRParser.GetReductionSyntaxNode(0),rt); - - return _procedure_definition; - } - case (int)RuleConstants.RULE_PROC_HEADING_TKPROCEDURE : - // ::= tkProcedure - - { - procedure_header _procedure_header=new procedure_header(null,null,(method_name)LRParser.GetReductionSyntaxNode(1),false,false,null,null); - - object rt=LRParser.GetReductionSyntaxNode(1); - if(_procedure_header.name.meth_name is template_type_name) - { - _procedure_header.template_args=(_procedure_header.name.meth_name as template_type_name).template_args; - ident id = new ident(_procedure_header.name.meth_name.name); - parsertools.create_source_context(id,_procedure_header.name.meth_name,_procedure_header.name.meth_name); - _procedure_header.name.meth_name=id; - } - if (LRParser.GetReductionSyntaxNode(2)!=null) { - rt=LRParser.GetReductionSyntaxNode(2); - _procedure_header.parameters=(formal_parameters)LRParser.GetReductionSyntaxNode(2); - } - if(LRParser.GetReductionSyntaxNode(3)!=null) - (LRParser.GetReductionSyntaxNode(3) as SyntaxError).bad_node=_procedure_header; - if (LRParser.GetReductionSyntaxNode(4)!=null) { - rt=LRParser.GetReductionSyntaxNode(4); - if (((procedure_attributes_list)LRParser.GetReductionSyntaxNode(4)).proc_attributes.Count>0) - _procedure_header.proc_attributes=(procedure_attributes_list)LRParser.GetReductionSyntaxNode(4); - } - if (LRParser.GetReductionSyntaxNode(5)!=null) { - rt=LRParser.GetReductionSyntaxNode(5); - _procedure_header.where_defs = (where_definition_list)LRParser.GetReductionSyntaxNode(5); - } - parsertools.create_source_context(_procedure_header,LRParser.GetReductionSyntaxNode(0),rt); - - return _procedure_header; - } - - case (int)RuleConstants.RULE_PROC_NAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FUNC_NAME : - // ::= - - { - method_name _method_name=new method_name(null,null,(ident)LRParser.GetReductionSyntaxNode(0),null); - parsertools.create_source_context(_method_name,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - - return _method_name; - } - - case (int)RuleConstants.RULE_FUNC_NAME_TKPOINT : - // ::= tkPoint - - { - method_name _method_name=new method_name(null,(ident)LRParser.GetReductionSyntaxNode(0),(ident)LRParser.GetReductionSyntaxNode(2),null); - parsertools.create_source_context(_method_name,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _method_name; - } - - case (int)RuleConstants.RULE_FUNC_NAME_TKPOINT_TKPOINT : - // ::= tkPoint tkPoint - - { - method_name _method_name=new method_name(null,(ident)LRParser.GetReductionSyntaxNode(0),(ident)LRParser.GetReductionSyntaxNode(4),(ident)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_method_name,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(4)); - - return _method_name; - } - - case (int)RuleConstants.RULE_FUNC_CLASS_NAME_IDENT : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FUNC_METH_NAME_IDENT : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FUNC_METH_NAME_IDENT2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FUNC_NAME_WITH_TEMPLATE_ARGS : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FUNC_NAME_WITH_TEMPLATE_ARGS2 : - // ::= - - { - template_type_name _template_type_name=new template_type_name((ident_list)LRParser.GetReductionSyntaxNode(1)); - - _template_type_name.name=((ident)LRParser.GetReductionSyntaxNode(0)).name; - parsertools.create_source_context(_template_type_name,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _template_type_name; - } - - case (int)RuleConstants.RULE_FUNC_NAME_IDENT : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FUNC_NAME_IDENT2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FUNC_HEADING_TKFUNCTION_TKCOLON : - // ::= tkFunction tkColon - - { - function_header _function_header=new function_header(); - - object rt=LRParser.GetReductionSyntaxNode(1); - _function_header.name=(method_name)LRParser.GetReductionSyntaxNode(1); - if(_function_header.name.meth_name is template_type_name) - { - _function_header.template_args=(_function_header.name.meth_name as template_type_name).template_args; - ident id = new ident(_function_header.name.meth_name.name); - parsertools.create_source_context(id,_function_header.name.meth_name,_function_header.name.meth_name); - _function_header.name.meth_name=id; - } - //_function_header.template_args=(ident_list)LRParser.GetReductionSyntaxNode(2); - if (LRParser.GetReductionSyntaxNode(2)!=null) { - rt=LRParser.GetReductionSyntaxNode(2); - _function_header.parameters=(formal_parameters)LRParser.GetReductionSyntaxNode(2); - } - if (LRParser.GetReductionSyntaxNode(4)!=null) { - rt=LRParser.GetReductionSyntaxNode(4); - _function_header.return_type=(type_definition)LRParser.GetReductionSyntaxNode(4); - } - if (LRParser.GetReductionSyntaxNode(5)!=null) { - rt=LRParser.GetReductionSyntaxNode(5); - if (((procedure_attributes_list)LRParser.GetReductionSyntaxNode(5)).proc_attributes.Count>0) - _function_header.proc_attributes=(procedure_attributes_list)LRParser.GetReductionSyntaxNode(5); - } - if (LRParser.GetReductionSyntaxNode(6)!=null) { - rt=LRParser.GetReductionSyntaxNode(6); - _function_header.where_defs = (where_definition_list)LRParser.GetReductionSyntaxNode(6); - } - _function_header.of_object=false; - _function_header.class_keyword=false; - parsertools.create_source_context(_function_header,LRParser.GetReductionSyntaxNode(0),rt); - - return _function_header; - } - - case (int)RuleConstants.RULE_FUNC_HEADING_TKFUNCTION : - // ::= tkFunction - - { - function_header _function_header=new function_header(); - - object rt=LRParser.GetReductionSyntaxNode(1); - _function_header.name=(method_name)LRParser.GetReductionSyntaxNode(1); - if (LRParser.GetReductionSyntaxNode(2)!=null) { - rt=LRParser.GetReductionSyntaxNode(2); - if (((procedure_attributes_list)LRParser.GetReductionSyntaxNode(2)).proc_attributes.Count>0) - _function_header.proc_attributes=(procedure_attributes_list)LRParser.GetReductionSyntaxNode(2); - } - _function_header.of_object=false; - _function_header.class_keyword=false; - parsertools.create_source_context(_function_header,LRParser.GetReductionSyntaxNode(0),rt); - - return _function_header; - } - - case (int)RuleConstants.RULE_PROC_BLOCK : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FUNC_BLOCK : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROC_BLOCK_DECL : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROC_BLOCK_DECL2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROC_BLOCK_DECL3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROC_BLOCK_DECL_TKFORWARD_TKSEMICOLON : - // ::= tkForward tkSemiColon -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ABC_PROC_BLOCK : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ABC_PROC_BLOCK2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXTERNAL_DIRECTR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXTERNAL_DIRECTR_TKSEMICOLON : - // ::= tkSemiColon -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXTERNAL_DIRECTR_TKEXTERNAL_TKSEMICOLON : - // ::= tkExternal tkSemiColon - - { - external_directive _external_directive=new external_directive(null,null); - - parsertools.create_source_context(_external_directive,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _external_directive; - } - - case (int)RuleConstants.RULE_EXTERNAL_DIRECTR_IDENT : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXTERNAL_DIRECTR_IDENT2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ABC_EXTERNAL_DIRECTR_TKEXTERNAL_TKNAME : - // ::= tkExternal tkName - - { - external_directive _external_directive=new external_directive((expression)LRParser.GetReductionSyntaxNode(1),(expression)LRParser.GetReductionSyntaxNode(3)); - - parsertools.create_source_context(_external_directive,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - return _external_directive; - } - - case (int)RuleConstants.RULE_ABC_EXTERNAL_DIRECTR_TKEXTERNAL : - // ::= tkExternal - - { - external_directive _external_directive=new external_directive((expression)LRParser.GetReductionSyntaxNode(1),null); - - parsertools.create_source_context(_external_directive,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _external_directive; - } - - case (int)RuleConstants.RULE_ASM_BLOCK_TKASMBODY_TKSEMICOLON : - // ::= tkAsmBody tkSemiColon - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkAsmBody tkSemiColon"));}return null; - case (int)RuleConstants.RULE_BLOCK_TKSEMICOLON : - // ::= tkSemiColon - - { - block _block=new block((declarations)LRParser.GetReductionSyntaxNode(0),(statement_list)LRParser.GetReductionSyntaxNode(1)); - - parsertools.create_source_context(_block,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)),LRParser.GetReductionSyntaxNode(2)); - return _block; - } - - case (int)RuleConstants.RULE_ABC_BLOCK_TKSEMICOLON : - // ::= tkSemiColon - - { - block _block=new block((declarations)LRParser.GetReductionSyntaxNode(0),(statement_list)LRParser.GetReductionSyntaxNode(1)); - - parsertools.create_source_context(_block,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)),LRParser.GetReductionSyntaxNode(2)); - return _block; - } - - case (int)RuleConstants.RULE_FP_LIST : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_FP_LIST_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose - if(LRParser.GetReductionSyntaxNode(1)!=null) parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_FP_SECT_LIST : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_FP_SECT_LIST2 : - // ::= - - { - formal_parameters _formal_parameters=new formal_parameters(); - - _formal_parameters.params_list.Add((typed_parameters)LRParser.GetReductionSyntaxNode(0)); - - return _formal_parameters; - } - - case (int)RuleConstants.RULE_FP_SECT_LIST_TKSEMICOLON : - // ::= tkSemiColon - - { - formal_parameters _formal_parameters=(formal_parameters)LRParser.GetReductionSyntaxNode(0); - _formal_parameters.params_list.Add((typed_parameters)LRParser.GetReductionSyntaxNode(2)); - - return _formal_parameters; - } - - case (int)RuleConstants.RULE_FP_SECT : - // ::= - - { - declaration _declaration; - _declaration=LRParser.GetReductionSyntaxNode(1) as declaration; - _declaration.attributes = LRParser.GetReductionSyntaxNode(0) as attribute_list; - - return _declaration; - } - - case (int)RuleConstants.RULE_SIMPLE_FP_SECT_TKCOLON : - // ::= tkColon - - { - typed_parameters _typed_parameters=new typed_parameters((ident_list)LRParser.GetReductionSyntaxNode(0),(type_definition)LRParser.GetReductionSyntaxNode(2),parametr_kind.none,null); - parsertools.create_source_context(_typed_parameters,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _typed_parameters; - } - - case (int)RuleConstants.RULE_SIMPLE_FP_SECT_TKVAR_TKCOLON : - // ::= tkVar tkColon - - { - typed_parameters _typed_parameters=new typed_parameters((ident_list)LRParser.GetReductionSyntaxNode(1),(type_definition)LRParser.GetReductionSyntaxNode(3),parametr_kind.var_parametr,null); - parsertools.create_source_context(_typed_parameters,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - return _typed_parameters; - } - - case (int)RuleConstants.RULE_SIMPLE_FP_SECT_TKOUT_TKCOLON : - // ::= tkOut tkColon - - { - typed_parameters _typed_parameters=new typed_parameters((ident_list)LRParser.GetReductionSyntaxNode(1),(type_definition)LRParser.GetReductionSyntaxNode(3),parametr_kind.out_parametr,null); - parsertools.create_source_context(_typed_parameters,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - return _typed_parameters; - } - - case (int)RuleConstants.RULE_SIMPLE_FP_SECT_TKCONST_TKCOLON : - // ::= tkConst tkColon - - { - typed_parameters _typed_parameters=new typed_parameters((ident_list)LRParser.GetReductionSyntaxNode(1),(type_definition)LRParser.GetReductionSyntaxNode(3),parametr_kind.const_parametr,null); - parsertools.create_source_context(_typed_parameters,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - return _typed_parameters; - } - - case (int)RuleConstants.RULE_SIMPLE_FP_SECT_TKPARAMS_TKCOLON : - // ::= tkParams tkColon - - { - typed_parameters _typed_parameters=new typed_parameters((ident_list)LRParser.GetReductionSyntaxNode(1),(type_definition)LRParser.GetReductionSyntaxNode(3),parametr_kind.params_parametr,null); - parsertools.create_source_context(_typed_parameters,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - return _typed_parameters; - } - - case (int)RuleConstants.RULE_SIMPLE_FP_SECT_TKCOLON_TKASSIGN : - // ::= tkColon tkAssign - - { - typed_parameters _typed_parameters=new typed_parameters((ident_list)LRParser.GetReductionSyntaxNode(0),(type_definition)LRParser.GetReductionSyntaxNode(2),parametr_kind.none,(expression)LRParser.GetReductionSyntaxNode(4)); - parsertools.create_source_context(_typed_parameters,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(4)); - - return _typed_parameters; - } - - case (int)RuleConstants.RULE_SIMPLE_FP_SECT_TKVAR_TKCOLON_TKASSIGN : - // ::= tkVar tkColon tkAssign - - { - typed_parameters _typed_parameters=new typed_parameters((ident_list)LRParser.GetReductionSyntaxNode(1),(type_definition)LRParser.GetReductionSyntaxNode(3),parametr_kind.var_parametr,(expression)LRParser.GetReductionSyntaxNode(5)); - parsertools.create_source_context(_typed_parameters,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(5)); - return _typed_parameters; - } - - case (int)RuleConstants.RULE_SIMPLE_FP_SECT_TKOUT_TKCOLON_TKASSIGN : - // ::= tkOut tkColon tkAssign - - { - typed_parameters _typed_parameters=new typed_parameters((ident_list)LRParser.GetReductionSyntaxNode(1),(type_definition)LRParser.GetReductionSyntaxNode(3),parametr_kind.out_parametr,(expression)LRParser.GetReductionSyntaxNode(5)); - parsertools.create_source_context(_typed_parameters,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(5)); - return _typed_parameters; - } - - case (int)RuleConstants.RULE_SIMPLE_FP_SECT_TKCONST_TKCOLON_TKASSIGN : - // ::= tkConst tkColon tkAssign - - { - typed_parameters _typed_parameters=new typed_parameters((ident_list)LRParser.GetReductionSyntaxNode(1),(type_definition)LRParser.GetReductionSyntaxNode(3),parametr_kind.const_parametr,(expression)LRParser.GetReductionSyntaxNode(5)); - parsertools.create_source_context(_typed_parameters,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(5)); - return _typed_parameters; - } - - case (int)RuleConstants.RULE_PARAM_NAME_LIST : - // ::= - - //TemplateList for ident_list (create) - { - ident_list _ident_list=new ident_list(); - _ident_list.source_context=((ident)LRParser.GetReductionSyntaxNode(0)).source_context; - _ident_list.idents.Add((ident)LRParser.GetReductionSyntaxNode(0)); - return _ident_list; - } - - case (int)RuleConstants.RULE_PARAM_NAME_LIST_TKCOMMA : - // ::= tkComma - - //TemplateList for ident_list (add) - { - ident_list _ident_list=(ident_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_ident_list,_ident_list,LRParser.GetReductionSyntaxNode(2)); - _ident_list.idents.Add(LRParser.GetReductionSyntaxNode(2) as ident); - return _ident_list; - } - - case (int)RuleConstants.RULE_PARAM_NAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FPTYPE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FPTYPE_NEW : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FPTYPE_NEW_TKARRAY_TKOF_TKCONST : - // ::= tkArray tkOf tkConst - - { - array_of_const_type_definition _array_of_const_type_definition=new array_of_const_type_definition(); - parsertools.create_source_context(_array_of_const_type_definition,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _array_of_const_type_definition; - } - - case (int)RuleConstants.RULE_STMT : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_STMT_TKCOLON : - // ::= tkColon - - { - labeled_statement _labeled_statement=new labeled_statement((ident)LRParser.GetReductionSyntaxNode(0),(statement)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_labeled_statement,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1))); - return _labeled_statement; - } - - case (int)RuleConstants.RULE_UNLABELLED_STMT : - // ::= - - { - empty_statement _empty_statement=new empty_statement(); - - return _empty_statement; - } - - case (int)RuleConstants.RULE_UNLABELLED_STMT2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT5 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT6 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT7 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT8 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT9 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT10 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT11 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT12 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT13 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT14 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT15 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT16 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT17 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT18 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_UNLABELLED_STMT19 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VAR_STMT_TKVAR : - // ::= tkVar - - { - var_statement _var_statement=new var_statement(LRParser.GetReductionSyntaxNode(1) as var_def_statement); - - ///////////////tasha 28.04.2010 - pascalABC_var_statements.Add((var_def_statement)LRParser.GetReductionSyntaxNode(1)); - /////////////////////////////// - parsertools.create_source_context(_var_statement,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _var_statement; - } - - case (int)RuleConstants.RULE_ASSIGNMENT : - // ::= -{ - ///////////////tasha 28.04.2010 - for_assignment(LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2)); - /////////////////////////////// - - assign _assign=new assign(LRParser.GetReductionSyntaxNode(0) as addressed_value,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_assign,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _assign; - } - case (int)RuleConstants.RULE_PROC_CALL : - // ::= - - { - procedure_call _procedure_call=new procedure_call(LRParser.GetReductionSyntaxNode(0) as addressed_value); - parsertools.create_source_context(_procedure_call,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - - return _procedure_call; - } - - case (int)RuleConstants.RULE_GOTO_STMT_TKGOTO : - // ::= tkGoto - - { - goto_statement _goto_statement=new goto_statement((ident)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_goto_statement,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - parsertools.create_source_context(_goto_statement,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _goto_statement; - } - - case (int)RuleConstants.RULE_COMPOUND_STMT_TKBEGIN_TKEND : - // ::= tkBegin tkEnd - - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - ((statement_list)LRParser.GetReductionSyntaxNode(1)).left_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(0); - ((statement_list)LRParser.GetReductionSyntaxNode(1)).right_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(2); - return LRParser.GetReductionSyntaxNode(1); - - case (int)RuleConstants.RULE_STMT_LIST : - // ::= - - { - statement_list _statement_list=new statement_list(); - - _statement_list.subnodes.Add((statement)LRParser.GetReductionSyntaxNode(0)); - parsertools.assign_source_context(_statement_list,LRParser.GetReductionSyntaxNode(0)); - - return _statement_list; - } - - case (int)RuleConstants.RULE_STMT_LIST_TKSEMICOLON : - // ::= tkSemiColon - - { - statement_list _statement_list; - _statement_list=(statement_list)LRParser.GetReductionSyntaxNode(0); - if(_statement_list!=LRParser.GetReductionSyntaxNode(2)){ - _statement_list.subnodes.Add((statement)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_statement_list,_statement_list,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1))); - } - - return _statement_list; - } - - case (int)RuleConstants.RULE_IF_STMT_TKIF : - // ::= tkIf -((if_node)LRParser.GetReductionSyntaxNode(2)).condition=(expression)LRParser.GetReductionSyntaxNode(1); - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return LRParser.GetReductionSyntaxNode(2); - - case (int)RuleConstants.RULE_IF_THEN_ELSE_BRANCH_TKTHEN : - // ::= tkThen - - { - if_node _if_node=new if_node(null,(statement)LRParser.GetReductionSyntaxNode(1),null); - - parsertools.create_source_context(_if_node,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0))); - - return _if_node; - } - - case (int)RuleConstants.RULE_IF_THEN_ELSE_BRANCH_TKTHEN_TKELSE : - // ::= tkThen tkElse - - { - if_node _if_node=new if_node(null,(statement)LRParser.GetReductionSyntaxNode(1),(statement)LRParser.GetReductionSyntaxNode(3)); - - parsertools.create_source_context(_if_node,LRParser.GetReductionSyntaxNode(2),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(2))); - - return _if_node; - } - - case (int)RuleConstants.RULE_THEN_BRANCH : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ELSE_BRANCH : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_CASE_STMT_TKCASE_TKOF_TKEND : - // ::= tkCase tkOf tkEnd - - { - case_node _case_node=new case_node((expression)LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(3) as case_variants,LRParser.GetReductionSyntaxNode(4) as statement); - - parsertools.create_source_context(_case_node,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(5)); - return _case_node; - } - - case (int)RuleConstants.RULE_CASE_LIST : - // ::= - - { - case_variants _case_variants=new case_variants(); - - if (LRParser.GetReductionSyntaxNode(0) is case_variant) - { - _case_variants.variants.Add((case_variant)LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_case_variants,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - } - return _case_variants; - } - - case (int)RuleConstants.RULE_CASE_LIST_TKSEMICOLON : - // ::= tkSemiColon - - { - case_variants _case_variants=(case_variants)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_case_variants,parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1))); - if (LRParser.GetReductionSyntaxNode(2) is case_variant) _case_variants.variants.Add((case_variant)LRParser.GetReductionSyntaxNode(2)); - return _case_variants; - } - - case (int)RuleConstants.RULE_CASE_ITEM : - // ::= - - { - empty_statement _empty_statement=new empty_statement(); - - return _empty_statement; - } - - case (int)RuleConstants.RULE_CASE_ITEM_TKCOLON : - // ::= tkColon - - { - case_variant _case_variant=new case_variant((expression_list)LRParser.GetReductionSyntaxNode(0),(statement)LRParser.GetReductionSyntaxNode(2)); - - parsertools.create_source_context(_case_variant,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1))); - return _case_variant; - } - - case (int)RuleConstants.RULE_CASE_LABEL_LIST : - // ::= - - //TemplateList for expression_list (create) - { - expression_list _expression_list=new expression_list(); - _expression_list.source_context=((expression)LRParser.GetReductionSyntaxNode(0)).source_context; - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(0)); - return _expression_list; - } - - case (int)RuleConstants.RULE_CASE_LABEL_LIST_TKCOMMA : - // ::= tkComma - - //TemplateList for expression_list (add) - { - expression_list _expression_list=(expression_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_expression_list,_expression_list,LRParser.GetReductionSyntaxNode(2)); - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(2) as expression); - return _expression_list; - } - - case (int)RuleConstants.RULE_CASE_LABEL : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ELSE_CASE : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_ELSE_CASE_TKELSE : - // ::= tkElse -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_REPEAT_STMT_TKREPEAT_TKUNTIL : - // ::= tkRepeat tkUntil - - { - repeat_node _repeat_node=new repeat_node((statement)LRParser.GetReductionSyntaxNode(1),(expression)LRParser.GetReductionSyntaxNode(3)); - - ((statement_list)LRParser.GetReductionSyntaxNode(1)).left_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(0); - ((statement_list)LRParser.GetReductionSyntaxNode(1)).right_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(2); - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_repeat_node,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - - return _repeat_node; - } - - case (int)RuleConstants.RULE_WHILE_STMT_TKWHILE : - // ::= tkWhile - - { - while_node _while_node=new while_node((expression)LRParser.GetReductionSyntaxNode(1),(statement)LRParser.GetReductionSyntaxNode(3),WhileCycleType.While); - - if (LRParser.GetReductionSyntaxNode(2) == null) - { - file_position fp = (LRParser.GetReductionSyntaxNode(1) as syntax_tree_node).source_context.end_position; - syntax_tree_node err_stn = (syntax_tree_node)LRParser.GetReductionSyntaxNode(3); - if (err_stn == null) - err_stn = (syntax_tree_node)LRParser.GetReductionSyntaxNode(1); - errors.Add(new Errors.PABCNETUnexpectedToken(current_file_name, StringResources.Get("TKDO"),new SourceContext(fp.line_num, fp.column_num+1, fp.line_num, fp.column_num+1, 0, 0),err_stn)); - parsertools.create_source_context(_while_node,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(3))); - } - else - parsertools.create_source_context(_while_node,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(2))); - - return _while_node; - } - - case (int)RuleConstants.RULE_OPT_TK_DO_TKDO : - // ::= tkDo -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_TK_DO : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_LOCK_STMT_TKLOCK_TKDO : - // ::= tkLock tkDo - - { - lock_stmt _lock_stmt=new lock_stmt((expression)LRParser.GetReductionSyntaxNode(1),(statement)LRParser.GetReductionSyntaxNode(3)); - - parsertools.create_source_context(_lock_stmt,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(2))); - - return _lock_stmt; - } - - case (int)RuleConstants.RULE_FOREACH_STMT_TKFOREACH_TKIN_TKDO : - // ::= tkForeach tkIn tkDo - - { - foreach_stmt _foreach_stmt=new foreach_stmt((ident)LRParser.GetReductionSyntaxNode(1),(type_definition)LRParser.GetReductionSyntaxNode(2),(expression)LRParser.GetReductionSyntaxNode(4),(statement)LRParser.GetReductionSyntaxNode(6)); - - parsertools.create_source_context(_foreach_stmt,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(6),LRParser.GetReductionSyntaxNode(5))); - - return _foreach_stmt; - } - - case (int)RuleConstants.RULE_FOREACH_STMT_TKFOREACH_TKVAR_TKCOLON_TKIN_TKDO : - // ::= tkForeach tkVar tkColon tkIn tkDo - - { - foreach_stmt _foreach_stmt=new foreach_stmt((ident)LRParser.GetReductionSyntaxNode(2),(type_definition)LRParser.GetReductionSyntaxNode(4),(expression)LRParser.GetReductionSyntaxNode(6),(statement)LRParser.GetReductionSyntaxNode(8)); - - parsertools.create_source_context(_foreach_stmt,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(8),LRParser.GetReductionSyntaxNode(7))); - - return _foreach_stmt; - } - - case (int)RuleConstants.RULE_FOREACH_STMT_IDENT_DYPE_OPT_TKCOLON : - // ::= tkColon - return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_FOREACH_STMT_IDENT_DYPE_OPT : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_FOR_STMT_TKFOR : - // ::= tkFor - - { - for_node _for_node=new for_node((ident)LRParser.GetReductionSyntaxNode(2),(expression)LRParser.GetReductionSyntaxNode(4),(expression)LRParser.GetReductionSyntaxNode(6),(statement)LRParser.GetReductionSyntaxNode(8),(for_cycle_type)LRParser.GetReductionSyntaxNode(5),null,LRParser.GetReductionSyntaxNode(3) as type_definition, LRParser.GetReductionSyntaxNode(1)!=null); - - if (LRParser.GetReductionSyntaxNode(7) == null) - { - file_position fp = (LRParser.GetReductionSyntaxNode(6) as syntax_tree_node).source_context.end_position; - syntax_tree_node err_stn = (syntax_tree_node)LRParser.GetReductionSyntaxNode(8); - if (err_stn == null) - err_stn = (syntax_tree_node)LRParser.GetReductionSyntaxNode(6); - errors.Add(new Errors.PABCNETUnexpectedToken(current_file_name, StringResources.Get("TKDO"),new SourceContext(fp.line_num, fp.column_num+1, fp.line_num, fp.column_num+1, 0, 0),err_stn)); - parsertools.create_source_context(_for_node,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(8),LRParser.GetReductionSyntaxNode(6))); - } - else - parsertools.create_source_context(_for_node,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(8),LRParser.GetReductionSyntaxNode(7))); - - return _for_node; - } - - case (int)RuleConstants.RULE_OPT_VAR_TKVAR : - // ::= tkVar -return true; - case (int)RuleConstants.RULE_OPT_VAR : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_FOR_STMT_DECL_OR_ASSIGN_TKASSIGN : - // ::= tkAssign -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FOR_STMT_DECL_OR_ASSIGN_TKCOLON_TKASSIGN : - // ::= tkColon tkAssign -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_FOR_CYCLE_TYPE_TKTO : - // ::= tkTo - return for_cycle_type.to; - case (int)RuleConstants.RULE_FOR_CYCLE_TYPE_TKDOWNTO : - // ::= tkDownto - return for_cycle_type.downto; - case (int)RuleConstants.RULE_WITH_STMT_TKWITH_TKDO : - // ::= tkWith tkDo - - { - with_statement _with_statement=new with_statement((statement)LRParser.GetReductionSyntaxNode(3),(expression_list)LRParser.GetReductionSyntaxNode(1)); - - parsertools.create_source_context(_with_statement,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(2))); - return _with_statement; - } - - case (int)RuleConstants.RULE_INHERITED_MESSAGE_TKINHERITED : - // ::= tkInherited - - { - inherited_message _inherited_message=new inherited_message(); - parsertools.assign_source_context(_inherited_message,LRParser.GetReductionSyntaxNode(0)); - return _inherited_message; - } - - case (int)RuleConstants.RULE_TRY_STMT_TKTRY : - // ::= tkTry - - { - try_stmt _try_stmt=new try_stmt(((statement_list)LRParser.GetReductionSyntaxNode(1)),(try_handler)LRParser.GetReductionSyntaxNode(2)); - - ((statement_list)LRParser.GetReductionSyntaxNode(1)).left_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_try_stmt,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _try_stmt; - } - - case (int)RuleConstants.RULE_TRY_HANDLER_TKFINALLY_TKEND : - // ::= tkFinally tkEnd - - { - try_handler_finally _try_handler_finally=new try_handler_finally((statement_list)LRParser.GetReductionSyntaxNode(1)); - - ((statement_list)LRParser.GetReductionSyntaxNode(1)).left_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(0); - ((statement_list)LRParser.GetReductionSyntaxNode(1)).right_logical_bracket=(syntax_tree_node)LRParser.GetReductionSyntaxNode(2); - parsertools.create_source_context(_try_handler_finally,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _try_handler_finally; - } - - case (int)RuleConstants.RULE_TRY_HANDLER_TKEXCEPT_TKEND : - // ::= tkExcept tkEnd - - { - try_handler_except _try_handler_except=new try_handler_except((exception_block)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_try_handler_except,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _try_handler_except; - } - - case (int)RuleConstants.RULE_EXCEPTION_BLOCK : - // ::= - - { - exception_block _exception_block=new exception_block(null,(exception_handler_list)LRParser.GetReductionSyntaxNode(0),(statement_list)LRParser.GetReductionSyntaxNode(1)); - - parsertools.create_source_context(_exception_block,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0))); - return _exception_block; - } - - case (int)RuleConstants.RULE_EXCEPTION_BLOCK_TKSEMICOLON : - // ::= tkSemiColon - - { - exception_block _exception_block=new exception_block(null,(exception_handler_list)LRParser.GetReductionSyntaxNode(0),(statement_list)LRParser.GetReductionSyntaxNode(2)); - - parsertools.create_source_context(_exception_block,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1))); - return _exception_block; - } - - case (int)RuleConstants.RULE_EXCEPTION_BLOCK2 : - // ::= - - { - exception_block _exception_block=new exception_block((statement_list)LRParser.GetReductionSyntaxNode(0),null,null); - - if (((syntax_tree_node)LRParser.GetReductionSyntaxNode(0)).source_context!=null) parsertools.assign_source_context(_exception_block,LRParser.GetReductionSyntaxNode(0)); - return _exception_block; - } - - case (int)RuleConstants.RULE_EXCEPTION_HANDLER_LIST : - // ::= - - //TemplateList for exception_handler_list (create) - { - exception_handler_list _exception_handler_list=new exception_handler_list(); - _exception_handler_list.source_context=((exception_handler)LRParser.GetReductionSyntaxNode(0)).source_context; - _exception_handler_list.handlers.Add((exception_handler)LRParser.GetReductionSyntaxNode(0)); - return _exception_handler_list; - } - - case (int)RuleConstants.RULE_EXCEPTION_HANDLER_LIST_TKSEMICOLON : - // ::= tkSemiColon - - //TemplateList for exception_handler_list (add) - { - exception_handler_list _exception_handler_list=(exception_handler_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_exception_handler_list,_exception_handler_list,LRParser.GetReductionSyntaxNode(2)); - _exception_handler_list.handlers.Add(LRParser.GetReductionSyntaxNode(2) as exception_handler); - return _exception_handler_list; - } - - case (int)RuleConstants.RULE_EXCEPTION_BLOCK_ELSE_BRANCH : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_EXCEPTION_BLOCK_ELSE_BRANCH_TKELSE : - // ::= tkElse -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_EXCEPTION_HANDLER_TKON_TKDO : - // ::= tkOn tkDo - - { - exception_handler _exception_handler=new exception_handler(((exception_ident)LRParser.GetReductionSyntaxNode(1)).variable,((exception_ident)LRParser.GetReductionSyntaxNode(1)).type_name,(statement)LRParser.GetReductionSyntaxNode(3)); - - parsertools.create_source_context(_exception_handler,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(3),LRParser.GetReductionSyntaxNode(2))); - return _exception_handler; - } - - case (int)RuleConstants.RULE_EXCEPTION_IDENTIFIER : - // ::= - - { - exception_ident _exception_ident=new exception_ident(null,(named_type_reference)LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_exception_ident,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - - return _exception_ident; - } - - case (int)RuleConstants.RULE_EXCEPTION_IDENTIFIER_TKCOLON : - // ::= tkColon - - { - exception_ident _exception_ident=new exception_ident((ident)LRParser.GetReductionSyntaxNode(0),(named_type_reference)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_exception_ident,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _exception_ident; - } - - case (int)RuleConstants.RULE_EXCEPTION_CLASS_TYPE_IDENTIFIER : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXCEPTION_VARIABLE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RAISE_STMT_TKRAISE : - // ::= tkRaise - - { - raise_stmt _raise_stmt=new raise_stmt(); - parsertools.assign_source_context(_raise_stmt,LRParser.GetReductionSyntaxNode(0)); - return _raise_stmt; - } - - case (int)RuleConstants.RULE_RAISE_STMT_TKRAISE2 : - // ::= tkRaise - - { - raise_stmt _raise_stmt=new raise_stmt((expression)LRParser.GetReductionSyntaxNode(1),null); - parsertools.create_source_context(_raise_stmt,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _raise_stmt; - } - - case (int)RuleConstants.RULE_RAISE_STMT_TKRAISE_TKAT : - // ::= tkRaise tkAt - - { - raise_stmt _raise_stmt=new raise_stmt((expression)LRParser.GetReductionSyntaxNode(1),(expression)LRParser.GetReductionSyntaxNode(3)); - parsertools.create_source_context(_raise_stmt,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - return _raise_stmt; - } - - case (int)RuleConstants.RULE_ASM_STMT_TKASMBODY : - // ::= tkAsmBody -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXPR_LIST : - // ::= - - //TemplateList for expression_list (create) - { - expression_list _expression_list=new expression_list(); - _expression_list.source_context=((expression)LRParser.GetReductionSyntaxNode(0)).source_context; - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(0)); - return _expression_list; - } - - case (int)RuleConstants.RULE_EXPR_LIST_TKCOMMA : - // ::= tkComma - - //TemplateList for expression_list (add) - { - expression_list _expression_list=(expression_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_expression_list,_expression_list,LRParser.GetReductionSyntaxNode(2)); - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(2) as expression); - return _expression_list; - } - - case (int)RuleConstants.RULE_ATTR_EXPR_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXPR_AS_STMT : - // ::= - - { - expression_as_statement _expression_as_statement=new expression_as_statement((expression)LRParser.GetReductionSyntaxNode(0)); - parsertools.create_source_context(_expression_as_statement,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _expression_as_statement; - } - - case (int)RuleConstants.RULE_ALLOWABLE_EXPR_AS_STMT : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXPR2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXPR3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXPR_L1 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EXPR_L12 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIZEOF_EXPR_TKSIZEOF_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkSizeOf tkRoundOpen tkRoundClose - - { - sizeof_operator _sizeof_operator=new sizeof_operator((named_type_reference)LRParser.GetReductionSyntaxNode(2),null); - parsertools.create_source_context(_sizeof_operator,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - return _sizeof_operator; - } - - case (int)RuleConstants.RULE_TYPEOF_EXPR_TKTYPEOF_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkTypeOf tkRoundOpen tkRoundClose - - { - typeof_operator _typeof_operator=new typeof_operator((named_type_reference)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_typeof_operator,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - return _typeof_operator; - } - - case (int)RuleConstants.RULE_QUESTION_EXPR_TKQUESTION_TKCOLON : - // ::= tkQuestion tkColon - - { - question_colon_expression _question_colon_expression=new question_colon_expression((expression)LRParser.GetReductionSyntaxNode(0),(expression)LRParser.GetReductionSyntaxNode(2),(expression)LRParser.GetReductionSyntaxNode(4)); - parsertools.create_source_context(_question_colon_expression,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(4)); - return _question_colon_expression; - } - - case (int)RuleConstants.RULE_OPT_AMPERSEND : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_OPT_AMPERSEND_TKAMPERSEND : - // ::= tkAmpersend -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_OR_TEMPLATE_TYPE_REFERENCE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_OR_TEMPLATE_TYPE_REFERENCE2 : - // ::= - - { - template_type_reference _template_type_reference=new template_type_reference((named_type_reference)LRParser.GetReductionSyntaxNode(0),(template_param_list)LRParser.GetReductionSyntaxNode(1)); - - parsertools.create_source_context(_template_type_reference,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _template_type_reference; - } - - case (int)RuleConstants.RULE_SIMPLE_OR_TEMPLATE_TYPE_REFERENCE_TKAMPERSEND : - // ::= tkAmpersend - - { - template_type_reference _template_type_reference=new template_type_reference((named_type_reference)LRParser.GetReductionSyntaxNode(0),(template_param_list)LRParser.GetReductionSyntaxNode(2)); - - parsertools.create_source_context(_template_type_reference,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _template_type_reference; - } - - case (int)RuleConstants.RULE_OPT_ARRAY_INITIALIZER_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose - - { - array_const _array_const=new array_const((expression_list)LRParser.GetReductionSyntaxNode(1)); - - parsertools.create_source_context(_array_const,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _array_const; - } - - case (int)RuleConstants.RULE_OPT_ARRAY_INITIALIZER : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_NEW_EXPR : - // ::= - - { - named_type_reference ntr=(named_type_reference)LRParser.GetReductionSyntaxNode(1); - new_expr newexpr=new new_expr(ntr,LRParser.GetReductionSyntaxNode(2) as expression_list,false,null); - parsertools.create_source_context(newexpr,LRParser.GetReductionSyntaxNode(0),parsertools.sc_not_null(LRParser.GetReductionSyntaxNode(2),LRParser.GetReductionSyntaxNode(1))); - if ((LRParser.GetReductionSyntaxNode(0) as ident).name.ToLower()!="new") - errors.Add(new Errors.PABCNETUnexpectedToken(current_file_name,";",((syntax_tree_node)LRParser.GetReductionSyntaxNode(0)).source_context,newexpr)); - return newexpr; - } - - case (int)RuleConstants.RULE_NEW_EXPR_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= tkSquareOpen tkSquareClose - - { - new_expr newexpr=new new_expr((type_definition)LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(3) as expression_list,true,LRParser.GetReductionSyntaxNode(5) as array_const); - if (LRParser.GetReductionSyntaxNode(5) != null) - parsertools.create_source_context(newexpr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(5)); - else - parsertools.create_source_context(newexpr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(4)); - if ((LRParser.GetReductionSyntaxNode(0) as ident).name.ToLower()!="new") - errors.Add(new Errors.PABCNETUnexpectedToken(current_file_name,";",((syntax_tree_node)LRParser.GetReductionSyntaxNode(0)).source_context,newexpr)); - return newexpr; - } - - case (int)RuleConstants.RULE_ARRAY_NAME_FOR_NEW_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ARRAY_NAME_FOR_NEW_EXPR2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_TEMPLATE_TYPE_PARAMS : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_OPT_TEMPLATE_TYPE_PARAMS2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_EXPR_LIST_WITH_BRACKET : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_OPT_EXPR_LIST_WITH_BRACKET_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose -return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_RELOP_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RELOP_EXPR2 : - // ::= - - { - bin_expr _bin_expr=new bin_expr((expression)LRParser.GetReductionSyntaxNode(0),(expression)LRParser.GetReductionSyntaxNode(2),((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_FORMAT_EXPR_TKCOLON : - // ::= tkColon - - { - format_expr _format_expr=new format_expr((expression)LRParser.GetReductionSyntaxNode(0),(expression)LRParser.GetReductionSyntaxNode(2),null); - parsertools.create_source_context(_format_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _format_expr; - } - - case (int)RuleConstants.RULE_FORMAT_EXPR_TKCOLON_TKCOLON : - // ::= tkColon tkColon - - { - format_expr _format_expr=new format_expr((expression)LRParser.GetReductionSyntaxNode(0),(expression)LRParser.GetReductionSyntaxNode(2),(expression)LRParser.GetReductionSyntaxNode(4)); - parsertools.create_source_context(_format_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(4)); - - return _format_expr; - } - - case (int)RuleConstants.RULE_RELOP_TKEQUAL : - // ::= tkEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RELOP_TKNOTEQUAL : - // ::= tkNotEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RELOP_TKLOWER : - // ::= tkLower -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RELOP_TKGREATER : - // ::= tkGreater -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RELOP_TKLOWEREQUAL : - // ::= tkLowerEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RELOP_TKGREATEREQUAL : - // ::= tkGreaterEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RELOP_TKIN : - // ::= tkIn -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_EXPR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_SIMPLE_EXPR2 : - // ::= - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_ADDOP_TKPLUS : - // ::= tkPlus -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ADDOP_TKMINUS : - // ::= tkMinus -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ADDOP_TKOR : - // ::= tkOr -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ADDOP_TKXOR : - // ::= tkXor -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ADDOP_TKCSHARPSTYLEOR : - // ::= tkCSharpStyleOr -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TYPECAST_OP_TKAS : - // ::= tkAs - return op_typecast.as_op; - case (int)RuleConstants.RULE_TYPECAST_OP_TKIS : - // ::= tkIs - return op_typecast.is_op; - case (int)RuleConstants.RULE_AS_IS_EXPR : - // ::= - - { - typecast_node _typecast_node=new typecast_node((addressed_value)LRParser.GetReductionSyntaxNode(0),(type_definition)LRParser.GetReductionSyntaxNode(2),(op_typecast)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_typecast_node,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - if (!(LRParser.GetReductionSyntaxNode(0) is addressed_value)) - errors.Add(new Errors.bad_operand_type(current_file_name,((syntax_tree_node)LRParser.GetReductionSyntaxNode(0)).source_context,_typecast_node)); - - return _typecast_node; - } - - case (int)RuleConstants.RULE_TERM : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TERM2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_TERM3 : - // ::= - - { - bin_expr _bin_expr=new bin_expr(LRParser.GetReductionSyntaxNode(0) as expression,LRParser.GetReductionSyntaxNode(2) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - parsertools.create_source_context(_bin_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _bin_expr; - } - - case (int)RuleConstants.RULE_TERM4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_MULOP_TKSTAR : - // ::= tkStar -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_MULOP_TKSLASH : - // ::= tkSlash -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_MULOP_TKDIV : - // ::= tkDiv -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_MULOP_TKMOD : - // ::= tkMod -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_MULOP_TKSHL : - // ::= tkShl -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_MULOP_TKSHR : - // ::= tkShr -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_MULOP_TKAND : - // ::= tkAnd -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_DEFAULT_EXPR_TKDEFAULT_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkDefault tkRoundOpen tkRoundClose - - { - default_operator _default_operator=new default_operator(LRParser.GetReductionSyntaxNode(2) as named_type_reference); - parsertools.create_source_context(_default_operator,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(3)); - return _default_operator; - } - - case (int)RuleConstants.RULE_FACTOR_TKNIL : - // ::= tkNil - - { - nil_const _nil_const=new nil_const(); - parsertools.create_source_context(_nil_const,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _nil_const; - } - - case (int)RuleConstants.RULE_FACTOR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FACTOR2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FACTOR_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= tkSquareOpen tkSquareClose - - { - pascal_set_constant _pascal_set_constant=new pascal_set_constant(LRParser.GetReductionSyntaxNode(1) as expression_list); - parsertools.create_source_context(_pascal_set_constant,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _pascal_set_constant; - } - - case (int)RuleConstants.RULE_FACTOR_TKNOT : - // ::= tkNot - - { - un_expr _un_expr=new un_expr(LRParser.GetReductionSyntaxNode(1) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(0)).type); - parsertools.create_source_context(_un_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _un_expr; - } - - case (int)RuleConstants.RULE_FACTOR3 : - // ::= - - { - un_expr _un_expr=new un_expr(LRParser.GetReductionSyntaxNode(1) as expression,((op_type_node)LRParser.GetReductionSyntaxNode(0)).type); - parsertools.create_source_context(_un_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - return _un_expr; - } - - case (int)RuleConstants.RULE_FACTOR_TKDEREF : - // ::= tkDeref - - { - roof_dereference _roof_dereference=new roof_dereference(); - - _roof_dereference.dereferencing_value=(addressed_value)LRParser.GetReductionSyntaxNode(1); - parsertools.create_source_context(_roof_dereference,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _roof_dereference; - } - - case (int)RuleConstants.RULE_FACTOR4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FACTOR_TKROUNDOPEN_TKROUNDCLOSE_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose tkRoundOpen tkRoundClose -{ function_lambda_definition fld = find_pascalABC_lambda_name(((ident)LRParser.GetReductionSyntaxNode(1)).name); - expression_list _expression_list = (expression_list)LRParser.GetReductionSyntaxNode(4); - function_lambda_definition _lambda_definition = fld; - function_lambda_call _lambda_call = new function_lambda_call(_lambda_definition, _expression_list); - _lambda_call.source_context = ((ident)LRParser.GetReductionSyntaxNode(1)).source_context; - return _lambda_call;} - case (int)RuleConstants.RULE_LITERAL_OR_NUMBER : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LITERAL_OR_NUMBER2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VAR_REFERENCE : - // ::= -((get_address)LRParser.GetReductionSyntaxNode(0)).address_of=(addressed_value)LRParser.GetReductionSyntaxNode(1);parsertools.create_source_context(NodesStack.Peek(),NodesStack.Peek(),LRParser.GetReductionSyntaxNode(1));return NodesStack.Pop(); - case (int)RuleConstants.RULE_VAR_REFERENCE2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VAR_ADDRESS_TKADDRESSOF : - // ::= tkAddressOf - - { - get_address _get_address=new get_address(); - parsertools.assign_source_context(_get_address,LRParser.GetReductionSyntaxNode(0)); NodesStack.Push(_get_address); - return _get_address; - } - - case (int)RuleConstants.RULE_VAR_ADDRESS_TKADDRESSOF2 : - // ::= tkAddressOf - - { - get_address _get_address=new get_address(); - ((get_address)LRParser.GetReductionSyntaxNode(0)).address_of=(addressed_value)_get_address;parsertools.create_source_context(_get_address,LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(1)); - return _get_address; - } - - case (int)RuleConstants.RULE_ATTRIBUTE_VARIABLE : - // ::= - - { - attribute _attribute=new attribute(null,(named_type_reference)LRParser.GetReductionSyntaxNode(0),(expression_list)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_attribute,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - - if (LRParser.GetReductionSyntaxNode(1) == null) - parsertools.create_source_context(_attribute,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - - return _attribute; - } - - case (int)RuleConstants.RULE_VARIABLE : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIABLE2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIABLE_TKINHERITED : - // ::= tkInherited - - { - inherited_ident _inherited_ident=new inherited_ident(); - _inherited_ident.name=((ident)LRParser.GetReductionSyntaxNode(1)).name; parsertools.create_source_context(_inherited_ident,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _inherited_ident; - } - - case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose -if (!build_tree_for_brackets) { parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2));return LRParser.GetReductionSyntaxNode(1);} else - { - expression br_exp = new bracket_expr(LRParser.GetReductionSyntaxNode(1) as expression); - parsertools.create_source_context(br_exp,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return br_exp; - } - - case (int)RuleConstants.RULE_VARIABLE3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIABLE4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIABLE_TKROUNDOPEN_TKROUNDCLOSE2 : - // ::= tkRoundOpen tkRoundClose - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkRoundClose"));}return null; - case (int)RuleConstants.RULE_VARIABLE_TKPOINT : - // ::= tkPoint - - { - dot_node _dot_node=new dot_node((addressed_value)LRParser.GetReductionSyntaxNode(0),(addressed_value)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_dot_node,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _dot_node; - } - - case (int)RuleConstants.RULE_VARIABLE5 : - // ::= - - if (LRParser.GetReductionSyntaxNode(1) is dot_node) - { - ((dot_node)LRParser.GetReductionSyntaxNode(1)).left=(addressed_value)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),((dot_node)LRParser.GetReductionSyntaxNode(1)).right); - } - else - if (LRParser.GetReductionSyntaxNode(1) is template_param_list) - { - ((dot_node)(((template_param_list)LRParser.GetReductionSyntaxNode(1)).dereferencing_value)).left=(addressed_value)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(((template_param_list)LRParser.GetReductionSyntaxNode(1)).dereferencing_value,LRParser.GetReductionSyntaxNode(0),((template_param_list)LRParser.GetReductionSyntaxNode(1)).dereferencing_value); - } - else - if (LRParser.GetReductionSyntaxNode(1) is dereference) - { - ((dereference)LRParser.GetReductionSyntaxNode(1)).dereferencing_value=(addressed_value)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - } - else - if (LRParser.GetReductionSyntaxNode(1) is ident_with_templateparams) - { - ((ident_with_templateparams)LRParser.GetReductionSyntaxNode(1)).name=(addressed_value_funcname)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(LRParser.GetReductionSyntaxNode(1),LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - } - return LRParser.GetReductionSyntaxNode(1); - - case (int)RuleConstants.RULE_OPT_EXPR_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_EXPR_LIST2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_OPT_ATTR_EXPR_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OPT_ATTR_EXPR_LIST2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_ATTRIBUTE_VAR_SPECIFIERS_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose - - { - method_call _method_call=new method_call(LRParser.GetReductionSyntaxNode(1) as expression_list); - parsertools.create_source_context(_method_call,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _method_call; - } - - case (int)RuleConstants.RULE_ATTRIBUTE_VAR_SPECIFIERS_TKPOINT : - // ::= tkPoint - - { - dot_node _dot_node=new dot_node(null,(addressed_value)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_dot_node,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _dot_node; - } - - case (int)RuleConstants.RULE_VAR_SPECIFIERS_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= tkSquareOpen tkSquareClose - - { - indexer _indexer=new indexer((expression_list)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_indexer,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _indexer; - } - - case (int)RuleConstants.RULE_VAR_SPECIFIERS_TKSQUAREOPEN_TKSQUARECLOSE2 : - // ::= tkSquareOpen tkSquareClose - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkSquareOpen tkSquareClose"));}return null; - case (int)RuleConstants.RULE_VAR_SPECIFIERS_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose - - { - method_call _method_call=new method_call(LRParser.GetReductionSyntaxNode(1) as expression_list); - parsertools.create_source_context(_method_call,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _method_call; - } - - case (int)RuleConstants.RULE_VAR_SPECIFIERS_TKPOINT : - // ::= tkPoint - - { - dot_node _dot_node=new dot_node(null,(addressed_value)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_dot_node,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _dot_node; - } - - case (int)RuleConstants.RULE_VAR_SPECIFIERS_TKDEREF : - // ::= tkDeref - - { - roof_dereference _roof_dereference=new roof_dereference(); - parsertools.assign_source_context(_roof_dereference,LRParser.GetReductionSyntaxNode(0)); - return _roof_dereference; - } - - case (int)RuleConstants.RULE_VAR_SPECIFIERS_TKAMPERSEND : - // ::= tkAmpersend - - { - ident_with_templateparams _ident_with_templateparams=new ident_with_templateparams(null,(template_param_list)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_ident_with_templateparams,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _ident_with_templateparams; - } - - case (int)RuleConstants.RULE_TEMPLATE_TYPE_BACK_VARSPECIFIERS_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose - - { - method_call _method_call=new method_call((expression_list)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_method_call,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - return _method_call; - } - - case (int)RuleConstants.RULE_TEMPLATE_TYPE_BACK_VARSPECIFIERS_TKROUNDOPEN_TKROUNDCLOSE2 : - // ::= tkRoundOpen tkRoundClose - - { - method_call _method_call=new method_call(); - parsertools.create_source_context(_method_call,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _method_call; - } - - case (int)RuleConstants.RULE_ELEM_LIST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ELEM_LIST2 : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_ELEM_LIST1 : - // ::= - - //TemplateList for expression_list (create) - { - expression_list _expression_list=new expression_list(); - _expression_list.source_context=((expression)LRParser.GetReductionSyntaxNode(0)).source_context; - _expression_list.expressions.Add((expression)LRParser.GetReductionSyntaxNode(0)); - return _expression_list; - } - - case (int)RuleConstants.RULE_ELEM_LIST1_TKCOMMA : - // ::= tkComma - - //TemplateList for expression_list (add) - { - expression_list _expression_list=(expression_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_expression_list,_expression_list,LRParser.GetReductionSyntaxNode(2)); - _expression_list.expressions.Add(LRParser.GetReductionSyntaxNode(2) as expression); - return _expression_list; - } - - case (int)RuleConstants.RULE_ELEM : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ELEM_TKDOTDOT : - // ::= tkDotDot - - { - diapason_expr _diapason_expr=new diapason_expr((expression)LRParser.GetReductionSyntaxNode(0),(expression)LRParser.GetReductionSyntaxNode(2)); - parsertools.create_source_context(_diapason_expr,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(2)); - - return _diapason_expr; - } - - case (int)RuleConstants.RULE_ONE_LITERAL_TKSTRINGLITERAL : - // ::= tkStringLiteral -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ONE_LITERAL_TKASCIICHAR : - // ::= tkAsciiChar -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_LITERAL : - // ::= - literal_const_line lcl=(literal_const_line)LRParser.GetReductionSyntaxNode(0); - if (lcl.literals.Count==1) return lcl.literals[0]; - return lcl; - - case (int)RuleConstants.RULE_LITERAL_LIST : - // ::= - - { - literal_const_line _literal_const_line=new literal_const_line(); - parsertools.create_source_context(_literal_const_line,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - - _literal_const_line.literals.Add((literal)LRParser.GetReductionSyntaxNode(0)); - - return _literal_const_line; - } - - case (int)RuleConstants.RULE_LITERAL_LIST2 : - // ::= - - { - literal_const_line _literal_const_line=(literal_const_line)LRParser.GetReductionSyntaxNode(0); - _literal_const_line.literals.Add((literal)LRParser.GetReductionSyntaxNode(1)); - parsertools.create_source_context(_literal_const_line,_literal_const_line,LRParser.GetReductionSyntaxNode(1)); - - return _literal_const_line; - } - - case (int)RuleConstants.RULE_OPERATOR_NAME_IDENT_TKOPERATOR : - // ::= tkOperator - - { - operator_name_ident _operator_name_ident=new operator_name_ident(((op_type_node)LRParser.GetReductionSyntaxNode(1)).type); - - _operator_name_ident.name=((op_type_node)LRParser.GetReductionSyntaxNode(1)).text; - parsertools.create_source_context(_operator_name_ident,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(1)); - return _operator_name_ident; - } - - case (int)RuleConstants.RULE_OPT_METH_MODIFICATORS_TKSEMICOLON : - // ::= tkSemiColon - - { - procedure_attributes_list _procedure_attributes_list=new procedure_attributes_list(); - parsertools.AddModifier(_procedure_attributes_list,proc_attribute.attr_overload); parsertools.create_source_context(_procedure_attributes_list,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _procedure_attributes_list; - } - - case (int)RuleConstants.RULE_OPT_METH_MODIFICATORS_TKSEMICOLON_TKSEMICOLON : - // ::= tkSemiColon tkSemiColon - parsertools.AddModifier((procedure_attributes_list)LRParser.GetReductionSyntaxNode(1),proc_attribute.attr_overload); return LRParser.GetReductionSyntaxNode(1); - case (int)RuleConstants.RULE_METH_MODIFICATORS : - // ::= - - //TemplateList for procedure_attributes_list (create) - { - procedure_attributes_list _procedure_attributes_list=new procedure_attributes_list(); - _procedure_attributes_list.source_context=((procedure_attribute)LRParser.GetReductionSyntaxNode(0)).source_context; - _procedure_attributes_list.proc_attributes.Add((procedure_attribute)LRParser.GetReductionSyntaxNode(0)); - return _procedure_attributes_list; - } - - case (int)RuleConstants.RULE_METH_MODIFICATORS_TKSEMICOLON : - // ::= tkSemiColon - - //TemplateList for procedure_attributes_list (add) - { - procedure_attributes_list _procedure_attributes_list=(procedure_attributes_list)LRParser.GetReductionSyntaxNode(0); - parsertools.create_source_context(_procedure_attributes_list,_procedure_attributes_list,LRParser.GetReductionSyntaxNode(2)); - _procedure_attributes_list.proc_attributes.Add(LRParser.GetReductionSyntaxNode(2) as procedure_attribute); - return _procedure_attributes_list; - } - - case (int)RuleConstants.RULE_INTEGER_CONST_TKINTEGER : - // ::= tkInteger - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkInteger"));}return null; - case (int)RuleConstants.RULE_INTEGER_CONST_TKINTEGER2 : - // ::= tkInteger -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_INTEGER_CONST_TKHEX : - // ::= tkHex - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkHex"));}return null; - case (int)RuleConstants.RULE_INTEGER_CONST_TKHEX2 : - // ::= tkHex -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_INTEGER_CONST : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_INTEGER_CONST2 : - // ::= - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= "));}return null; - case (int)RuleConstants.RULE_IDENTIFIER_TKIDENTIFIER : - // ::= tkIdentifier -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IDENTIFIER : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IDENTIFIER2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IDENTIFIER3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IDENTIFIER4 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IDENTIFIER5 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IDENTIFIER6 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IDENTIFIER7 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IDENTIFIER_OR_KEYWORD : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IDENTIFIER_OR_KEYWORD2 : - // ::= - - { - ident _ident=new ident((LRParser.GetReductionSyntaxNode(0) as token_info).text); - parsertools.create_source_context(_ident,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _ident; - } - - case (int)RuleConstants.RULE_IDENTIFIER_OR_KEYWORD3 : - // ::= - - { - ident _ident=new ident((LRParser.GetReductionSyntaxNode(0) as token_info).text); - parsertools.create_source_context(_ident,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _ident; - } - - case (int)RuleConstants.RULE_IDENTIFIER_KEYWORD_OPERATORNAME : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_IDENTIFIER_KEYWORD_OPERATORNAME2 : - // ::= - - { - ident _ident=new ident((LRParser.GetReductionSyntaxNode(0) as token_info).text); - parsertools.create_source_context(_ident,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _ident; - } - - case (int)RuleConstants.RULE_IDENTIFIER_KEYWORD_OPERATORNAME3 : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_REAL_TYPE_NAME_TKREAL : - // ::= tkReal -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_REAL_TYPE_NAME_TKSINGLE : - // ::= tkSingle -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_REAL_TYPE_NAME_TKDOUBLE : - // ::= tkDouble -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_REAL_TYPE_NAME_TKEXTENDED : - // ::= tkExtended -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_REAL_TYPE_NAME_TKCOMP : - // ::= tkComp -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ORD_TYPE_NAME_TKSHORTINT : - // ::= tkShortInt -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ORD_TYPE_NAME_TKSMALLINT : - // ::= tkSmallInt -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ORD_TYPE_NAME_TKORDINTEGER : - // ::= tkOrdInteger -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ORD_TYPE_NAME_TKBYTE : - // ::= tkByte -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ORD_TYPE_NAME_TKLONGINT : - // ::= tkLongInt -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ORD_TYPE_NAME_TKINT64 : - // ::= tkInt64 -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ORD_TYPE_NAME_TKWORD : - // ::= tkWord -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ORD_TYPE_NAME_TKBOOLEAN : - // ::= tkBoolean -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ORD_TYPE_NAME_TKCHAR : - // ::= tkChar -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ORD_TYPE_NAME_TKWIDECHAR : - // ::= tkWideChar -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ORD_TYPE_NAME_TKLONGWORD : - // ::= tkLongWord -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ORD_TYPE_NAME_TKPCHAR : - // ::= tkPChar -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ORD_TYPE_NAME_TKCARDINAL : - // ::= tkCardinal -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIANT_TYPE_NAME_TKVARIANT : - // ::= tkVariant -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VARIANT_TYPE_NAME_TKOLEVARIANT : - // ::= tkOleVariant -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_METH_MODIFICATOR_TKABSTRACT : - // ::= tkAbstract -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_METH_MODIFICATOR_TKOVERLOAD : - // ::= tkOverload -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_METH_MODIFICATOR_TKREINTRODUCE : - // ::= tkReintroduce -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_METH_MODIFICATOR_TKOVERRIDE : - // ::= tkOverride -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_METH_MODIFICATOR_TKVIRTUAL : - // ::= tkVirtual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_METH_MODIFICATOR_TKSTATIC : - // ::= tkStatic -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKREAD : - // ::= tkRead -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKWRITE : - // ::= tkWrite -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKSTORED : - // ::= tkStored -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKNODEFAULT : - // ::= tkNodefault -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKIMPLEMENTS : - // ::= tkImplements -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKWRITEONLY : - // ::= tkWriteOnly -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKREADONLY : - // ::= tkReadOnly -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_PROPERTY_SPECIFIER_DIRECTIVES_TKDISPID : - // ::= tkDispid -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NON_RESERVED_TKAT : - // ::= tkAt -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NON_RESERVED_TKABSOLUTE : - // ::= tkAbsolute -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NON_RESERVED_TKON : - // ::= tkOn -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NON_RESERVED_TKNAME : - // ::= tkName -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NON_RESERVED_TKINDEX : - // ::= tkIndex -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NON_RESERVED_TKMESSAGE : - // ::= tkMessage -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NON_RESERVED_TKCONTAINS : - // ::= tkContains -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NON_RESERVED_TKREQUIRES : - // ::= tkRequires -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NON_RESERVED_TKFORWARD : - // ::= tkForward -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_NON_RESERVED_TKOUT : - // ::= tkOut -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VISIBILITY_SPECIFIER_TKINTERNAL : - // ::= tkInternal -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VISIBILITY_SPECIFIER_TKPUBLIC : - // ::= tkPublic -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VISIBILITY_SPECIFIER_TKPROTECTED : - // ::= tkProtected -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VISIBILITY_SPECIFIER_TKPRIVATE : - // ::= tkPrivate -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OTHER_TKPACKAGE : - // ::= tkPackage -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OTHER_TKUNIT : - // ::= tkUnit -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OTHER_TKLIBRARY : - // ::= tkLibrary -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OTHER_TKEXTERNAL : - // ::= tkExternal -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OTHER_TKPARAMS : - // ::= tkParams -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD : - // ::= - - { - token_info _token_info=new token_info((LRParser.GetReductionSyntaxNode(0) as ident).name); - parsertools.create_source_context(_token_info,LRParser.GetReductionSyntaxNode(0),LRParser.GetReductionSyntaxNode(0)); - return _token_info; - } - - case (int)RuleConstants.RULE_KEYWORD_TKFINAL : - // ::= tkFinal -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKTEMPLATE : - // ::= tkTemplate -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKOR : - // ::= tkOr -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKTYPEOF : - // ::= tkTypeOf -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKSIZEOF : - // ::= tkSizeOf -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKDEFAULT : - // ::= tkDefault -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKWHERE : - // ::= tkWhere -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKXOR : - // ::= tkXor -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKAND : - // ::= tkAnd -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKDIV : - // ::= tkDiv -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKMOD : - // ::= tkMod -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKSHL : - // ::= tkShl -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKSHR : - // ::= tkShr -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKNOT : - // ::= tkNot -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKAS : - // ::= tkAs -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKIN : - // ::= tkIn -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKIS : - // ::= tkIs -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKARRAY : - // ::= tkArray -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKBEGIN : - // ::= tkBegin -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKCASE : - // ::= tkCase -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKCLASS : - // ::= tkClass -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKCONST : - // ::= tkConst -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKCONSTRUCTOR : - // ::= tkConstructor -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKDESTRUCTOR : - // ::= tkDestructor -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKDOWNTO : - // ::= tkDownto -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKDO : - // ::= tkDo -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKELSE : - // ::= tkElse -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKEXCEPT : - // ::= tkExcept -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKFILE : - // ::= tkFile -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKFINALIZATION : - // ::= tkFinalization -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKFINALLY : - // ::= tkFinally -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKFOR : - // ::= tkFor -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKFOREACH : - // ::= tkForeach -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKFUNCTION : - // ::= tkFunction -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKIF : - // ::= tkIf -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKIMPLEMENTATION : - // ::= tkImplementation -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKINHERITED : - // ::= tkInherited -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKINITIALIZATION : - // ::= tkInitialization -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKINTERFACE : - // ::= tkInterface -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKPROCEDURE : - // ::= tkProcedure -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKPROPERTY : - // ::= tkProperty -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKRAISE : - // ::= tkRaise -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKRECORD : - // ::= tkRecord -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKREPEAT : - // ::= tkRepeat -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKSET : - // ::= tkSet -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKTRY : - // ::= tkTry -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKTYPE : - // ::= tkType -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKTHEN : - // ::= tkThen -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKTO : - // ::= tkTo -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKUNTIL : - // ::= tkUntil -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKUSES : - // ::= tkUses -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKUSING : - // ::= tkUsing -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKVAR : - // ::= tkVar -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKWHILE : - // ::= tkWhile -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKWITH : - // ::= tkWith -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKNIL : - // ::= tkNil -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKGOTO : - // ::= tkGoto -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKOF : - // ::= tkOf -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKLABEL : - // ::= tkLabel -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_KEYWORD_TKPROGRAM : - // ::= tkProgram -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RESERVED_KEYWORD_TKOPERATOR : - // ::= tkOperator -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_RESERVED_KEYWORD_TKEND : - // ::= tkEnd -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKMINUS : - // ::= tkMinus -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKPLUS : - // ::= tkPlus -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKSQUAREOPEN_TKSQUARECLOSE : - // ::= tkSquareOpen tkSquareClose - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkSquareOpen tkSquareClose"));}return null; - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKROUNDOPEN_TKROUNDCLOSE : - // ::= tkRoundOpen tkRoundClose - {errors.Add(new nonterminal_token_return_null(current_file_name,parsertools.GetTokenSourceContext(),(syntax_tree_node)prev_node," ::= tkRoundOpen tkRoundClose"));}return null; - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKSLASH : - // ::= tkSlash -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKSTAR : - // ::= tkStar -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKEQUAL : - // ::= tkEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKGREATER : - // ::= tkGreater -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKGREATEREQUAL : - // ::= tkGreaterEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKLOWER : - // ::= tkLower -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKLOWEREQUAL : - // ::= tkLowerEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKNOTEQUAL : - // ::= tkNotEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKOR : - // ::= tkOr -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKXOR : - // ::= tkXor -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKAND : - // ::= tkAnd -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKDIV : - // ::= tkDiv -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKMOD : - // ::= tkMod -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKSHL : - // ::= tkShl -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKSHR : - // ::= tkShr -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKNOT : - // ::= tkNot -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKIN : - // ::= tkIn -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKADDRESSOF : - // ::= tkAddressOf -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKDEREF : - // ::= tkDeref -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKIMPLICIT : - // ::= tkImplicit -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR_TKEXPLICIT : - // ::= tkExplicit -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_OVERLOAD_OPERATOR : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ASSIGN_OPERATOR_TKASSIGN : - // ::= tkAssign -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ASSIGN_OPERATOR_TKPLUSEQUAL : - // ::= tkPlusEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ASSIGN_OPERATOR_TKMINUSEQUAL : - // ::= tkMinusEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ASSIGN_OPERATOR_TKMULTEQUAL : - // ::= tkMultEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_ASSIGN_OPERATOR_TKDIVEQUAL : - // ::= tkDivEqual -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_EMPTY : - // ::= - //NONTERMINAL: ::= - return null; - //ENDNONTERMINAL - case (int)RuleConstants.RULE_ERROR_TKERROR : - // ::= tkError -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_FUNC_DECL_LAMBDA_TKARROW : - // ::= tkArrow -{return func_decl_lambda(LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2));} - case (int)RuleConstants.RULE_FUNC_DECL_LAMBDA_TKARROW2 : - // ::= tkArrow -{return func_decl_lambda(null, LRParser.GetReductionSyntaxNode(1));} - case (int)RuleConstants.RULE_FUNC_DECL_LAMBDA_TKROUNDOPEN_TKROUNDCLOSE_TKARROW : - // ::= tkRoundOpen tkRoundClose tkArrow -{return func_decl_lambda(null, LRParser.GetReductionSyntaxNode(3));} - case (int)RuleConstants.RULE_IDENT_LIST1_TKROUNDOPEN_TKCOMMA_TKROUNDCLOSE : - // ::= tkRoundOpen tkComma tkRoundClose -{return ident_list11(LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(3));} - case (int)RuleConstants.RULE_IDENT_LIST1 : - // ::= -{return ident_list12(LRParser.GetReductionSyntaxNode(0));} - case (int)RuleConstants.RULE_IDENT_LIST1_TKROUNDOPEN_TKCOLON_TKCOMMA_TKROUNDCLOSE : - // ::= tkRoundOpen tkColon tkComma tkRoundClose -{return ident_list13(LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(3), LRParser.GetReductionSyntaxNode(5));} - case (int)RuleConstants.RULE_IDENT_LIST1_TKROUNDOPEN_TKCOLON_TKROUNDCLOSE : - // ::= tkRoundOpen tkColon tkRoundClose -{return ident_list14(LRParser.GetReductionSyntaxNode(1), LRParser.GetReductionSyntaxNode(3));} - case (int)RuleConstants.RULE_IDENT_LIST2_TKCOMMA : - // ::= tkComma -{return ident_list21(LRParser.GetReductionSyntaxNode(0), LRParser.GetReductionSyntaxNode(2));} - case (int)RuleConstants.RULE_IDENT_LIST2 : - // ::= -{return ident_list12(LRParser.GetReductionSyntaxNode(0));} - case (int)RuleConstants.RULE_VAR_OR_IDENTIFIER : - // ::= -return LRParser.GetReductionSyntaxNode(0); - case (int)RuleConstants.RULE_VAR_OR_IDENTIFIER_TKCOLON : - // ::= tkColon -{ - named_type_reference n_t_r = (named_type_reference)LRParser.GetReductionSyntaxNode(2); - var_def_statement vds = new var_def_statement(); - vds.vars = new ident_list(); - vds.vars.idents.Add((ident)LRParser.GetReductionSyntaxNode(0)); - vds.vars_type = n_t_r; - return vds; - } - case (int)RuleConstants.RULE_LAMBDA_BODY : - // ::= -{ -statement_list _statement_list = new statement_list(); - ident id = new ident("result"); - op_type_node _op_type_node = new op_type_node(Operators.Assignment); - _op_type_node.source_context = parsertools.GetTokenSourceContext(); - assign _assign = new assign((addressed_value)id, LRParser.GetReductionSyntaxNode(0) as expression, _op_type_node.type); - parsertools.create_source_context(_assign, id, LRParser.GetReductionSyntaxNode(0)); - _statement_list.subnodes.Add((statement)_assign); - parsertools.assign_source_context(_statement_list, _assign); - parsertools.create_source_context(_statement_list, null, null); - //block _block = new block(null, _statement_list); - return _statement_list; -} - - case (int)RuleConstants.RULE_LAMBDA_BODY2 : - // ::= -return LRParser.GetReductionSyntaxNode(0); -} -throw new RuleException("Unknown rule"); -} - - - - - -} -} diff --git a/ReleaseGenerators/License.txt b/ReleaseGenerators/License.txt index 0e6f1e4e9..f8b4b6ee1 100644 --- a/ReleaseGenerators/License.txt +++ b/ReleaseGenerators/License.txt @@ -3,7 +3,7 @@ В�Ж�ЕЙШИЕ УСЛОВИЯ Р�СПРОСТР��Е�ИЯ ПРОДУКТ� PascalABC.NET -Copyright (C) 2005-2015 by Ivan Bondarev, Stanislav Mihalkovich +Copyright (C) 2005-2016 by Ivan Bondarev, Stanislav Mihalkovich Это программное обе�печение �вл�ет�� �вободным; вы можете ра�про�тран�ть и/или модифицировать его на у�лови�х GNU LGPL вер�ии 3 � разъ��нени�ми и и�ключени�ми, данными ниже. diff --git a/ReleaseGenerators/License_en.txt b/ReleaseGenerators/License_en.txt index 14712ba6b..d64ab94a7 100644 --- a/ReleaseGenerators/License_en.txt +++ b/ReleaseGenerators/License_en.txt @@ -3,7 +3,7 @@ A copy of the GNU GPL is appended to this file. IMPORTANT PascalABC.NET LICENSE TERMS -Copyright (C) 2005-2015 by Ivan Bondarev, Stanislav Mihalkovich +Copyright (C) 2005-2016 by Ivan Bondarev, Stanislav Mihalkovich This program is free software; you may redistribute and/or modify it under the terms of the GNU LGPL version 3 with the clarifications and exceptions described below. PascalABC.NET can be linked with non-free modules and libraries. This condition is mainly concerned with possibility of adding foreign modules and libraries to PascalABC.NET, aimed at education. In particular, PascalABC.NET includes as a part PROGRAMMING TASKBOOK FOR PASCALABC.NET (in agreement with the author of this product), which is distributed under the terms of proprietary license (see \bin\PT4) diff --git a/ReleaseGenerators/copyright.txt b/ReleaseGenerators/copyright.txt index 2e31eb551..50e7cd2d8 100644 --- a/ReleaseGenerators/copyright.txt +++ b/ReleaseGenerators/copyright.txt @@ -1 +1 @@ -Copyright (C) 2005-2015 by Ivan Bondarev, Stanislav Mihalkovich \ No newline at end of file +Copyright (C) 2005-2016 by Ivan Bondarev, Stanislav Mihalkovich \ No newline at end of file diff --git a/doc/License_en.txt b/doc/License_en.txt index 199150c82..59715cc53 100644 --- a/doc/License_en.txt +++ b/doc/License_en.txt @@ -3,7 +3,7 @@ A copy of the GNU GPL is appended to this file. IMPORTANT PascalABC.NET LICENSE TERMS -Copyright (C) 2005-2015 by Ivan Bondarev, Stanislav Mihalkovich +Copyright (C) 2005-2016 by Ivan Bondarev, Stanislav Mihalkovich This program is free software; you may redistribute and/or modify it under the terms of the GNU LGPL version 3 with the clarifications and exceptions described below. PascalABC.NET can be linked with non-free modules and libraries. This condition is mainly concerned with possibility of adding foreign modules and libraries to PascalABC.NET, aimed at education. In particular, PascalABC.NET includes as a part PROGRAMMING TASKBOOK FOR PASCALABC.NET (in agreement with the author of this product), which is distributed under the terms of proprietary license (see \bin\PT4) diff --git a/doc/copyright.txt b/doc/copyright.txt index 2e31eb551..50e7cd2d8 100644 --- a/doc/copyright.txt +++ b/doc/copyright.txt @@ -1 +1 @@ -Copyright (C) 2005-2015 by Ivan Bondarev, Stanislav Mihalkovich \ No newline at end of file +Copyright (C) 2005-2016 by Ivan Bondarev, Stanislav Mihalkovich \ No newline at end of file diff --git a/doc/license.txt b/doc/license.txt index 5b02558dd..e6d8c521e 100644 --- a/doc/license.txt +++ b/doc/license.txt @@ -3,7 +3,7 @@ В�Ж�ЕЙШИЕ УСЛОВИЯ Р�СПРОСТР��Е�ИЯ ПРОДУКТ� PascalABC.NET -Copyright (C) 2005-2015 by Ivan Bondarev, Stanislav Mihalkovich +Copyright (C) 2005-2016 by Ivan Bondarev, Stanislav Mihalkovich Это программное обе�печение �вл�ет�� �вободным; вы можете ра�про�тран�ть и/или модифицировать его на у�лови�х GNU LGPL вер�ии 3 � разъ��нени�ми и и�ключени�ми, данными ниже.