diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index c0efe1db7..76c86bf2d 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -2,7 +2,7 @@ // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 // Machine: SSM -// DateTime: 03.04.2016 22:20:08 +// DateTime: 04.04.2016 21:37:32 // UserName: ????????? // GPLEX input file // GPLEX frame file diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y index 50e28a3c4..7ea8d34a1 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y @@ -1922,19 +1922,19 @@ proc_func_decl_noclass { $$ = new procedure_definition($1 as procedure_header, $2 as proc_block, @$); } - | tkFunction func_name fp_list tkColon fptype tkAssign relop_expr tkSemiColon + | tkFunction func_name fp_list tkColon fptype optional_method_modificators1 tkAssign relop_expr tkSemiColon { - $$ = SyntaxTreeBuilder.BuildShortFuncDefinition($3 as formal_parameters, new procedure_attributes_list(), $2 as method_name, $5 as type_definition, $7, @1.Merge(@5)); + $$ = SyntaxTreeBuilder.BuildShortFuncDefinition($3 as formal_parameters, $6 as procedure_attributes_list, $2 as method_name, $5 as type_definition, $8, @1.Merge(@5)); } - | tkFunction func_name fp_list tkAssign relop_expr tkSemiColon + | tkFunction func_name fp_list optional_method_modificators1 tkAssign relop_expr tkSemiColon { - $$ = SyntaxTreeBuilder.BuildShortFuncDefinition($3 as formal_parameters, new procedure_attributes_list(), $2 as method_name, null, $5, @1.Merge(@3)); + $$ = SyntaxTreeBuilder.BuildShortFuncDefinition($3 as formal_parameters, $4 as procedure_attributes_list, $2 as method_name, null, $6, @1.Merge(@3)); } - | tkProcedure proc_name fp_list tkAssign unlabelled_stmt tkSemiColon + | tkProcedure proc_name fp_list optional_method_modificators1 tkAssign unlabelled_stmt tkSemiColon { - if ($5 is empty_statement) + if ($6 is empty_statement) parsertools.AddErrorFromResource("EMPTY_STATEMENT_IN_SHORT_PROC_DEFINITION",@6); - $$ = SyntaxTreeBuilder.BuildShortProcDefinition($3 as formal_parameters, new procedure_attributes_list(), $2 as method_name, $5 as statement, @1.Merge(@3)); + $$ = SyntaxTreeBuilder.BuildShortProcDefinition($3 as formal_parameters, $4 as procedure_attributes_list, $2 as method_name, $6 as statement, @1.Merge(@3)); } | proc_func_header tkForward tkSemiColon { diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index 1af731b3a..f3ac221db 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -2,9 +2,9 @@ // GPPG version 1.3.6 // Machine: SSM -// DateTime: 03.04.2016 22:20:09 +// DateTime: 04.04.2016 21:37:33 // UserName: ????????? -// Input file +// Input file // options: no-lines gplex @@ -56,7 +56,7 @@ public abstract class ScanBase : AbstractScanner { - // Verbatim content from ABCPascal.y + // Verbatim content from D:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y // ��� ���������� ����������� � ����� GPPGParser, �������������� ����� ������, ������������ �������� gppg public syntax_tree_node root; // �������� ���� ��������������� ������ @@ -68,13 +68,13 @@ public partial class GPPGParser: ShiftReduceParser scanner) : base(scanner) { } - // End verbatim content from ABCPascal.y + // End verbatim content from D:\PascalABC.NET\!PABC_Git\Parsers\PascalABCParserNewSaushkin\ABCPascal.y #pragma warning disable 649 private static Dictionary aliasses; #pragma warning restore 649 private static Rule[] rules = new Rule[794]; - private static State[] states = new State[1262]; + private static State[] states = new State[1265]; private static string[] nonTerms = new string[] { "parse_goal", "unit_key_word", "assignment", "optional_array_initializer", "attribute_declarations", "ot_visibility_specifier", "one_attribute", "attribute_variable", @@ -150,11 +150,11 @@ public partial class GPPGParser: ShiftReduceParser tkFunction, func_name, fp_list, tkColon, fptype, - // tkAssign, relop_expr, tkSemiColon -{ - CurrentSemanticValue.stn = SyntaxTreeBuilder.BuildShortFuncDefinition(ValueStack[ValueStack.Depth-6].stn as formal_parameters, new procedure_attributes_list(), ValueStack[ValueStack.Depth-7].stn as method_name, ValueStack[ValueStack.Depth-4].td as type_definition, ValueStack[ValueStack.Depth-2].ex, LocationStack[LocationStack.Depth-8].Merge(LocationStack[LocationStack.Depth-4])); - } - break; - case 386: // proc_func_decl_noclass -> tkFunction, func_name, fp_list, tkAssign, relop_expr, + // optional_method_modificators1, tkAssign, relop_expr, // tkSemiColon { - CurrentSemanticValue.stn = SyntaxTreeBuilder.BuildShortFuncDefinition(ValueStack[ValueStack.Depth-4].stn as formal_parameters, new procedure_attributes_list(), ValueStack[ValueStack.Depth-5].stn as method_name, null, ValueStack[ValueStack.Depth-2].ex, LocationStack[LocationStack.Depth-6].Merge(LocationStack[LocationStack.Depth-4])); + CurrentSemanticValue.stn = SyntaxTreeBuilder.BuildShortFuncDefinition(ValueStack[ValueStack.Depth-7].stn as formal_parameters, ValueStack[ValueStack.Depth-4].stn as procedure_attributes_list, ValueStack[ValueStack.Depth-8].stn as method_name, ValueStack[ValueStack.Depth-5].td as type_definition, ValueStack[ValueStack.Depth-2].ex, LocationStack[LocationStack.Depth-9].Merge(LocationStack[LocationStack.Depth-5])); } break; - case 387: // proc_func_decl_noclass -> tkProcedure, proc_name, fp_list, tkAssign, + case 386: // proc_func_decl_noclass -> tkFunction, func_name, fp_list, + // optional_method_modificators1, tkAssign, relop_expr, + // tkSemiColon +{ + CurrentSemanticValue.stn = SyntaxTreeBuilder.BuildShortFuncDefinition(ValueStack[ValueStack.Depth-5].stn as formal_parameters, ValueStack[ValueStack.Depth-4].stn as procedure_attributes_list, ValueStack[ValueStack.Depth-6].stn as method_name, null, ValueStack[ValueStack.Depth-2].ex, LocationStack[LocationStack.Depth-7].Merge(LocationStack[LocationStack.Depth-5])); + } + break; + case 387: // proc_func_decl_noclass -> tkProcedure, proc_name, fp_list, + // optional_method_modificators1, tkAssign, // unlabelled_stmt, tkSemiColon { if (ValueStack[ValueStack.Depth-2].stn is empty_statement) - parsertools.AddErrorFromResource("EMPTY_STATEMENT_IN_SHORT_PROC_DEFINITION",LocationStack[LocationStack.Depth-1]); - CurrentSemanticValue.stn = SyntaxTreeBuilder.BuildShortProcDefinition(ValueStack[ValueStack.Depth-4].stn as formal_parameters, new procedure_attributes_list(), ValueStack[ValueStack.Depth-5].stn as method_name, ValueStack[ValueStack.Depth-2].stn as statement, LocationStack[LocationStack.Depth-6].Merge(LocationStack[LocationStack.Depth-4])); + parsertools.AddErrorFromResource("EMPTY_STATEMENT_IN_SHORT_PROC_DEFINITION",LocationStack[LocationStack.Depth-2]); + CurrentSemanticValue.stn = SyntaxTreeBuilder.BuildShortProcDefinition(ValueStack[ValueStack.Depth-5].stn as formal_parameters, ValueStack[ValueStack.Depth-4].stn as procedure_attributes_list, ValueStack[ValueStack.Depth-6].stn as method_name, ValueStack[ValueStack.Depth-2].stn as statement, LocationStack[LocationStack.Depth-7].Merge(LocationStack[LocationStack.Depth-5])); } break; case 388: // proc_func_decl_noclass -> proc_func_header, tkForward, tkSemiColon diff --git a/Parsers/PascalABCParserNewSaushkin/PABC.ymc b/Parsers/PascalABCParserNewSaushkin/PABC.ymc index 280f50291..74929954c 100644 --- a/Parsers/PascalABCParserNewSaushkin/PABC.ymc +++ b/Parsers/PascalABCParserNewSaushkin/PABC.ymc @@ -126,5 +126,6 @@ script= +