From c3bb2ed95376005fa9445c8f0334cc5ed9a7c671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D0=BD=D0=B4=D0=B0=D1=80=D0=B5=D0=B2=20=D0=98?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD?= Date: Sun, 15 Oct 2017 15:08:57 +0200 Subject: [PATCH] bug fix #524 --- .../ParserTools/LanguageInformation.cs | 12 + .../PascalABCParserNewSaushkin/ABCPascal.cs | 6 +- .../PascalABCParserNewSaushkin/ABCPascal.y | 6 +- .../ABCPascalYacc.cs | 3074 ++++++++--------- TestSuite/new1.pas | 10 + 5 files changed, 1566 insertions(+), 1542 deletions(-) create mode 100644 TestSuite/new1.pas diff --git a/ParserTools/ParserTools/LanguageInformation.cs b/ParserTools/ParserTools/LanguageInformation.cs index 0aaaf8609..ff9a00d0e 100644 --- a/ParserTools/ParserTools/LanguageInformation.cs +++ b/ParserTools/ParserTools/LanguageInformation.cs @@ -358,6 +358,18 @@ namespace PascalABCCompiler.Parsers this.description = description; } + public SymInfo(SymInfo si) + { + this.name = si.name; + this.addit_name = si.addit_name; + this.description = si.description; + this.kind = si.kind; + this.IsUnitNamespace = si.IsUnitNamespace; + this.acc_mod = si.acc_mod; + this.has_doc = si.has_doc; + this.not_include = si.not_include; + } + public string Name { get diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index 368b227ca..eb1a8184a 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -1,9 +1,9 @@ // // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 -// Machine: DESKTOP-A6LT9RI -// DateTime: 29.09.2017 13:47:41 -// UserName: ????????? +// Machine: IVAN-PC +// DateTime: 15.10.2017 14:45:01 +// UserName: Ivan // GPLEX input file // GPLEX frame file // diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y index 0ae8b5eb2..bb103acd2 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y @@ -817,6 +817,8 @@ const_factor { $$ = new un_expr($2, $1.type, @$); } + | new_expr + { $$ = $1; } | tkDeref const_factor { $$ = new roof_dereference($2 as addressed_value, @$); @@ -1933,8 +1935,8 @@ typed_var_init_expression typed_const_plus : typed_const { $$ = $1; } - | new_expr - { $$ = $1; } + /*| new_expr + { $$ = $1; }*/ | default_expr { $$ = $1; } ; diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index cd5ddd5b8..d49cfe73a 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -1,9 +1,9 @@ // (see accompanying GPPGcopyright.rtf) // GPPG version 1.3.6 -// Machine: DESKTOP-A6LT9RI -// DateTime: 29.09.2017 13:47:41 -// UserName: ????????? +// Machine: IVAN-PC +// DateTime: 15.10.2017 14:45:03 +// UserName: Ivan // Input file // options: no-lines gplex @@ -153,7 +153,7 @@ public partial class GPPGParser: ShiftReduceParser tkDeref, const_factor + case 148: // const_factor -> new_expr +{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } + break; + case 149: // const_factor -> tkDeref, const_factor { CurrentSemanticValue.ex = new roof_dereference(ValueStack[ValueStack.Depth-1].ex as addressed_value, CurrentLocationSpan); } break; - case 149: // const_set -> tkSquareOpen, const_elem_list, tkSquareClose + case 150: // const_set -> tkSquareOpen, const_elem_list, tkSquareClose { CurrentSemanticValue.ex = new pascal_set_constant(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 150: // sign -> tkPlus + case 151: // sign -> tkPlus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 151: // sign -> tkMinus + case 152: // sign -> tkMinus { CurrentSemanticValue.op = ValueStack[ValueStack.Depth-1].op; } break; - case 152: // const_variable -> identifier + case 153: // const_variable -> identifier { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].id; } break; - case 153: // const_variable -> sizeof_expr + case 154: // const_variable -> sizeof_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 154: // const_variable -> typeof_expr + case 155: // const_variable -> typeof_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 155: // const_variable -> const_variable, const_variable_2 + case 156: // const_variable -> const_variable, const_variable_2 { CurrentSemanticValue.ex = NewConstVariable(ValueStack[ValueStack.Depth-2].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 156: // const_variable_2 -> tkPoint, identifier_or_keyword + case 157: // const_variable_2 -> tkPoint, identifier_or_keyword { CurrentSemanticValue.ex = new dot_node(null, ValueStack[ValueStack.Depth-1].id as addressed_value, CurrentLocationSpan); } break; - case 157: // const_variable_2 -> tkDeref + case 158: // const_variable_2 -> tkDeref { CurrentSemanticValue.ex = new roof_dereference(); CurrentSemanticValue.ex.source_context = CurrentLocationSpan; } break; - case 158: // const_variable_2 -> tkRoundOpen, optional_const_func_expr_list, tkRoundClose + case 159: // const_variable_2 -> tkRoundOpen, optional_const_func_expr_list, tkRoundClose { CurrentSemanticValue.ex = new method_call(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 159: // const_variable_2 -> tkSquareOpen, const_elem_list, tkSquareClose + case 160: // const_variable_2 -> tkSquareOpen, const_elem_list, tkSquareClose { CurrentSemanticValue.ex = new indexer(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 160: // optional_const_func_expr_list -> const_func_expr_list + case 161: // optional_const_func_expr_list -> const_func_expr_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 161: // optional_const_func_expr_list -> /* empty */ + case 162: // optional_const_func_expr_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 162: // const_func_expr_list -> const_expr + case 163: // const_func_expr_list -> const_expr { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 163: // const_func_expr_list -> const_func_expr_list, tkComma, const_expr + case 164: // const_func_expr_list -> const_func_expr_list, tkComma, const_expr { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 164: // const_elem_list -> const_elem_list1 + case 165: // const_elem_list -> const_elem_list1 { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 166: // const_elem_list1 -> const_elem + case 167: // const_elem_list1 -> const_elem { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 167: // const_elem_list1 -> const_elem_list1, tkComma, const_elem + case 168: // const_elem_list1 -> const_elem_list1, tkComma, const_elem { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 168: // const_elem -> const_expr + case 169: // const_elem -> const_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 169: // const_elem -> const_expr, tkDotDot, const_expr + case 170: // const_elem -> const_expr, tkDotDot, const_expr { CurrentSemanticValue.ex = new diapason_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 170: // unsigned_number -> tkInteger + case 171: // unsigned_number -> tkInteger { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 171: // unsigned_number -> tkHex + case 172: // unsigned_number -> tkHex { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 172: // unsigned_number -> tkFloat + case 173: // unsigned_number -> tkFloat { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 173: // typed_const -> const_expr + case 174: // typed_const -> const_expr { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 174: // typed_const -> array_const + case 175: // typed_const -> array_const { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 175: // typed_const -> record_const + case 176: // typed_const -> record_const { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 176: // array_const -> tkRoundOpen, typed_const_list, tkRoundClose + case 177: // array_const -> tkRoundOpen, typed_const_list, tkRoundClose { CurrentSemanticValue.ex = new array_const(ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 177: // array_const -> tkRoundOpen, record_const, tkRoundClose + case 178: // array_const -> tkRoundOpen, record_const, tkRoundClose { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-2].ex; } break; - case 178: // array_const -> tkRoundOpen, array_const, tkRoundClose + case 179: // array_const -> tkRoundOpen, array_const, tkRoundClose { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-2].ex; } break; - case 180: // typed_const_list -> typed_const_list1 + case 181: // typed_const_list -> typed_const_list1 { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 181: // typed_const_list1 -> typed_const_plus + case 182: // typed_const_list1 -> typed_const_plus { CurrentSemanticValue.stn = new expression_list(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 182: // typed_const_list1 -> typed_const_list1, tkComma, typed_const_plus + case 183: // typed_const_list1 -> typed_const_list1, tkComma, typed_const_plus { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as expression_list).Add(ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 183: // record_const -> tkRoundOpen, const_field_list, tkRoundClose + case 184: // record_const -> tkRoundOpen, const_field_list, tkRoundClose { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-2].ex; CurrentSemanticValue.ex.source_context = CurrentLocationSpan; } break; - case 184: // const_field_list -> const_field_list_1 + case 185: // const_field_list -> const_field_list_1 { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 185: // const_field_list -> const_field_list_1, tkSemiColon + case 186: // const_field_list -> const_field_list_1, tkSemiColon { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-2].ex; } break; - case 186: // const_field_list_1 -> const_field + case 187: // const_field_list_1 -> const_field { CurrentSemanticValue.ex = new record_const(ValueStack[ValueStack.Depth-1].stn as record_const_definition, CurrentLocationSpan); } break; - case 187: // const_field_list_1 -> const_field_list_1, tkSemiColon, const_field + case 188: // const_field_list_1 -> const_field_list_1, tkSemiColon, const_field { CurrentSemanticValue.ex = (ValueStack[ValueStack.Depth-3].ex as record_const).Add(ValueStack[ValueStack.Depth-1].stn as record_const_definition, CurrentLocationSpan); } break; - case 188: // const_field -> const_field_name, tkColon, typed_const + case 189: // const_field -> const_field_name, tkColon, typed_const { CurrentSemanticValue.stn = new record_const_definition(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 189: // const_field_name -> identifier + case 190: // const_field_name -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 190: // type_decl -> attribute_declarations, simple_type_decl + case 191: // type_decl -> attribute_declarations, simple_type_decl { (ValueStack[ValueStack.Depth-1].stn as declaration).attributes = ValueStack[ValueStack.Depth-2].stn as attribute_list; CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; CurrentSemanticValue.stn.source_context = LocationStack[LocationStack.Depth-1]; } break; - case 191: // attribute_declarations -> attribute_declaration + case 192: // attribute_declarations -> attribute_declaration { CurrentSemanticValue.stn = new attribute_list(ValueStack[ValueStack.Depth-1].stn as simple_attribute_list, CurrentLocationSpan); } break; - case 192: // attribute_declarations -> attribute_declarations, attribute_declaration + case 193: // attribute_declarations -> attribute_declarations, attribute_declaration { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-2].stn as attribute_list).Add(ValueStack[ValueStack.Depth-1].stn as simple_attribute_list, CurrentLocationSpan); } break; - case 193: // attribute_declarations -> /* empty */ + case 194: // attribute_declarations -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 194: // attribute_declaration -> tkSquareOpen, one_or_some_attribute, tkSquareClose + case 195: // attribute_declaration -> tkSquareOpen, one_or_some_attribute, tkSquareClose { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } break; - case 195: // one_or_some_attribute -> one_attribute + case 196: // one_or_some_attribute -> one_attribute { CurrentSemanticValue.stn = new simple_attribute_list(ValueStack[ValueStack.Depth-1].stn as attribute, CurrentLocationSpan); } break; - case 196: // one_or_some_attribute -> one_or_some_attribute, tkComma, one_attribute + case 197: // one_or_some_attribute -> one_or_some_attribute, tkComma, one_attribute { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as simple_attribute_list).Add(ValueStack[ValueStack.Depth-1].stn as attribute, CurrentLocationSpan); } break; - case 197: // one_attribute -> attribute_variable + case 198: // one_attribute -> attribute_variable { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 198: // one_attribute -> identifier, tkColon, attribute_variable + case 199: // one_attribute -> identifier, tkColon, attribute_variable { (ValueStack[ValueStack.Depth-1].stn as attribute).qualifier = ValueStack[ValueStack.Depth-3].id; CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 199: // simple_type_decl -> type_decl_identifier, tkEqual, type_decl_type, tkSemiColon + case 200: // simple_type_decl -> type_decl_identifier, tkEqual, type_decl_type, tkSemiColon { CurrentSemanticValue.stn = new type_declaration(ValueStack[ValueStack.Depth-4].id, ValueStack[ValueStack.Depth-2].td, CurrentLocationSpan); } break; - case 200: // simple_type_decl -> template_identifier_with_equal, type_decl_type, tkSemiColon + case 201: // simple_type_decl -> template_identifier_with_equal, type_decl_type, tkSemiColon { CurrentSemanticValue.stn = new type_declaration(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-2].td, CurrentLocationSpan); } break; - case 201: // type_decl_identifier -> identifier + case 202: // type_decl_identifier -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 202: // type_decl_identifier -> identifier, template_arguments + case 203: // type_decl_identifier -> identifier, template_arguments { CurrentSemanticValue.id = new template_type_name(ValueStack[ValueStack.Depth-2].id.name, ValueStack[ValueStack.Depth-1].stn as ident_list, CurrentLocationSpan); } break; - case 203: // template_identifier_with_equal -> identifier, tkLower, ident_list, + case 204: // template_identifier_with_equal -> identifier, tkLower, ident_list, // tkGreaterEqual { CurrentSemanticValue.id = new template_type_name(ValueStack[ValueStack.Depth-4].id.name, ValueStack[ValueStack.Depth-2].stn as ident_list, CurrentLocationSpan); } break; - case 204: // type_decl_type -> type_ref + case 205: // type_decl_type -> type_ref { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 205: // type_decl_type -> object_type + case 206: // type_decl_type -> object_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 206: // type_ref -> simple_type + case 207: // type_ref -> simple_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 207: // type_ref -> simple_type, tkQuestion + case 208: // type_ref -> simple_type, tkQuestion { var l = new List(); l.Add(new ident("System")); @@ -3197,46 +3200,46 @@ public partial class GPPGParser: ShiftReduceParser string_type + case 209: // type_ref -> string_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 209: // type_ref -> pointer_type + case 210: // type_ref -> pointer_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 210: // type_ref -> structured_type + case 211: // type_ref -> structured_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 211: // type_ref -> procedural_type + case 212: // type_ref -> procedural_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 212: // type_ref -> template_type + case 213: // type_ref -> template_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 213: // template_type -> simple_type_identifier, template_type_params + case 214: // template_type -> simple_type_identifier, template_type_params { CurrentSemanticValue.td = new template_type_reference(ValueStack[ValueStack.Depth-2].td as named_type_reference, ValueStack[ValueStack.Depth-1].stn as template_param_list, CurrentLocationSpan); } break; - case 214: // template_type_params -> tkLower, template_param_list, tkGreater + case 215: // template_type_params -> tkLower, template_param_list, tkGreater { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 215: // template_param_list -> template_param + case 216: // template_param_list -> template_param { CurrentSemanticValue.stn = new template_param_list(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 216: // template_param_list -> template_param_list, tkComma, template_param + case 217: // template_param_list -> template_param_list, tkComma, template_param { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as template_param_list).Add(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 217: // template_param -> simple_type + case 218: // template_param -> simple_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 218: // template_param -> simple_type, tkQuestion + case 219: // template_param -> simple_type, tkQuestion { var l = new List(); l.Add(new ident("System")); @@ -3244,407 +3247,407 @@ public partial class GPPGParser: ShiftReduceParser structured_type + case 220: // template_param -> structured_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 220: // template_param -> procedural_type + case 221: // template_param -> procedural_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 221: // template_param -> template_type + case 222: // template_param -> template_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 222: // simple_type -> range_expr + case 223: // simple_type -> range_expr { CurrentSemanticValue.td = parsertools.ConvertDotNodeOrIdentToNamedTypeReference(ValueStack[ValueStack.Depth-1].ex); } break; - case 223: // simple_type -> range_expr, tkDotDot, range_expr + case 224: // simple_type -> range_expr, tkDotDot, range_expr { CurrentSemanticValue.td = new diapason(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 224: // simple_type -> tkRoundOpen, enumeration_id_list, tkRoundClose + case 225: // simple_type -> tkRoundOpen, enumeration_id_list, tkRoundClose { CurrentSemanticValue.td = new enum_type_definition(ValueStack[ValueStack.Depth-2].stn as enumerator_list, CurrentLocationSpan); } break; - case 225: // range_expr -> range_term + case 226: // range_expr -> range_term { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 226: // range_expr -> range_expr, const_addop, range_term + case 227: // range_expr -> range_expr, const_addop, range_term { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 227: // range_term -> range_factor + case 228: // range_term -> range_factor { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 228: // range_term -> range_term, const_mulop, range_factor + case 229: // range_term -> range_term, const_mulop, range_factor { CurrentSemanticValue.ex = new bin_expr(ValueStack[ValueStack.Depth-3].ex, ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 229: // range_factor -> simple_type_identifier + case 230: // range_factor -> simple_type_identifier { CurrentSemanticValue.ex = parsertools.ConvertNamedTypeReferenceToDotNodeOrIdent(ValueStack[ValueStack.Depth-1].td as named_type_reference); } break; - case 230: // range_factor -> unsigned_number + case 231: // range_factor -> unsigned_number { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 231: // range_factor -> sign, range_factor + case 232: // range_factor -> sign, range_factor { CurrentSemanticValue.ex = new un_expr(ValueStack[ValueStack.Depth-1].ex, ValueStack[ValueStack.Depth-2].op.type, CurrentLocationSpan); } break; - case 232: // range_factor -> literal + case 233: // range_factor -> literal { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 233: // range_factor -> range_factor, tkRoundOpen, const_elem_list, tkRoundClose + case 234: // range_factor -> range_factor, tkRoundOpen, const_elem_list, tkRoundClose { CurrentSemanticValue.ex = new method_call(ValueStack[ValueStack.Depth-4].ex as addressed_value, ValueStack[ValueStack.Depth-2].stn as expression_list, CurrentLocationSpan); } break; - case 234: // simple_type_identifier -> identifier + case 235: // simple_type_identifier -> identifier { CurrentSemanticValue.td = new named_type_reference(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); } break; - case 235: // simple_type_identifier -> simple_type_identifier, tkPoint, + case 236: // simple_type_identifier -> simple_type_identifier, tkPoint, // identifier_or_keyword { CurrentSemanticValue.td = (ValueStack[ValueStack.Depth-3].td as named_type_reference).Add(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); } break; - case 236: // enumeration_id_list -> enumeration_id, tkComma, enumeration_id + case 237: // enumeration_id_list -> enumeration_id, tkComma, enumeration_id { CurrentSemanticValue.stn = new enumerator_list(ValueStack[ValueStack.Depth-3].stn as enumerator, CurrentLocationSpan); (CurrentSemanticValue.stn as enumerator_list).Add(ValueStack[ValueStack.Depth-1].stn as enumerator, CurrentLocationSpan); } break; - case 237: // enumeration_id_list -> enumeration_id_list, tkComma, enumeration_id + case 238: // enumeration_id_list -> enumeration_id_list, tkComma, enumeration_id { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as enumerator_list).Add(ValueStack[ValueStack.Depth-1].stn as enumerator, CurrentLocationSpan); } break; - case 238: // enumeration_id -> type_ref + case 239: // enumeration_id -> type_ref { CurrentSemanticValue.stn = new enumerator(ValueStack[ValueStack.Depth-1].td, null, CurrentLocationSpan); } break; - case 239: // enumeration_id -> type_ref, tkEqual, expr + case 240: // enumeration_id -> type_ref, tkEqual, expr { CurrentSemanticValue.stn = new enumerator(ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].ex, CurrentLocationSpan); } break; - case 240: // pointer_type -> tkDeref, fptype + case 241: // pointer_type -> tkDeref, fptype { CurrentSemanticValue.td = new ref_type(ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); } break; - case 241: // structured_type -> unpacked_structured_type + case 242: // structured_type -> unpacked_structured_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 242: // structured_type -> tkPacked, unpacked_structured_type + case 243: // structured_type -> tkPacked, unpacked_structured_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 243: // unpacked_structured_type -> array_type + case 244: // unpacked_structured_type -> array_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 244: // unpacked_structured_type -> record_type + case 245: // unpacked_structured_type -> record_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 245: // unpacked_structured_type -> set_type + case 246: // unpacked_structured_type -> set_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 246: // unpacked_structured_type -> file_type + case 247: // unpacked_structured_type -> file_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 247: // unpacked_structured_type -> sequence_type + case 248: // unpacked_structured_type -> sequence_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 248: // sequence_type -> tkSequence, tkOf, type_ref + case 249: // sequence_type -> tkSequence, tkOf, type_ref { CurrentSemanticValue.td = new sequence_type(ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); } break; - case 249: // array_type -> tkArray, tkSquareOpen, simple_type_list, tkSquareClose, tkOf, + case 250: // array_type -> tkArray, tkSquareOpen, simple_type_list, tkSquareClose, tkOf, // type_ref { CurrentSemanticValue.td = new array_type(ValueStack[ValueStack.Depth-4].stn as indexers_types, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 250: // array_type -> unsized_array_type + case 251: // array_type -> unsized_array_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 251: // unsized_array_type -> tkArray, tkOf, type_ref + case 252: // unsized_array_type -> tkArray, tkOf, type_ref { CurrentSemanticValue.td = new array_type(null, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 252: // simple_type_list -> simple_type_or_ + case 253: // simple_type_list -> simple_type_or_ { CurrentSemanticValue.stn = new indexers_types(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 253: // simple_type_list -> simple_type_list, tkComma, simple_type_or_ + case 254: // simple_type_list -> simple_type_list, tkComma, simple_type_or_ { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as indexers_types).Add(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 254: // simple_type_or_ -> simple_type + case 255: // simple_type_or_ -> simple_type { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 255: // simple_type_or_ -> /* empty */ + case 256: // simple_type_or_ -> /* empty */ { CurrentSemanticValue.td = null; } break; - case 256: // set_type -> tkSet, tkOf, simple_type + case 257: // set_type -> tkSet, tkOf, simple_type { CurrentSemanticValue.td = new set_type_definition(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 257: // file_type -> tkFile, tkOf, type_ref + case 258: // file_type -> tkFile, tkOf, type_ref { CurrentSemanticValue.td = new file_type(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 258: // file_type -> tkFile + case 259: // file_type -> tkFile { CurrentSemanticValue.td = new file_type(); CurrentSemanticValue.td.source_context = CurrentLocationSpan; } break; - case 259: // string_type -> tkIdentifier, tkSquareOpen, const_expr, tkSquareClose + case 260: // string_type -> tkIdentifier, tkSquareOpen, const_expr, tkSquareClose { CurrentSemanticValue.td = new string_num_definition(ValueStack[ValueStack.Depth-2].ex, ValueStack[ValueStack.Depth-4].id, CurrentLocationSpan); } break; - case 260: // procedural_type -> procedural_type_kind + case 261: // procedural_type -> procedural_type_kind { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 261: // procedural_type_kind -> proc_type_decl + case 262: // procedural_type_kind -> proc_type_decl { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 262: // proc_type_decl -> tkProcedure, fp_list + case 263: // proc_type_decl -> tkProcedure, fp_list { CurrentSemanticValue.td = new procedure_header(ValueStack[ValueStack.Depth-1].stn as formal_parameters,null,null,false,false,null,null,CurrentLocationSpan); } break; - case 263: // proc_type_decl -> tkFunction, fp_list + case 264: // proc_type_decl -> tkFunction, fp_list { CurrentSemanticValue.td = new function_header(ValueStack[ValueStack.Depth-1].stn as formal_parameters, null, null, null, null, CurrentLocationSpan); } break; - case 264: // proc_type_decl -> tkFunction, fp_list, tkColon, fptype + case 265: // proc_type_decl -> tkFunction, fp_list, tkColon, fptype { CurrentSemanticValue.td = new function_header(ValueStack[ValueStack.Depth-3].stn as formal_parameters, null, null, null, ValueStack[ValueStack.Depth-1].td as type_definition, CurrentLocationSpan); } break; - case 265: // proc_type_decl -> simple_type_identifier, tkArrow, template_param + case 266: // proc_type_decl -> simple_type_identifier, tkArrow, template_param { CurrentSemanticValue.td = new modern_proc_type(ValueStack[ValueStack.Depth-3].td,null,ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); } break; - case 266: // proc_type_decl -> template_type, tkArrow, template_param + case 267: // proc_type_decl -> template_type, tkArrow, template_param { CurrentSemanticValue.td = new modern_proc_type(ValueStack[ValueStack.Depth-3].td,null,ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); } break; - case 267: // proc_type_decl -> tkRoundOpen, tkRoundClose, tkArrow, template_param + case 268: // proc_type_decl -> tkRoundOpen, tkRoundClose, tkArrow, template_param { CurrentSemanticValue.td = new modern_proc_type(null,null,ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); } break; - case 268: // proc_type_decl -> tkRoundOpen, enumeration_id_list, tkRoundClose, tkArrow, + case 269: // proc_type_decl -> tkRoundOpen, enumeration_id_list, tkRoundClose, tkArrow, // template_param { CurrentSemanticValue.td = new modern_proc_type(null,ValueStack[ValueStack.Depth-4].stn as enumerator_list,ValueStack[ValueStack.Depth-1].td,CurrentLocationSpan); } break; - case 269: // proc_type_decl -> simple_type_identifier, tkArrow, tkRoundOpen, tkRoundClose + case 270: // proc_type_decl -> simple_type_identifier, tkArrow, tkRoundOpen, tkRoundClose { CurrentSemanticValue.td = new modern_proc_type(ValueStack[ValueStack.Depth-4].td,null,null,CurrentLocationSpan); } break; - case 270: // proc_type_decl -> template_type, tkArrow, tkRoundOpen, tkRoundClose + case 271: // proc_type_decl -> template_type, tkArrow, tkRoundOpen, tkRoundClose { CurrentSemanticValue.td = new modern_proc_type(ValueStack[ValueStack.Depth-4].td,null,null,CurrentLocationSpan); } break; - case 271: // proc_type_decl -> tkRoundOpen, tkRoundClose, tkArrow, tkRoundOpen, tkRoundClose + case 272: // proc_type_decl -> tkRoundOpen, tkRoundClose, tkArrow, tkRoundOpen, tkRoundClose { CurrentSemanticValue.td = new modern_proc_type(null,null,null,CurrentLocationSpan); } break; - case 272: // proc_type_decl -> tkRoundOpen, enumeration_id_list, tkRoundClose, tkArrow, + case 273: // proc_type_decl -> tkRoundOpen, enumeration_id_list, tkRoundClose, tkArrow, // tkRoundOpen, tkRoundClose { CurrentSemanticValue.td = new modern_proc_type(null,ValueStack[ValueStack.Depth-5].stn as enumerator_list,null,CurrentLocationSpan); } break; - case 273: // object_type -> class_attributes, class_or_interface_keyword, + case 274: // object_type -> class_attributes, class_or_interface_keyword, // optional_base_classes, optional_where_section, // optional_component_list_seq_end { CurrentSemanticValue.td = NewObjectType((class_attribute)ValueStack[ValueStack.Depth-5].ob, ValueStack[ValueStack.Depth-4].ti, ValueStack[ValueStack.Depth-3].stn as named_type_reference_list, ValueStack[ValueStack.Depth-2].stn as where_definition_list, ValueStack[ValueStack.Depth-1].stn as class_body_list, CurrentLocationSpan); } break; - case 274: // record_type -> tkRecord, optional_base_classes, optional_where_section, + case 275: // record_type -> tkRecord, optional_base_classes, optional_where_section, // member_list_section, tkEnd { CurrentSemanticValue.td = NewRecordType(ValueStack[ValueStack.Depth-4].stn as named_type_reference_list, ValueStack[ValueStack.Depth-3].stn as where_definition_list, ValueStack[ValueStack.Depth-2].stn as class_body_list, CurrentLocationSpan); } break; - case 275: // class_attribute -> tkSealed + case 276: // class_attribute -> tkSealed { CurrentSemanticValue.ob = class_attribute.Sealed; } break; - case 276: // class_attribute -> tkPartial + case 277: // class_attribute -> tkPartial { CurrentSemanticValue.ob = class_attribute.Partial; } break; - case 277: // class_attribute -> tkAbstract + case 278: // class_attribute -> tkAbstract { CurrentSemanticValue.ob = class_attribute.Abstract; } break; - case 278: // class_attribute -> tkAuto + case 279: // class_attribute -> tkAuto { CurrentSemanticValue.ob = class_attribute.Auto; } break; - case 279: // class_attributes -> /* empty */ + case 280: // class_attributes -> /* empty */ { CurrentSemanticValue.ob = class_attribute.None; } break; - case 280: // class_attributes -> class_attributes1 + case 281: // class_attributes -> class_attributes1 { CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-1].ob; } break; - case 281: // class_attributes1 -> class_attribute + case 282: // class_attributes1 -> class_attribute { CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-1].ob; } break; - case 282: // class_attributes1 -> class_attributes1, class_attribute + case 283: // class_attributes1 -> class_attributes1, class_attribute { ValueStack[ValueStack.Depth-2].ob = ((class_attribute)ValueStack[ValueStack.Depth-2].ob) | ((class_attribute)ValueStack[ValueStack.Depth-1].ob); CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-2].ob; } break; - case 283: // class_or_interface_keyword -> tkClass + case 284: // class_or_interface_keyword -> tkClass { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 284: // class_or_interface_keyword -> tkInterface + case 285: // class_or_interface_keyword -> tkInterface { CurrentSemanticValue.ti = ValueStack[ValueStack.Depth-1].ti; } break; - case 285: // class_or_interface_keyword -> tkTemplate + case 286: // class_or_interface_keyword -> tkTemplate { CurrentSemanticValue.ti = NewClassOrInterfaceKeyword(ValueStack[ValueStack.Depth-1].ti); } break; - case 286: // class_or_interface_keyword -> tkTemplate, tkClass + case 287: // class_or_interface_keyword -> tkTemplate, tkClass { CurrentSemanticValue.ti = NewClassOrInterfaceKeyword(ValueStack[ValueStack.Depth-2].ti, "c", CurrentLocationSpan); } break; - case 287: // class_or_interface_keyword -> tkTemplate, tkRecord + case 288: // class_or_interface_keyword -> tkTemplate, tkRecord { CurrentSemanticValue.ti = NewClassOrInterfaceKeyword(ValueStack[ValueStack.Depth-2].ti, "r", CurrentLocationSpan); } break; - case 288: // class_or_interface_keyword -> tkTemplate, tkInterface + case 289: // class_or_interface_keyword -> tkTemplate, tkInterface { CurrentSemanticValue.ti = NewClassOrInterfaceKeyword(ValueStack[ValueStack.Depth-2].ti, "i", CurrentLocationSpan); } break; - case 289: // optional_component_list_seq_end -> /* empty */ + case 290: // optional_component_list_seq_end -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 290: // optional_component_list_seq_end -> member_list_section, tkEnd + case 291: // optional_component_list_seq_end -> member_list_section, tkEnd { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 292: // optional_base_classes -> tkRoundOpen, base_classes_names_list, tkRoundClose + case 293: // optional_base_classes -> tkRoundOpen, base_classes_names_list, tkRoundClose { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } break; - case 293: // base_classes_names_list -> base_class_name + case 294: // base_classes_names_list -> base_class_name { CurrentSemanticValue.stn = new named_type_reference_list(ValueStack[ValueStack.Depth-1].stn as named_type_reference, CurrentLocationSpan); } break; - case 294: // base_classes_names_list -> base_classes_names_list, tkComma, base_class_name + case 295: // base_classes_names_list -> base_classes_names_list, tkComma, base_class_name { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as named_type_reference_list).Add(ValueStack[ValueStack.Depth-1].stn as named_type_reference, CurrentLocationSpan); } break; - case 295: // base_class_name -> simple_type_identifier + case 296: // base_class_name -> simple_type_identifier { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].td; } break; - case 296: // base_class_name -> template_type + case 297: // base_class_name -> template_type { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].td; } break; - case 297: // template_arguments -> tkLower, ident_list, tkGreater + case 298: // template_arguments -> tkLower, ident_list, tkGreater { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 298: // optional_where_section -> /* empty */ + case 299: // optional_where_section -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 299: // optional_where_section -> where_part_list + case 300: // optional_where_section -> where_part_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 300: // where_part_list -> where_part + case 301: // where_part_list -> where_part { CurrentSemanticValue.stn = new where_definition_list(ValueStack[ValueStack.Depth-1].stn as where_definition, CurrentLocationSpan); } break; - case 301: // where_part_list -> where_part_list, where_part + case 302: // where_part_list -> where_part_list, where_part { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-2].stn as where_definition_list).Add(ValueStack[ValueStack.Depth-1].stn as where_definition, CurrentLocationSpan); } break; - case 302: // where_part -> tkWhere, ident_list, tkColon, type_ref_and_secific_list, + case 303: // where_part -> tkWhere, ident_list, tkColon, type_ref_and_secific_list, // tkSemiColon { CurrentSemanticValue.stn = new where_definition(ValueStack[ValueStack.Depth-4].stn as ident_list, ValueStack[ValueStack.Depth-2].stn as where_type_specificator_list, CurrentLocationSpan); } break; - case 303: // type_ref_and_secific_list -> type_ref_or_secific + case 304: // type_ref_and_secific_list -> type_ref_or_secific { CurrentSemanticValue.stn = new where_type_specificator_list(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 304: // type_ref_and_secific_list -> type_ref_and_secific_list, tkComma, + case 305: // type_ref_and_secific_list -> type_ref_and_secific_list, tkComma, // type_ref_or_secific { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as where_type_specificator_list).Add(ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 305: // type_ref_or_secific -> type_ref + case 306: // type_ref_or_secific -> type_ref { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 306: // type_ref_or_secific -> tkClass + case 307: // type_ref_or_secific -> tkClass { CurrentSemanticValue.td = new declaration_specificator(DeclarationSpecificator.WhereDefClass, ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 307: // type_ref_or_secific -> tkRecord + case 308: // type_ref_or_secific -> tkRecord { CurrentSemanticValue.td = new declaration_specificator(DeclarationSpecificator.WhereDefValueType, ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 308: // type_ref_or_secific -> tkConstructor + case 309: // type_ref_or_secific -> tkConstructor { CurrentSemanticValue.td = new declaration_specificator(DeclarationSpecificator.WhereDefConstructor, ValueStack[ValueStack.Depth-1].ti.text, CurrentLocationSpan); } break; - case 309: // member_list_section -> member_list + case 310: // member_list_section -> member_list { CurrentSemanticValue.stn = new class_body_list(ValueStack[ValueStack.Depth-1].stn as class_members, CurrentLocationSpan); } break; - case 310: // member_list_section -> member_list_section, ot_visibility_specifier, + case 311: // member_list_section -> member_list_section, ot_visibility_specifier, // member_list { (ValueStack[ValueStack.Depth-1].stn as class_members).access_mod = ValueStack[ValueStack.Depth-2].stn as access_modifer_node; @@ -3656,210 +3659,210 @@ public partial class GPPGParser: ShiftReduceParser tkInternal + case 312: // ot_visibility_specifier -> tkInternal { CurrentSemanticValue.stn = new access_modifer_node(access_modifer.internal_modifer, CurrentLocationSpan); } break; - case 312: // ot_visibility_specifier -> tkPublic + case 313: // ot_visibility_specifier -> tkPublic { CurrentSemanticValue.stn = new access_modifer_node(access_modifer.public_modifer, CurrentLocationSpan); } break; - case 313: // ot_visibility_specifier -> tkProtected + case 314: // ot_visibility_specifier -> tkProtected { CurrentSemanticValue.stn = new access_modifer_node(access_modifer.protected_modifer, CurrentLocationSpan); } break; - case 314: // ot_visibility_specifier -> tkPrivate + case 315: // ot_visibility_specifier -> tkPrivate { CurrentSemanticValue.stn = new access_modifer_node(access_modifer.private_modifer, CurrentLocationSpan); } break; - case 315: // member_list -> /* empty */ + case 316: // member_list -> /* empty */ { CurrentSemanticValue.stn = new class_members(); } break; - case 316: // member_list -> field_or_const_definition_list, optional_semicolon + case 317: // member_list -> field_or_const_definition_list, optional_semicolon { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } break; - case 317: // member_list -> method_decl_list + case 318: // member_list -> method_decl_list { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 318: // member_list -> field_or_const_definition_list, tkSemiColon, method_decl_list + case 319: // member_list -> field_or_const_definition_list, tkSemiColon, method_decl_list { (ValueStack[ValueStack.Depth-3].stn as class_members).members.AddRange((ValueStack[ValueStack.Depth-1].stn as class_members).members); (ValueStack[ValueStack.Depth-3].stn as class_members).source_context = CurrentLocationSpan; CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-3].stn; } break; - case 319: // ident_list -> identifier + case 320: // ident_list -> identifier { CurrentSemanticValue.stn = new ident_list(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); } break; - case 320: // ident_list -> ident_list, tkComma, identifier + case 321: // ident_list -> ident_list, tkComma, identifier { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as ident_list).Add(ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); } break; - case 321: // optional_semicolon -> /* empty */ + case 322: // optional_semicolon -> /* empty */ { CurrentSemanticValue.ob = null; } break; - case 322: // optional_semicolon -> tkSemiColon + case 323: // optional_semicolon -> tkSemiColon { CurrentSemanticValue.ob = ValueStack[ValueStack.Depth-1].ti; } break; - case 323: // field_or_const_definition_list -> field_or_const_definition + case 324: // field_or_const_definition_list -> field_or_const_definition { CurrentSemanticValue.stn = new class_members(ValueStack[ValueStack.Depth-1].stn as declaration, CurrentLocationSpan); } break; - case 324: // field_or_const_definition_list -> field_or_const_definition_list, tkSemiColon, + case 325: // field_or_const_definition_list -> field_or_const_definition_list, tkSemiColon, // field_or_const_definition { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as class_members).Add(ValueStack[ValueStack.Depth-1].stn as declaration, CurrentLocationSpan); } break; - case 325: // field_or_const_definition -> attribute_declarations, + case 326: // field_or_const_definition -> attribute_declarations, // simple_field_or_const_definition { (ValueStack[ValueStack.Depth-1].stn as declaration).attributes = ValueStack[ValueStack.Depth-2].stn as attribute_list; CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 326: // method_decl_list -> method_or_property_decl + case 327: // method_decl_list -> method_or_property_decl { CurrentSemanticValue.stn = new class_members(ValueStack[ValueStack.Depth-1].stn as declaration, CurrentLocationSpan); } break; - case 327: // method_decl_list -> method_decl_list, method_or_property_decl + case 328: // method_decl_list -> method_decl_list, method_or_property_decl { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-2].stn as class_members).Add(ValueStack[ValueStack.Depth-1].stn as declaration, CurrentLocationSpan); } break; - case 328: // method_or_property_decl -> method_decl_withattr + case 329: // method_or_property_decl -> method_decl_withattr { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 329: // method_or_property_decl -> property_definition + case 330: // method_or_property_decl -> property_definition { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 330: // simple_field_or_const_definition -> tkConst, only_const_decl + case 331: // simple_field_or_const_definition -> tkConst, only_const_decl { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 331: // simple_field_or_const_definition -> field_definition + case 332: // simple_field_or_const_definition -> field_definition { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 332: // simple_field_or_const_definition -> tkClass, field_definition + case 333: // simple_field_or_const_definition -> tkClass, field_definition { (ValueStack[ValueStack.Depth-1].stn as var_def_statement).var_attr = definition_attribute.Static; (ValueStack[ValueStack.Depth-1].stn as var_def_statement).source_context = CurrentLocationSpan; CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 333: // field_definition -> var_decl_part + case 334: // field_definition -> var_decl_part { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 334: // field_definition -> tkEvent, ident_list, tkColon, type_ref + case 335: // field_definition -> tkEvent, ident_list, tkColon, type_ref { CurrentSemanticValue.stn = new var_def_statement(ValueStack[ValueStack.Depth-3].stn as ident_list, ValueStack[ValueStack.Depth-1].td, null, definition_attribute.None, true, CurrentLocationSpan); } break; - case 335: // method_decl_withattr -> attribute_declarations, method_header + case 336: // method_decl_withattr -> attribute_declarations, method_header { (ValueStack[ValueStack.Depth-1].td as declaration).attributes = ValueStack[ValueStack.Depth-2].stn as attribute_list; CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].td; } break; - case 336: // method_decl_withattr -> attribute_declarations, method_decl + case 337: // method_decl_withattr -> attribute_declarations, method_decl { (ValueStack[ValueStack.Depth-1].stn as declaration).attributes = ValueStack[ValueStack.Depth-2].stn as attribute_list; CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 337: // method_decl -> inclass_proc_func_decl + case 338: // method_decl -> inclass_proc_func_decl { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 338: // method_decl -> inclass_constr_destr_decl + case 339: // method_decl -> inclass_constr_destr_decl { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 339: // method_header -> tkClass, method_procfunc_header + case 340: // method_header -> tkClass, method_procfunc_header { (ValueStack[ValueStack.Depth-1].td as procedure_header).class_keyword = true; CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 340: // method_header -> method_procfunc_header + case 341: // method_header -> method_procfunc_header { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 341: // method_header -> constr_destr_header + case 342: // method_header -> constr_destr_header { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 342: // method_procfunc_header -> proc_func_header + case 343: // method_procfunc_header -> proc_func_header { CurrentSemanticValue.td = NewProcfuncHeading(ValueStack[ValueStack.Depth-1].td as procedure_header); } break; - case 343: // proc_func_header -> proc_header + case 344: // proc_func_header -> proc_header { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 344: // proc_func_header -> func_header + case 345: // proc_func_header -> func_header { CurrentSemanticValue.td = ValueStack[ValueStack.Depth-1].td; } break; - case 345: // constr_destr_header -> tkConstructor, optional_proc_name, fp_list, + case 346: // constr_destr_header -> tkConstructor, optional_proc_name, fp_list, // optional_method_modificators { CurrentSemanticValue.td = new constructor(null,ValueStack[ValueStack.Depth-2].stn as formal_parameters,ValueStack[ValueStack.Depth-1].stn as procedure_attributes_list,ValueStack[ValueStack.Depth-3].stn as method_name,false,false,null,null,CurrentLocationSpan); } break; - case 346: // constr_destr_header -> tkClass, tkConstructor, optional_proc_name, fp_list, + case 347: // constr_destr_header -> tkClass, tkConstructor, optional_proc_name, fp_list, // optional_method_modificators { CurrentSemanticValue.td = new constructor(null,ValueStack[ValueStack.Depth-2].stn as formal_parameters,ValueStack[ValueStack.Depth-1].stn as procedure_attributes_list,ValueStack[ValueStack.Depth-3].stn as method_name,false,true,null,null,CurrentLocationSpan); } break; - case 347: // constr_destr_header -> tkDestructor, optional_proc_name, fp_list, + case 348: // constr_destr_header -> tkDestructor, optional_proc_name, fp_list, // optional_method_modificators { CurrentSemanticValue.td = new destructor(null,ValueStack[ValueStack.Depth-2].stn as formal_parameters,ValueStack[ValueStack.Depth-1].stn as procedure_attributes_list,ValueStack[ValueStack.Depth-3].stn as method_name, false,false,null,null,CurrentLocationSpan); } break; - case 348: // optional_proc_name -> proc_name + case 349: // optional_proc_name -> proc_name { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 349: // optional_proc_name -> /* empty */ + case 350: // optional_proc_name -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 350: // qualified_identifier -> identifier + case 351: // qualified_identifier -> identifier { CurrentSemanticValue.stn = new method_name(null,null,ValueStack[ValueStack.Depth-1].id,null,CurrentLocationSpan); } break; - case 351: // qualified_identifier -> visibility_specifier + case 352: // qualified_identifier -> visibility_specifier { CurrentSemanticValue.stn = new method_name(null,null,ValueStack[ValueStack.Depth-1].id,null,CurrentLocationSpan); } break; - case 352: // qualified_identifier -> qualified_identifier, tkPoint, identifier + case 353: // qualified_identifier -> qualified_identifier, tkPoint, identifier { CurrentSemanticValue.stn = NewQualifiedIdentifier(ValueStack[ValueStack.Depth-3].stn as method_name, ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); } break; - case 353: // qualified_identifier -> qualified_identifier, tkPoint, visibility_specifier + case 354: // qualified_identifier -> qualified_identifier, tkPoint, visibility_specifier { CurrentSemanticValue.stn = NewQualifiedIdentifier(ValueStack[ValueStack.Depth-3].stn as method_name, ValueStack[ValueStack.Depth-1].id, CurrentLocationSpan); } break; - case 354: // property_definition -> attribute_declarations, simple_prim_property_definition + case 355: // property_definition -> attribute_declarations, simple_prim_property_definition { CurrentSemanticValue.stn = NewPropertyDefinition(ValueStack[ValueStack.Depth-2].stn as attribute_list, ValueStack[ValueStack.Depth-1].stn as declaration, LocationStack[LocationStack.Depth-1]); } break; - case 355: // simple_prim_property_definition -> simple_property_definition + case 356: // simple_prim_property_definition -> simple_property_definition { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-1].stn; } break; - case 356: // simple_prim_property_definition -> tkClass, simple_property_definition + case 357: // simple_prim_property_definition -> tkClass, simple_property_definition { CurrentSemanticValue.stn = NewSimplePrimPropertyDefinition(ValueStack[ValueStack.Depth-1].stn as simple_property, CurrentLocationSpan); } break; - case 357: // simple_property_definition -> tkProperty, qualified_identifier, + case 358: // simple_property_definition -> tkProperty, qualified_identifier, // property_interface, property_specifiers, // tkSemiColon, array_defaultproperty { CurrentSemanticValue.stn = NewSimplePropertyDefinition(ValueStack[ValueStack.Depth-5].stn as method_name, ValueStack[ValueStack.Depth-4].stn as property_interface, ValueStack[ValueStack.Depth-3].stn as property_accessors, proc_attribute.attr_none, ValueStack[ValueStack.Depth-1].stn as property_array_default, CurrentLocationSpan); } break; - case 358: // simple_property_definition -> tkProperty, qualified_identifier, + case 359: // simple_property_definition -> tkProperty, qualified_identifier, // property_interface, property_specifiers, // tkSemiColon, property_modificator, tkSemiColon, // array_defaultproperty @@ -3872,99 +3875,99 @@ public partial class GPPGParser: ShiftReduceParser /* empty */ + case 360: // array_defaultproperty -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 360: // array_defaultproperty -> tkDefault, tkSemiColon + case 361: // array_defaultproperty -> tkDefault, tkSemiColon { CurrentSemanticValue.stn = new property_array_default(); CurrentSemanticValue.stn.source_context = CurrentLocationSpan; } break; - case 361: // property_interface -> /* empty */ + case 362: // property_interface -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 362: // property_interface -> property_parameter_list, tkColon, fptype + case 363: // property_interface -> property_parameter_list, tkColon, fptype { CurrentSemanticValue.stn = new property_interface(ValueStack[ValueStack.Depth-3].stn as property_parameter_list, ValueStack[ValueStack.Depth-1].td, null, CurrentLocationSpan); } break; - case 363: // property_parameter_list -> /* empty */ + case 364: // property_parameter_list -> /* empty */ { CurrentSemanticValue.stn = null; } break; - case 364: // property_parameter_list -> tkSquareOpen, parameter_decl_list, tkSquareClose + case 365: // property_parameter_list -> tkSquareOpen, parameter_decl_list, tkSquareClose { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } break; - case 365: // parameter_decl_list -> parameter_decl + case 366: // parameter_decl_list -> parameter_decl { CurrentSemanticValue.stn = new property_parameter_list(ValueStack[ValueStack.Depth-1].stn as property_parameter, CurrentLocationSpan); } break; - case 366: // parameter_decl_list -> parameter_decl_list, tkSemiColon, parameter_decl + case 367: // parameter_decl_list -> parameter_decl_list, tkSemiColon, parameter_decl { CurrentSemanticValue.stn = (ValueStack[ValueStack.Depth-3].stn as property_parameter_list).Add(ValueStack[ValueStack.Depth-1].stn as property_parameter, CurrentLocationSpan); } break; - case 367: // parameter_decl -> ident_list, tkColon, fptype + case 368: // parameter_decl -> ident_list, tkColon, fptype { CurrentSemanticValue.stn = new property_parameter(ValueStack[ValueStack.Depth-3].stn as ident_list, ValueStack[ValueStack.Depth-1].td, CurrentLocationSpan); } break; - case 368: // optional_identifier -> identifier + case 369: // optional_identifier -> identifier { CurrentSemanticValue.id = ValueStack[ValueStack.Depth-1].id; } break; - case 369: // optional_identifier -> /* empty */ + case 370: // optional_identifier -> /* empty */ { CurrentSemanticValue.id = null; } break; - case 371: // property_specifiers -> tkRead, optional_identifier, property_specifiers + case 372: // property_specifiers -> tkRead, optional_identifier, property_specifiers { CurrentSemanticValue.stn = NewPropertySpecifiersRead(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-2].id, ValueStack[ValueStack.Depth-1].stn as property_accessors, CurrentLocationSpan); } break; - case 372: // property_specifiers -> tkWrite, optional_identifier, property_specifiers + case 373: // property_specifiers -> tkWrite, optional_identifier, property_specifiers { CurrentSemanticValue.stn = NewPropertySpecifiersWrite(ValueStack[ValueStack.Depth-3].id, ValueStack[ValueStack.Depth-2].id, ValueStack[ValueStack.Depth-1].stn as property_accessors, CurrentLocationSpan); } break; - case 373: // var_decl -> var_decl_part, tkSemiColon + case 374: // var_decl -> var_decl_part, tkSemiColon { CurrentSemanticValue.stn = ValueStack[ValueStack.Depth-2].stn; } break; - case 376: // var_decl_part -> ident_list, tkColon, type_ref + case 377: // var_decl_part -> ident_list, tkColon, type_ref { CurrentSemanticValue.stn = new var_def_statement(ValueStack[ValueStack.Depth-3].stn as ident_list, ValueStack[ValueStack.Depth-1].td, null, definition_attribute.None, false, CurrentLocationSpan); } break; - case 377: // var_decl_part -> ident_list, tkAssign, expr + case 378: // var_decl_part -> ident_list, tkAssign, expr { CurrentSemanticValue.stn = new var_def_statement(ValueStack[ValueStack.Depth-3].stn as ident_list, null, ValueStack[ValueStack.Depth-1].ex, definition_attribute.None, false, CurrentLocationSpan); } break; - case 378: // var_decl_part -> ident_list, tkColon, type_ref, tkAssignOrEqual, + case 379: // var_decl_part -> ident_list, tkColon, type_ref, tkAssignOrEqual, // typed_var_init_expression { CurrentSemanticValue.stn = new var_def_statement(ValueStack[ValueStack.Depth-5].stn as ident_list, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].ex, definition_attribute.None, false, CurrentLocationSpan); } break; - case 379: // typed_var_init_expression -> typed_const_plus + case 380: // typed_var_init_expression -> typed_const_plus { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 380: // typed_var_init_expression -> expl_func_decl_lambda + case 381: // typed_var_init_expression -> expl_func_decl_lambda { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; - case 381: // typed_var_init_expression -> identifier, tkArrow, lambda_function_body + case 382: // typed_var_init_expression -> identifier, tkArrow, lambda_function_body { var idList = new ident_list(ValueStack[ValueStack.Depth-3].id, LocationStack[LocationStack.Depth-3]); var formalPars = new formal_parameters(new typed_parameters(idList, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), parametr_kind.none, null, LocationStack[LocationStack.Depth-3]), LocationStack[LocationStack.Depth-3]); CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), formalPars, new lambda_inferred_type(new PascalABCCompiler.TreeRealization.lambda_any_type_node(), null), ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan); } break; - case 382: // typed_var_init_expression -> tkRoundOpen, tkRoundClose, lambda_type_ref, + case 383: // typed_var_init_expression -> tkRoundOpen, tkRoundClose, lambda_type_ref, // tkArrow, lambda_function_body { CurrentSemanticValue.ex = new function_lambda_definition(lambdaHelper.CreateLambdaName(), null, ValueStack[ValueStack.Depth-3].td, ValueStack[ValueStack.Depth-1].stn as statement_list, CurrentLocationSpan); } break; - case 383: // typed_var_init_expression -> tkRoundOpen, typed_const_list, tkRoundClose, + case 384: // typed_var_init_expression -> tkRoundOpen, typed_const_list, tkRoundClose, // tkArrow, lambda_function_body { var el = ValueStack[ValueStack.Depth-4].stn as expression_list; @@ -3986,10 +3989,7 @@ public partial class GPPGParser: ShiftReduceParser typed_const -{ CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } - break; - case 385: // typed_const_plus -> new_expr + case 385: // typed_const_plus -> typed_const { CurrentSemanticValue.ex = ValueStack[ValueStack.Depth-1].ex; } break; case 386: // typed_const_plus -> default_expr diff --git a/TestSuite/new1.pas b/TestSuite/new1.pas new file mode 100644 index 000000000..a8dad211b --- /dev/null +++ b/TestSuite/new1.pas @@ -0,0 +1,10 @@ +function f(l: sequence of integer): integer; +begin + Result := l.Sum; +end; +begin +var i: integer := f(new integer[](1,2)); +assert(i = 3); +var j: integer := f(new List); +assert(j = 0); +end. \ No newline at end of file