From 75b002fcdd6333c1ae6beec0dfd64afce7fc3d87 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, 19 Jul 2015 11:57:25 +0200 Subject: [PATCH] removed pnet grammar --- Grammars/PNET/PNET.grm | 2625 --------------------------------- Grammars/PNET/PNET.pgt | 157 -- Grammars/PNET/compile_ALL.bat | 29 - Grammars/PNET/compile_GRM.bat | 3 - Grammars/PNET/compile_PGT.bat | 4 - Grammars/PNET/compile_RES.bat | 2 - 6 files changed, 2820 deletions(-) delete mode 100644 Grammars/PNET/PNET.grm delete mode 100644 Grammars/PNET/PNET.pgt delete mode 100644 Grammars/PNET/compile_ALL.bat delete mode 100644 Grammars/PNET/compile_GRM.bat delete mode 100644 Grammars/PNET/compile_PGT.bat delete mode 100644 Grammars/PNET/compile_RES.bat diff --git a/Grammars/PNET/PNET.grm b/Grammars/PNET/PNET.grm deleted file mode 100644 index 6a3fd2e58..000000000 --- a/Grammars/PNET/PNET.grm +++ /dev/null @@ -1,2625 +0,0 @@ -"Name" = 'PascalABC.NET' -"Version" = '1.1' -"Author" = 'DarkStar' -"About" = 'PascalABC.NET project' - -"Case Sensitive" = False - -!<%NAME%> %CODE% -!* -[TERMINALTEMPLATE] - { - %NAME% _%NAME%=new %NAME%(%PARAMS%); - - //_%NAME%.source_context=new SourceContext(LRParser.TokenLineNumber,LRParser.TokenLinePosition,LRParser.TokenLineNumber,LRParser.TokenLinePosition+LRParser.TokenLength-1); - _%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 BrainFuck -!* -[NONTERMINALTEMPLATE4] - { - ident _ident=new ident("%NAME%"); - procedure_call _procedure_call=new procedure_call(_ident); - parsertools.create_source_context(_ident,$1,$1); - parsertools.create_source_context(_procedure_call,$1,$1); - return _procedure_call; - } -*! - -!* -[NONTERMINALTEMPLATE5] - { - method_call m=new method_call(); - ident id=new ident("%NAME%"); - m.dereferencing_value=id; - parsertools.create_source_context(id,$1,$1); - parsertools.create_source_context(m,$1,$1); - while_node wn=new while_node(); - wn.expr=m; - wn.statements=(statement_list)$2; - return wn; - } -*! - -!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%; - } -*! -!* -[NONTERMINALTEMPLATE9] - //%NAME% create - { - %NAME% _%NAME%=new %NAME%(%PARAMS%); - object rt=$1; - if($2!=null) { - rt=$2; - if($2 is proc_block) $$.proc_body=(proc_block)$2; - if($2 is procedure_attribute) { - procedure_header ph=$$.proc_header; - if(ph.proc_attributes==null) { - ph.proc_attributes=new procedure_attributes_list(); - parsertools.assign_source_context(ph.proc_attributes,$2); - } - ph.proc_attributes.proc_attributes.Add((procedure_attribute)$2); - parsertools.create_source_context(ph.proc_attributes,ph.proc_attributes,$2); - } - } - parsertools.create_source_context($$,$1,rt); - %CODE% - return _%NAME%; - } -*! - - -"Start Symbol" = - -!Comment Start = '(*' -!Comment End = '*)' - -{Ident Letter} = {Letter} + [_] -{All ASCII} = {#1..#256}+{Cyrillic}+{#8100..#8800} -{TextPart} = {All ASCII} - {Control Codes} -{String Char} = {TextPart} - [''] -{ILStringChar} = {TextPart} - ["] -{CommentPartSlashes} = {All ASCII} - {LF} - {CR} -{CommentPart1} = {All ASCII} - [}] -{CommentPart2_1} = {All ASCII} - [*] -{CommentPart2_2} = {All ASCII} - [)] -{Hex Digit} = {Number} + [abcdefABCDEF] -{ILCodePart} = {All ASCII} - [();"] - -Whitespace = ({Whitespace}+ | (('//' {CommentPartSlashes}* ({CR}{LF}|{CR})) | ('{' {CommentPart1}* '}' ) | ('(*' ( {CommentPart2_1} | '*' {CommentPart2_2}? )* '*)' ))) - - -!!* parsertools.check_comment_text(this);$$=null;*! - - -tkILCode = 'il' ({CR}{LF}|{CR}) ({ILCodePart}* | ('"'({ILStringChar}|'"""')*'"'))* 'end' !**! - -tkFloat = ({Number}+'.'{Number}+) | (({Number}+'.')? {Number}+ [eE] [+-]? {Number}+) !*$$=parsertools.create_double_const(this);*! -tkIdentifier = ('&')? {Ident Letter} ({Ident Letter}|{Number})* !*$$=parsertools.create_ident(this);*! -tkInteger = {Number}+ !*$$=parsertools.create_int_const(this);*! -tkHex = '$'{Hex Digit}+ !*$$=parsertools.create_hex_const(this);*! -tkAsciiChar = '#'{Number}+ !*$$=parsertools.create_sharp_char_const(this);*! -tkStringLiteral = ''({String Char}|'''')*'' !*$$=parsertools.create_string_const(this);*! -tkDirectiveName = '#'{Ident Letter} ({Ident Letter}|{Number})* !*$$=parsertools.create_directive_name(this);*! -tkAddressOf = '@' !**! -tkAmpersend = '&' !**! -tkComma = ',' !**! -tkColon = ':' !**! -tkDeref = '^' !**! -tkDotDot = '..' !**! -tkPoint = '.' !**! -tkRoundOpen = '(' !**! -tkRoundClose = ')' !**! -tkSemiColon = ';' !**! -tkSquareOpen = '[' !**! -tkSquareClose = ']' !**! -tkQuestion = '?' !**! -tkAssign = ':=' !**! -tkPlusEqual = '+=' !**! -tkMinusEqual = '-=' !**! -tkMultEqual = '*=' !**! -tkDivEqual = '/=' !**! -tkMinus = '-' !**! -tkPlus = '+' !**! -tkSlash = '/' !**! -tkStar = '*' !**! -tkEqual = '=' !**! -tkGreater = '>' !**! -tkGreaterEqual = '>=' !**! -tkLower = '<' !**! -tkLowerEqual = '<=' !**! -tkNotEqual = '<>' !**! - -! Reserved ! -tkOr = 'or' !* $$.text=LRParser.TokenText;*! -tkXor = 'xor' !* $$.text=LRParser.TokenText;*! -tkAnd = 'and' !* $$.text=LRParser.TokenText;*! -tkDiv = 'div' !* $$.text=LRParser.TokenText;*! -tkMod = 'mod' !* $$.text=LRParser.TokenText;*! -tkShl = 'shl' !* $$.text=LRParser.TokenText;*! -tkShr = 'shr' !* $$.text=LRParser.TokenText;*! -tkNot = 'not' !* $$.text=LRParser.TokenText;*! -tkAs = 'as' !* $$.text=LRParser.TokenText;*! -tkIn = 'in' !* $$.text=LRParser.TokenText;*! -tkIs = 'is' !* $$.text=LRParser.TokenText;*! -tkSizeOf = 'sizeof' !**! -tkTypeOf = 'typeof' !**! -tkWhere = 'where' !**! -tkArray = 'array' !**! -tkBegin = 'begin' !**! -tkCase = 'case' !**! -tkClass = 'class' !**! -tkConst = 'const' !**! -tkConstructor = 'constructor' !**! -tkDestructor = 'destructor' !**! -tkDownto = 'downto' !**! -tkDo = 'do' !**! -tkElse = 'else' !**! -tkEnd = 'end' !**! -tkExcept = 'except' !**! -tkFile = 'file' !**! -tkFinalization = 'finalization' !**! -tkFinally = 'finally' !**! -tkFor = 'for' !**! -tkForeach = 'foreach' !**! -tkFunction = 'function' !**! -tkIf = 'if' !**! -tkImplementation = 'implementation' !**! -tkInherited = 'inherited' !**! -tkInitialization = 'initialization' !**! -tkInterface = 'interface' !**! -tkProcedure = 'procedure' !**! -tkOperator = 'operator' !**! -tkProperty = 'property' !**! -tkRaise = 'raise' !**! -tkRecord = 'record' !**! -tkRepeat = 'repeat' !**! -tkSet = 'set' !**! -tkTry = 'try' !**! -tkType = 'type' !**! -tkThen = 'then' !**! -tkTo = 'to' !**! -tkUntil = 'until' !**! -tkUses = 'uses' !**! -tkUsing = 'using' !**! -tkVar = 'var' !**! -tkWhile = 'while' !**! -tkWith = 'with' !**! -tkNil = 'nil' !**! -tkGoto = 'goto' !**! -tkOf = 'of' !**! -tkLabel = 'label' !**! -tkLock = 'lock' !**! -tkProgram = 'program' !**! -tkEvent = 'event' !**! -tkTemplate = 'template' !**! -tkPacked = 'packed' -tkInline = 'inline' -tkExports = 'exports' -tkResourceString = 'resourcestring' -tkThreadvar = 'threadvar' -tkFinal = 'final' !**! - - -! Non Reserved ! - -tkAt = 'at' !**! -tkOn = 'on' !**! -tkBF = 'bf' !**! -tkContains = 'contains' !**! -tkLibrary = 'library' !**! -tkOut = 'out' !**! -tkPackage = 'package' !**! -tkRequires = 'requires' !**! -tkUnit = 'unit' !**! - -tkShortInt = 'shortint' !**! -tkSmallInt = 'smallint' !**! -tkOrdInteger = 'integer' !**! -tkByte = 'byte' !**! -tkLongInt = 'longint' !**! -tkInt64 = 'int64' !**! -tkWord = 'word' !**! -tkBoolean = 'boolean' !**! -tkChar = 'char' !**! -tkWideChar = 'widechar' !**! -tkLongWord = 'longword' !**! -tkPChar = 'pchar' !**! -tkCardinal = 'cardinal' !**! -tkReal = 'real' !**! -tkSingle = 'single' !**! -tkDouble = 'double' !**! -tkExtended = 'extended' !**! -tkComp = 'comp' !**! -tkVariant = 'variant' !**! -tkOleVariant = 'olevariant' !**! -tkParams = 'params' !**! -tkObject = 'object' !**! - -tkStatic = 'static' !* $$.name=LRParser.TokenText;*! -tkAbstract = 'abstract' !* $$.name=LRParser.TokenText;*! -tkForward = 'forward' !* $$.name=LRParser.TokenText;*! -tkOverload = 'overload' !* $$.name=LRParser.TokenText;*! -tkReintroduce = 'reintroduce' !*$$.name=LRParser.TokenText;*! -tkOverride = 'override' !* $$.name=LRParser.TokenText;*! -tkVirtual = 'virtual' !* $$.name=LRParser.TokenText;*! - -tkAbsolute = 'absolute' !**! -tkAssembler = 'assembler' !**! -tkAutomated = 'automated' !**! -tkDefault = 'default' !**! -tkDispid = 'dispid' !**! -tkExternal = 'external' !**! -tkImplements = 'implements' !**! -tkIndex = 'index' !**! -tkMessage = 'message' !**! -tkName = 'name' !**! -tkNodefault = 'nodefault' !**! -tkPrivate = 'private' !**! -tkProtected = 'protected' !**! -tkPublic = 'public' !**! -tkInternal = 'internal' !**! -tkRead = 'read' !**! -tkResident = 'resident' !**! -tkStored = 'stored' !**! -tkWrite = 'write' !**! -tkReadOnly = 'readonly' !**! -tkWriteOnly = 'writeonly' !**! - -tkParseModeExpression = '<>' - -! ======================================= Rules - - - ::= - | - | -! | -! | - - - ::= tkParseModeExpression !*$$=$2;*! - -! -! ::= tkInterface -! | tkImplementation -! | tkVar -! | tkConst -! | tkType -! | tkResourceString -! | tkObject -! | tkFunction -! | tkProcedure -! | tkBegin -! | tkEnd -! | tkSemiColon - - - ::= - | - - - ::= !*$$=null;*! - | !*$$=null;*! - - - ::= tkDirectiveName tkIdentifier !* { - token_info t1 = new token_info(); - t1.text=((ident)$1).name; - t1.source_context = ((ident)$1).source_context; - token_info t2 = new token_info(); - t2.text=((ident)$2).name; - t2.source_context = ((ident)$2).source_context; - compiler_directive cd=new compiler_directive(t1,t2); - parsertools.create_source_context(cd,$1,$2); - CompilerDirectives.Add(cd); $$=null; - }*! - | tkDirectiveName tkStringLiteral !* { - token_info t1 = new token_info(); - t1.text=((ident)$1).name; - t1.source_context = ((ident)$1).source_context; - token_info t2 = new token_info(); - t2.text=((string_const)$2).Value; - t2.source_context = ((string_const)$2).source_context; - compiler_directive cd=new compiler_directive(t1,t2); - parsertools.create_source_context(cd,$1,$2); - CompilerDirectives.Add(cd); $$=null; - }*! - - - ::= tkPoint !*3program_module<$1 as program_name,(uses_list)$3,(block)$5,$4 as using_list> - $$.Language = LanguageId.PascalABCNET; - parsertools.create_source_context($$,parsertools.sc_not_null($1,$3,$4,$5),$5); - *! - - - - ::= - | tkProgram !*3program_name<(ident)$2> parsertools.create_source_context($$,$1,$2);*! - - - ::= tkSemiColon - | tkRoundOpen tkRoundClose tkSemiColon - - - ::= tkIdentifier - - - ::= - | tkComma - - - ::= tkIdentifier - - - ::= !*3block - if ($1!=null) { - $$.defs=$1 as declarations; - parsertools.create_source_context($$,$1,$2); - }else - parsertools.create_source_context($$,$2,$2); - *! - - - ::= - - - ::= -! ::= -! | tkUses tkSemiColon -! -! -! ::= tkComma -! | -! -! -! -! ::= tkIdentifier - - - ::= - | - - - ::= !*3using_list<> - parsertools.create_source_context($$,$1,$1); - $$.namespaces.Add((unit_or_namespace)$1);*! - | !*1using_list<>$1; - parsertools.create_source_context($$,$$,$2); - $$.namespaces.Add((unit_or_namespace)$2);*! - - - ::=tkUsing tkSemiColon !*3unit_or_namespace<(ident_list)$2> parsertools.create_source_context($$,$1,$3);*! - - - ::= !*6ident_listident*! - | tkPoint !*7ident_listident*! - - - ::= - | tkUses tkSemiColon !* parsertools.create_source_context($2,$1,$3);$$=$2;*! - - - ::= tkComma !*1uses_list<>$1; - $$.units.Add((unit_or_namespace)$3); - *! - | !*3uses_list<> - $$.units.Add((unit_or_namespace)$1); - *! - - - ::= !*0unit_or_namespace<(ident_list)$1>*! - | tkIn tkStringLiteral !*0uses_unit_in<> - $$.name=(ident_list)$1; - $$.in_file=(string_const)$3; - *! - - - ::= tkPoint - - - ::= tkLibrary tkIdentifier tkSemiColon - - - ::= - - - ::= - | - - - ::= - | - | - | - | - | - | - | - | - | - - - ::= tkExports tkSemiColon - - - ::= - | tkComma - - - ::= - - - ::= - | tkIndex - - - ::= - | tkName - | tkName - - - ::= - | tkResident - - - ::= tkPoint !*3unit_module<(unit_name)$1,(interface_node)$2,(implementation_node)$3,((initfinal_part)$4).initialization_sect,((initfinal_part)$4).finalization_sect> - $$.Language = LanguageId.PascalABCNET; - parsertools.create_source_context($$,$1,$5); - *! - | tkPoint !*3unit_module<(unit_name)$1,(interface_node)$2,null,((initfinal_part)$3).initialization_sect,((initfinal_part)$3).finalization_sect> - $$.Language = LanguageId.PascalABCNET; - parsertools.create_source_context($$,$1,$4); - *! - - - ::= tkSemiColon !*3unit_name<(ident)$2,UnitHeaderKeyword.Unit> - if(((ident)$1).name.ToLower()=="library") - $$.HeaderKeyword=UnitHeaderKeyword.Library; - parsertools.create_source_context($$,$1,$3);*! - - - ::= tkUnit - | tkLibrary - - - ::= tkIdentifier - - - ::= tkInterface !*3interface_node<> - $$.uses_modules=$2 as uses_list; - $$.using_namespaces=$3 as using_list; - $$.interface_definitions=$4 as declarations; - parsertools.create_source_context($$,$1,parsertools.sc_not_null($4,$3,$2,$1)); - *! - - - ::= tkImplementation !*3implementation_node<> - $$.uses_modules=$2 as uses_list; - $$.using_namespaces=$3 as using_list; - $$.implementation_definitions=$4 as declarations; - parsertools.create_source_context($$,$1,parsertools.sc_not_null($4,$3,$2,$1)); - *! - - ::= !*3interface_node<> - $$.uses_modules=$1 as uses_list; - $$.using_namespaces=$2 as using_list; - $$.interface_definitions=$3 as declarations; - object lt=parsertools.sc_not_null($1,$2,$3); - object rt=parsertools.sc_not_null($3,$2,$1); - if (lt!=null)parsertools.create_source_context($$,lt,rt); - *! - - - ::= tkEnd !*3initfinal_part<>*! - | tkInitialization tkEnd !*3initfinal_part<(statement_list)$2,null> - ((statement_list)$2).left_logical_bracket=(syntax_tree_node)$1; - ((statement_list)$2).right_logical_bracket=(syntax_tree_node)$3; - *! - | tkInitialization tkFinalization tkEnd !*3initfinal_part<(statement_list)$2,(statement_list)$4> - ((statement_list)$2).left_logical_bracket=(syntax_tree_node)$1; - ((statement_list)$4).left_logical_bracket=(syntax_tree_node)$3; - ((statement_list)$4).right_logical_bracket=(syntax_tree_node)$5; - *! - | tkBegin tkEnd !*3initfinal_part<(statement_list)$2,null> - ((statement_list)$2).left_logical_bracket=(syntax_tree_node)$1; - ((statement_list)$2).right_logical_bracket=(syntax_tree_node)$3; - *! - - - ::= tkPackage tkSemiColon tkEnd tkPoint - - - ::= - - - ::= - | tkRequires - | tkRequires tkSemiColon - - - ::= - | tkContains - | tkContains tkSemiColon - - - ::= !*if (((declarations)$1).defs.Count>0) return $1; return null;*! - - ::= !*3declarations<>*! - | !*1declarations<>$1; - $$.defs.Add((declaration)$2); - parsertools.create_source_context($$,parsertools.sc_not_null($1,$2),$2); - *! - - - ::= !*if (((declarations)$1).defs.Count>0) return $1; return null;*! - - ::= !*3declarations<>*! - | !*1declarations<>$1; - $$.defs.Add((declaration)$2); - parsertools.create_source_context($$,parsertools.sc_not_null($1,$2),$2); - *! - - ::= !*if (((declarations)$1).defs.Count>0) return $1; return null;*! - - ::= !*3declarations<>*! - | !*1declarations<>$1; - $$.defs.Add((declaration)$2); - parsertools.create_source_context($$,parsertools.sc_not_null($1,$2),$2); - *! - - ::= - | - | - | - | - | - - - ::= - | - | - | - | - | - | - | - | - - - ::= - | - | - | - | - - - ::= -! | tkSemiColon - | tkForward tkSemiColon !*2procedure_header<> $$=($1 as procedure_header); - if ($$.proc_attributes==null) $$.proc_attributes=new procedure_attributes_list(); - $$.proc_attributes.proc_attributes.Add((procedure_attribute)$2); - parsertools.create_source_context($$.proc_attributes,parsertools.sc_not_null($$.proc_attributes,$2),$2); - parsertools.create_source_context($$,$1,$2);*! -! | - - - ::= -! | tkSemiColon - | tkForward tkSemiColon !*2procedure_header<> $$=($1 as procedure_header); - if ($$.proc_attributes==null) $$.proc_attributes=new procedure_attributes_list(); - $$.proc_attributes.proc_attributes.Add((procedure_attribute)$2); - parsertools.create_source_context($$.proc_attributes,parsertools.sc_not_null($$.proc_attributes,$2),$2); - parsertools.create_source_context($$,$1,$2);*! -! | - - - ::= tkLabel tkSemiColon !*3label_definitions<(ident_list)$2> - parsertools.create_source_context($$,$1,$3);*! - - - ::= !*6ident_listident*! - | tkComma !*7ident_listident*! - - - ::= tkInteger !*3ident<> - if($1 is int32_const) - $$.name = ((int32_const)$1).val.ToString(); - else - if($1 is int64_const) - $$.name = ((int64_const)$1).val.ToString(); - else - $$.name = ((uint64_const)$1).val.ToString(); - parsertools.assign_source_context($$,$1);*! - | tkFloat !*3ident<((double_const)$1).val.ToString()> parsertools.assign_source_context($$,$1);*! - | - - - ::= tkConst !*3consts_definitions_list<> - $$.const_defs.Add((const_definition)$2); - parsertools.create_source_context($$,$1,$2);*! - | !*1consts_definitions_list<>$1; - $$.const_defs.Add((const_definition)$2); - parsertools.create_source_context($$,$$,$2);*! - - - ::= tkResourceString - | - - - ::= tkType !*3type_declarations<> - $$.types_decl.Add((type_declaration)$2); - parsertools.create_source_context($$,$1,$2);*! - | !*1type_declarations<>$1; - $$.types_decl.Add((type_declaration)$2); - parsertools.create_source_context($$,$$,$2);*! - - - ::= tkVar !*3variable_definitions<> - $$.var_definitions.Add((var_def_statement)$2); - parsertools.create_source_context($$,$1,$2);*! - | tkThreadvar - | !*1variable_definitions<>$1; - $$.var_definitions.Add((var_def_statement)$2); - parsertools.create_source_context($$,$$,$2);*! - - - ::= tkSemiColon !*$$=$1;*! - - - ::= tkEqual !*3simple_const_definition<> - $$.const_name=(ident)$1; - $$.const_value=(expression)$3; - parsertools.create_source_context($$,$1,$3);*! - | tkColon tkEqual !*3typed_const_definition<> - $$.const_name=(ident)$1; - $$.const_type=(type_definition)$3; - $$.const_value=(expression)$5; - parsertools.create_source_context($$,$1,$5);*! - - - ::= - | - - - ::= - - - ::= - | !*0bin_expr<(expression)$1,(expression)$3,((op_type_node)$2).type>*! - - - ::= tkEqual - | tkNotEqual - | tkLower - | tkGreater - | tkLowerEqual - | tkGreaterEqual - | tkIn - - - ::= - | !*0bin_expr<(expression)$1,(expression)$3,((op_type_node)$2).type>*! - - - ::= tkPlus - | tkMinus - | tkOr - | tkXor - - - ::= - | !*0bin_expr<(expression)$1,(expression)$3,((op_type_node)$2).type>*! - - - ::= tkStar - | tkSlash - | tkDiv - | tkMod - | tkShl - | tkShr - | tkAnd - - - ::= - | - | - | - | tkNil !*3nil_const<> parsertools.create_source_context($$,$1,$1);*! - | tkAddressOf !*3get_address<(addressed_value)$2> parsertools.create_source_context($$,$1,$2);*! - | tkRoundOpen tkRoundClose !* $$=$2;*! - | tkNot !*0un_expr<(expression)$2,((op_type_node)$1).type>*! - | !*0un_expr<(expression)$2,((op_type_node)$1).type>*! - | tkDeref !*3roof_dereference<> - $$.dereferencing_value=(addressed_value)$2; - parsertools.create_source_context($$,$1,$2);*! - - - ::= tkSquareOpen tkSquareClose !*3pascal_set_constant<$2 as expression_list> - parsertools.create_source_context($$,$1,$3);*! - - - ::= tkPlus - | tkMinus - - - ::= - | !*if ($2 is dereference) { - ((dereference)$2).dereferencing_value=(addressed_value)$1; - parsertools.create_source_context($2,$1,$2); - } - if ($2 is dot_node) { - ((dot_node)$2).left=(addressed_value)$1; - parsertools.create_source_context($2,$1,((dot_node)$2).right); - } - $$=$2; - *! - - - ::= tkPoint !*3dot_node*! - | tkDeref !*3roof_dereference<> parsertools.assign_source_context($$,$1);*! - | tkRoundOpen tkRoundClose !*3method_call<(expression_list)$2> parsertools.create_source_context($$,$1,$3);*! - | tkSquareOpen tkSquareClose !*3indexer<(expression_list)$2> parsertools.create_source_context($$,$1,$3);*! - - - ::= !*6expression_listexpression*! - | tkComma !*7expression_listexpression*! - - - ::= - | - - - ::= !*6expression_listexpression*! - | tkComma !*7expression_listexpression*! - - - ::= - | tkDotDot !*0diapason_expr<(expression)$1,(expression)$3>*! - - - ::= tkInteger - | tkHex - | tkFloat - - - ::= - | - | - - - ::= tkRoundOpen tkRoundClose !*3array_const<(expression_list)$2> - parsertools.create_source_context($$,$1,$3);*! - | tkRoundOpen tkRoundClose !*$$=$2;*! - | tkRoundOpen tkRoundClose !*$$=$2;*! - - - ::= - | tkComma !*3expression_list<> - $$.expressions.Add((expression)$1); - $$.expressions.Add((expression)$3); - parsertools.create_source_context($$,$1,$3);*! - | tkComma !*1expression_list<>$1; - parsertools.create_source_context($$,$$,$3); - $$.expressions.Add((expression)$3);*! - - ::= tkRoundOpen tkRoundClose !*$$=$2;*! - - - ::= - | tkSemiColon !*$$=$1;*! - - ::= !*6record_constrecord_const_definition*! - | tkSemiColon !*7record_constrecord_const_definition*! - - - ::= tkColon !*0record_const_definition<(ident)$1,(expression)$3>*! - - - ::= - - - ::= tkEqual tkSemiColon !*0type_declaration<(ident)$1,(type_definition)$3>*! -! | - - - ::= - | tkType !*parsertools.create_source_context($2,$1,$2);$$=$2;*! - | - - - ::= - | - | - | - | - | - - - ::= !*0template_type_reference<(named_type_reference)$1,(template_param_list)$2>*! - - - ::= tkLower tkGreater !*parsertools.create_source_context($2,$1,$3);$$=$2;*! - - - ::= !*6template_param_listtype_definition*! - | tkComma !*7template_param_listtype_definition*! - - - ::= - | - - - ::= - | tkDotDot !*0diapason<(expression)$1,(expression)$3>*! - | tkRoundOpen tkRoundClose !*3enum_type_definition<(enumerator_list)$2> parsertools.create_source_context($$,$1,$3);*! - - - - ::= - | !*0bin_expr<$1 as expression,$3 as expression,((op_type_node)$2).type>*! - - - ::= - | !*0bin_expr<$1 as expression,$3 as expression,((op_type_node)$2).type>*! - - - ::= !* if(((named_type_reference)$1).names.Count>0) - $$=((named_type_reference)$1).names[0]; - else - $$=null; - *! - | - | !*0un_expr<(expression)$2,((op_type_node)$1).type>*! - | -! | tkRoundOpen tkRoundClose - | tkRoundOpen tkRoundClose !*3method_call<(expression_list)$3> - $$.dereferencing_value=(addressed_value)$1; - parsertools.create_source_context($$,$1,$4); - *! - | tkRoundOpen tkRoundClose !* $$=$2;*! - - - ::= - | tkPoint !*0dot_node<(ident)$1,(ident)$3>*! - - - ::= !*6named_type_referenceident*! - | tkPoint !*7named_type_referenceident*! -! ::= !* {if ($1 is known_type_definition) return $1; -! named_type_reference ntr=new named_type_reference(null,(ident)$1); -! parsertools.create_source_context(ntr,$1,$1); -! return ntr;} -! *! -! | tkPoint !* {if ($3 is known_type_definition) {((known_type_definition)$3).unit_name=(ident)$1;return $3;} -! named_type_reference ntr=new named_type_reference((ident)$1,(ident)$3); -! parsertools.create_source_context(ntr,$1,$3); -! return ntr;} -! *! - - - ::= tkComma !*3enumerator_list<> - $$.enumerators.Add((enumerator)$1); - $$.enumerators.Add((enumerator)$3); - parsertools.create_source_context($$,$1,$3); - *! - | tkComma !*1enumerator_list<>$1; - $$.enumerators.Add((enumerator)$3); - parsertools.create_source_context($$,$$,$3); - *! - - ::= !*0enumerator<$1 as ident,null>*! - - - ::= tkDeref !*3ref_type<(type_definition)$2> parsertools.create_source_context($$,$1,$2);*! - - - ::= - | tkPacked - - - ::= - | -! | - | - | - - - ::= tkArray tkSquareOpen tkSquareClose tkOf !*3array_type<(indexers_types)$3,(type_definition)$6> - parsertools.create_source_context($3,$2,$4); - parsertools.create_source_context($$,$1,$6); - *! - | - - - ::= tkArray tkOf !*3array_type - parsertools.create_source_context($$,$1,$3); - *! - - - ::= !*3indexers_types<> - $$.indexers.Add((type_definition)$1); - *! - | tkComma !*1indexers_types<>$1; - $$.indexers.Add((type_definition)$3); - *! - - - ::= tkRecord tkEnd !*3record_type<(record_type_parts)$2,null> parsertools.create_source_context($$,$1,$3);*! - | tkRecord tkEnd !*3record_type parsertools.create_source_context($$,$1,$2);*! - - - ::= !*3record_type_parts<(var_def_list)$1,null> parsertools.create_source_context($$,$1,$1);*! - | !*3record_type_parts parsertools.create_source_context($$,$1,$1);*! - | tkSemiColon !*0record_type_parts<(var_def_list)$1,(variant_record_type)$3>*! - - - ::= - | tkSemiColon !*$$=$1;*! - - - ::= !*6var_def_listvar_def_statement*! - | tkSemiColon !*7var_def_listvar_def_statement*! - - - ::= tkColon !*3var_def_statement<(ident_list)$1,(type_definition)$3,null,definition_attribute.None,false> - parsertools.create_source_context($$,$1,$3); - *! - - ::= !*6ident_listident*! - | tkComma !*7ident_listident*! - - - ::= - - - ::= tkCase tkOf !*2variant_record_type<> $$=(variant_record_type)$2; - $$.vars=$4 as variant_types; - parsertools.create_source_context($$,$1,parsertools.sc_not_null($4,$3)); - *! - - - ::= !*3variant_record_type<(ident)$1,null,null>*! - | tkColon !*3variant_record_type<(ident)$1,(type_definition)$3,null>*! - - - ::= - - - ::= - - - ::= - | tkSemiColon !*$$=$1;*! - - - ::= !*6variant_typesvariant_type*! - | tkSemiColon !*7variant_typesvariant_type*! - - ::= tkColon tkRoundOpen tkRoundClose !*3variant_type<(expression_list)$1,(record_type_parts)$4> - parsertools.create_source_context($$,$1,$5); - *! - - - ::= - | - - - ::= -! ::= -! | tkComma - - - ::= !*6expression_listexpression*! - | tkComma !*7expression_listexpression*! - - - ::= tkSet tkOf !*3set_type_definition<(type_definition)$3> - parsertools.create_source_context($$,$1,$3);*! - - - ::= tkFile tkOf !*3file_type<(type_definition)$3> parsertools.create_source_context($$,$1,$3);*! - | tkFile !*3file_type<> parsertools.assign_source_context($$,$1);*! - - - ::= tkIdentifier tkSquareOpen tkSquareClose !*3string_num_definition<(expression)$3,(ident)$1> - parsertools.create_source_context($$,$1,$4);*! - - - ::= -! | - - - ::= - | tkOf !* if (($3 as ident).name.ToLower()=="object") - ((procedure_header)$1).of_object=true; - else - errors.Add(new Errors.unexpected_ident(current_file_name,(ident)$3,"object",((syntax_tree_node)$3).source_context,(syntax_tree_node)$1)); - $$=$1;*! - - - ::= tkProcedure !*3procedure_header<(formal_parametres)$2,null,null,false,false,null,null> - object rt=$1; - if ($2!=null) rt=$2; - parsertools.create_source_context($$,$1,rt); - if($3!=null) - ($3 as SyntaxError).bad_node=$$; - *! - | tkFunction tkColon !*3function_header<> - if ($2!=null) - $$.parametres=(formal_parametres)$2; - if ($4!=null) - $$.return_type=(type_definition)$4; - $$.of_object=false; - $$.class_keyword=false; - parsertools.create_source_context($$,$1,$4); - *! - - - ::= tkColon !* Errors.unexpected_return_value er=new Errors.unexpected_return_value(current_file_name,((syntax_tree_node)$2).source_context,null); errors.Add(er);$$=er;*! - | - - - ::= -! | - -! -! ::= tkObject tkEnd - - - ::= - | tkPrivate - - - ::= - | - | - | - - - ::= tkRoundOpen tkRoundClose - - - ::= - - - ::= - | - - - ::= tkColon tkSemiColon - - - ::= - | tkComma - - - ::= - - - ::= - | - - - ::= - - - ::= - | - | - | - - - ::= tkConstructor - - - ::= tkDestructor - - - ::= -! | - -! -! ::= tkClass tkOf - -! -! ::= - - - ::= !*3class_definition<$4 as named_type_reference_list,$6 as class_body,class_keyword.Class,$3 as ident_list,$5 as where_definition_list, class_attribute.None> - string kw=($2 as token_info).text.ToLower(); - if($1!=null) - $$.attribute=(class_attribute)(($1 as token_taginfo).tag); - if (kw=="record") - $$.keyword=class_keyword.Record; - else - if (kw=="interface") - $$.keyword=class_keyword.Interface; - else - if (kw=="i<>") - $$.keyword=class_keyword.TemplateInterface; - else - if (kw=="r<>") - $$.keyword=class_keyword.TemplateRecord; - else - if (kw=="c<>") - $$.keyword=class_keyword.TemplateClass; - if ($$.body!=null && $$.body.class_def_blocks!=null && - $$.body.class_def_blocks.Count>0 && $$.body.class_def_blocks[0].access_mod==null) - { - if($$.keyword==class_keyword.Class) - $$.body.class_def_blocks[0].access_mod = new access_modifer_node(access_modifer.internal_modifer); - else - $$.body.class_def_blocks[0].access_mod = new access_modifer_node(access_modifer.none); - } - parsertools.create_source_context($$,parsertools.sc_not_null($1,$2),parsertools.sc_not_null($6,$5,$4,$3,$2,$1));*! - - - - ::= tkEnd !*3class_definition<$3 as named_type_reference_list,$5 as class_body,class_keyword.Record,$2 as ident_list,$4 as where_definition_list, class_attribute.None> - if ($$.body!=null && $$.body.class_def_blocks!=null && - $$.body.class_def_blocks.Count>0 && $$.body.class_def_blocks[0].access_mod==null) - { - $$.body.class_def_blocks[0].access_mod = new access_modifer_node(access_modifer.public_modifer); - } - parsertools.create_source_context($$,$1,$6);*! - - - ::= tkFinal - | - - - ::= tkClass - | tkInterface - | tkTemplate !*1token_info<>$1;$$.text="c<>";*! - | tkTemplate tkClass !*1token_info<>$1;$$.text="c<>";parsertools.create_source_context($$,$1,$2);*! - | tkTemplate tkRecord !*1token_info<>$1;$$.text="r<>";parsertools.create_source_context($$,$1,$2);*! - | tkTemplate tkInterface !*1token_info<>$1;$$.text="i<>";parsertools.create_source_context($$,$1,$2);*! - - - ::= tkRecord - - - ::= - | tkEnd !*parsertools.create_source_context($1,parsertools.sc_not_null($1,$2),$2);$$=$1;*! - - - ::= - | tkRoundOpen tkRoundClose !*$$=$2;*! - - - ::= !*6named_type_reference_listnamed_type_reference*! - | tkComma !*7named_type_reference_listnamed_type_reference*! - - - ::= - | - - - - ::= - | tkLower tkGreater !*$$=$2;*! - - - ::= - | - - - ::= !*3where_definition_list<> - parsertools.create_source_context($$,$1,$1); - $$.defs.Add((where_definition)$1);*! - | !*1where_definition_list<>$1; - parsertools.create_source_context($$,$$,$2); - $$.defs.Add((where_definition)$2);*! - - - ::= tkWhere tkColon tkSemiColon !*3where_definition<(ident_list)$2,(type_definition_list)$4> - parsertools.create_source_context($$,$1,$5);*! - - - ::= !*6type_definition_listtype_definition*! - | tkComma !*7type_definition_listtype_definition*! - - - ::= - | tkClass !*3declaration_specificator - parsertools.assign_source_context($$,$1);*! - | tkRecord !*3declaration_specificator - parsertools.assign_source_context($$,$1);*! - | tkConstructor !*3declaration_specificator - parsertools.assign_source_context($$,$1);*! - - - ::= !*3class_body<> - if ($1!=null) { - access_modifer_node acn=new access_modifer_node(access_modifer.public_modifer); - ((class_members)$1).access_mod = acn; - $$.class_def_blocks.Add((class_members)$1); - parsertools.assign_source_context($$,$1); - } - *! - - - ::= !*3class_body<> - if ($1!=null) { - $$.class_def_blocks.Add((class_members)$1); - parsertools.assign_source_context($$,$1); - } - *! - | !*1class_body<>$1; - class_members cl=(class_members)$3; - if (cl==null) - { - cl=new class_members(); - parsertools.create_source_context(cl,$2,$2); - } - cl.access_mod=(access_modifer_node)$2; - $$.class_def_blocks.Add(cl); - parsertools.create_source_context($$,parsertools.sc_not_null($1,$2),parsertools.sc_not_null(cl,$2)); - *! - - - ::= tkInternal !*3access_modifer_node parsertools.assign_source_context($$,$1);*! - | tkPublic !*3access_modifer_node parsertools.assign_source_context($$,$1);*! - | tkProtected !*3access_modifer_node parsertools.assign_source_context($$,$1);*! - | tkPrivate !*3access_modifer_node parsertools.assign_source_context($$,$1);*! - - - - - ::= !*6named_type_reference_listnamed_type_reference*! - | tkComma !*7named_type_reference_listnamed_type_reference*! -! ::= -! | tkComma - - - ::= !*6ident_listident*! - | tkComma !*7ident_listident*! - - - ::= - | !*$$=$2;*! - | !*$$=$2;*! - | tkSemiColon !*2class_members<> $$=(class_members)$2; - for (int i=0;i<((class_members)$4).members.Count;i++) - $$.members.Add(((class_members)$4).members[i]); - parsertools.create_source_context($$,$2,$4); - *! - - ::= - | tkSemiColon - - - ::= -! | tkSquareOpen tkSquareClose - - - ::= !*3class_members<> - $$.members.Add((declaration)$1); - parsertools.assign_source_context($$,$1); - *! - | tkSemiColon !*1class_members<>$1; - if($3 is declaration) - $$.members.Add((declaration)$3); - else - ($$.members[$$.members.Count-1] as var_def_statement).var_attr=definition_attribute.Static; - parsertools.create_source_context($$,$1,$3); - *! - - - ::= !*3class_members<> - $$.members.Add((declaration)$1); - parsertools.assign_source_context($$,$1); - *! - | !*3class_members<> - $$.members.Add((declaration)$1); - parsertools.assign_source_context($$,$1); - *! - | !*1class_members<>$1; - $$.members.Add((declaration)$2); - parsertools.create_source_context($$,$1,$2); - *! - | !*1class_members<>$1; - $$.members.Add((declaration)$2); - parsertools.create_source_context($$,$1,$2); - *! - - - ::= tkConst !* parsertools.create_source_context($2,$1,$2); $$=$2;*! - | - - - ::= - | - - - ::= - | tkEvent tkColon !*3var_def_statement<(ident_list)$2,(type_definition)$4,null,definition_attribute.None,true> - parsertools.create_source_context($$,$1,$4); - *! -! ::= tkColon !*3var_def_statement<(ident_list)$1,(type_definition)$3,$4 as expression,definition_attribute.None,false> -! parsertools.create_source_context($$,$1,parsertools.sc_not_null($4,$3)); -! *! - - - ::= tkStatic - -! -! ::= -! | tkEqual !*$$=$2;*! - -! -! ::= !*6ident_listident*! -! | tkComma !*7ident_listident*! - -! -! ::= - - - ::= - | - - - ::= - | - | - | - - - ::= tkClass !* ((procedure_header)$2).class_keyword=true;$$=$2;*! - | tkClass !* ((procedure_header)$2).class_keyword=true;$$=$2;*! - | - | - | - | - - - ::= - | - - - ::= tkConstructor !*3constructor<> - object rt=$2; - $$.name=$2 as method_name; - if ($3!=null) { - rt=$3; - $$.parametres=(formal_parametres)$3; - } - if ($4!=null) { - rt=$4; - if (((procedure_attributes_list)$4).proc_attributes.Count>0) - $$.proc_attributes=(procedure_attributes_list)$4; - } - parsertools.create_source_context($$,$1,rt); - *! - - - ::= tkDestructor !*3destructor<> - object rt=$2; - $$.name=$2 as method_name; - if ($3!=null) { - rt=$3; - $$.parametres=(formal_parametres)$3; - } - if ($4!=null) { - rt=$4; - if (((procedure_attributes_list)$4).proc_attributes.Count>0) - $$.proc_attributes=(procedure_attributes_list)$4; - } - parsertools.create_source_context($$,$1,rt); - *! - - - ::= !*0method_name*! - | !*0method_name*! - | tkPoint !*{ - method_name mn=(method_name)$1; - mn.class_name=mn.meth_name; - mn.meth_name=(ident)$3; - parsertools.create_source_context($1,$1,$3); - $$=$1; - }*! - | tkPoint !*{ - method_name mn=(method_name)$1; - mn.class_name=mn.meth_name; - mn.meth_name=(ident)$3; - parsertools.create_source_context($1,$1,$3); - $$=$1; - }*! - - - ::= tkProperty tkSemiColon !*3simple_property<> - $$.property_name=((method_name)$2).meth_name; - if ($3!=null){ - $$.parameter_list=((property_interface)$3).parameter_list; - $$.property_type=((property_interface)$3).property_type; - $$.index_expression=((property_interface)$3).index_expression; - } - if ($4!=null) $$.accessors=(property_accessors)$4; - if ($6!=null) $$.array_default=(property_array_default)$6; - parsertools.create_source_context($$,$1,parsertools.sc_not_null($6,$5,$4,$3,$2,$1)); - *! - - - ::= - | tkDefault tkSemiColon !*3property_array_default<> parsertools.create_source_context($$,$1,$2);*! - - - ::= - | tkColon !*3property_interface<> - $$.parameter_list=(property_parameter_list)$1; - $$.property_type=(type_definition)$3; - $$.index_expression=(expression)$4; - parsertools.create_source_context($$,parsertools.sc_not_null($1,$2,$3,$4),parsertools.sc_not_null($4,$3,$2,$1)); - *! - - - ::= - | tkIndex !*$$=$2;*! - - - ::= - | tkSquareOpen tkSquareClose!*$$=$2;*! - - - ::= !*6property_parameter_listproperty_parameter*! - | tkSemiColon !*7property_parameter_listproperty_parameter*! - - - ::= tkColon !*0property_parameter<(ident_list)$1,(type_definition)$3>*! - | tkConst tkColon - | tkVar tkColon - | tkOut tkColon - - - ::= -! ::= -! | tkComma - -! -! ::= - - - - ::= - | - - - ::= - | tkReadOnly - | tkWriteOnly -! | tkDispid - | tkDefault -! | tkNodefault -! | tkStored -! | tkImplements -! | tkRead ??? -! | tkWrite ??? - | tkRead !*2property_accessors<> - property_accessors _pa=$3 as property_accessors; - if (_pa==null) { - _pa=new property_accessors();parsertools.create_source_context(_pa,$1,parsertools.sc_not_null($2,$1)); - } - $$=_pa; - if($2!=null && ((ident)$2).name.ToLower()=="write") - { - $$.read_accessor=new read_accessor_name(null); - $$.write_accessor=new write_accessor_name(null); - parsertools.create_source_context($$.read_accessor,$1,$1); - parsertools.create_source_context($$.write_accessor,$2,$2); - parsertools.create_source_context($$,$1,$2); - } - else - { - $$.read_accessor=new read_accessor_name((ident)$2); - parsertools.create_source_context($$.read_accessor,$1,parsertools.sc_not_null($2,$1)); - parsertools.create_source_context($$,$1,parsertools.sc_not_null($3,$2,$1)); - } - *! - | tkWrite !*2property_accessors<> - property_accessors _pa=$3 as property_accessors; - if (_pa==null) { - _pa=new property_accessors();parsertools.create_source_context(_pa,$1,parsertools.sc_not_null($2,$1)); - } - $$=_pa; - $$.write_accessor=new write_accessor_name((ident)$2); - parsertools.create_source_context($$.write_accessor,$1,parsertools.sc_not_null($2,$1)); - parsertools.create_source_context($$,$1,_pa); - *! - - - ::= tkSemiColon !*$$=$1;*! - - - ::= - | - | tkColon tkAssign !*0var_def_statement<(ident_list)$1,(type_definition)$3,(expression)$5,definition_attribute.None,false>*! - - - ::= -! ::= -! | -! | tkColon tkAssign !*0var_def_statement<(ident_list)$1,(type_definition)$3,(expression)$5,definition_attribute.None,false>*! - - - ::= tkAssign !*0var_def_statement<(ident_list)$1,null,(expression)$3,definition_attribute.None,false>*! - - - ::= tkColon !*0var_def_statement<(ident_list)$1,(type_definition)$3,null,definition_attribute.None,false>*! - - - ::= - - - ::= - | - - - ::= !*0ident_list<> - $$.idents.Add((ident)$1);*! - | tkComma !*1ident_list<>$1; - $$.idents.Add((ident)$3); - parsertools.create_source_context($$,$$,$3);*! - - - ::= - -! -! ::= -! | tkAbsolute tkInteger tkColon tkInteger -! | tkAbsolute tkHex tkColon tkHex -! | tkAbsolute - - - ::= - - - ::= !*9procedure_definition<(procedure_header)$1,null>*! - - - ::= !*9procedure_definition<(procedure_header)$1,null>*! - - - ::= !*9procedure_definition<(procedure_header)$1,null>*! - - - ::= !*9procedure_definition<(procedure_header)$1,null>*! - - - ::= - | - | - - - ::= - | tkClass !* (($2 as procedure_definition).proc_header as procedure_header).class_keyword=true;$$=$2;*! - - ::= !*9procedure_definition<(procedure_header)$1,null>*! - - - ::= - | tkClass !* (($2 as procedure_definition).proc_header as procedure_header).class_keyword=true;$$=$2;*! - - ::= !*9procedure_definition<(procedure_header)$1,null>*! - - - ::= - | tkClass !* (($2 as procedure_definition).proc_header as procedure_header).class_keyword=true;$$=$2;*! - - ::= !*9procedure_definition<(function_header)$1,null>*! - - - ::= - | tkClass !* (($2 as procedure_definition).proc_header as procedure_header).class_keyword=true;$$=$2;*! - - - ::= !*9procedure_definition<(function_header)$1,null>*! - - - - ::= tkProcedure !*3procedure_header - object rt=$2; - if ($4!=null) { - rt=$4; - $$.parametres=(formal_parametres)$4; - } - if($5!=null) - ($5 as SyntaxError).bad_node=$$; - if ($6!=null) { - rt=$6; - if (((procedure_attributes_list)$6).proc_attributes.Count>0) - $$.proc_attributes=(procedure_attributes_list)$6; - } - if ($7!=null) { - rt=$7; - $$.where_defs = (where_definition_list)$7; - } - parsertools.create_source_context($$,$1,rt); - *! -! | tkProcedure tkEqual tkSemiColon -! | tkProcedure - -! -! ::= !*0method_name*! -! | !*0method_name*! -! | tkPoint !*{ -! method_name mn=(method_name)$1; -! mn.class_name=mn.meth_name; -! mn.meth_name=(ident)$3; -! parsertools.create_source_context($1,$1,$3); -! $$=$1; -! }*! -! | tkPoint !*{ -! method_name mn=(method_name)$1; -! mn.class_name=mn.meth_name; -! mn.meth_name=(ident)$3; -! parsertools.create_source_context($1,$1,$3); -! $$=$1; -! }*! -! - - - ::= - - - ::= !*0method_name*! - | tkPoint !*0method_name<(ident)$1,(ident)$3,null>*! - - - ::= - | - | - - - ::= - | - - - ::= tkFunction tkColon !*3function_header<> - object rt=$2; - $$.name=(method_name)$2; - $$.template_args=(ident_list)$3; - if ($4!=null) { - rt=$4; - $$.parametres=(formal_parametres)$4; - } - if ($6!=null) { - rt=$6; - $$.return_type=(type_definition)$6; - } - if ($7!=null) { - rt=$7; - if (((procedure_attributes_list)$7).proc_attributes.Count>0) - $$.proc_attributes=(procedure_attributes_list)$7; - } - if ($8!=null) { - rt=$8; - $$.where_defs = (where_definition_list)$8; - } - $$.of_object=false; - $$.class_keyword=false; - parsertools.create_source_context($$,$1,rt); - *! - | tkFunction !*3function_header<> - object rt=$2; - $$.name=(method_name)$2; - if ($3!=null) { - rt=$3; - if (((procedure_attributes_list)$3).proc_attributes.Count>0) - $$.proc_attributes=(procedure_attributes_list)$3; - } - $$.of_object=false; - $$.class_keyword=false; - parsertools.create_source_context($$,$1,rt); - *! -! | tkFunction tkEqual tkSemiColon -! | tkFunction - - - - ::= -! | tkSemiColon - - - ::= -! | tkSemiColon - - - ::= - | - | -! | - | tkForward tkSemiColon !*$$=$1;*! - - - ::= - | - - - ::= - | tkSemiColon !*$$=$1;*! -! ::= tkExternal -! | tkExternal tkSemiColon -! | tkExternal tkSemiColon -! -! -! ::= -! | tkName -! | tkIndex -! -! -! ::= tkInteger -! | tkMinus tkInteger - - - ::= - | - - - ::= tkExternal tkName !*3external_directive<(expression)$2,(expression)$4> - parsertools.create_source_context($$,$1,$4);*! - - - - ::= tkAsmBody tkSemiColon - - - ::= tkBF tkEnd tkSemiColon !*3block - parsertools.create_source_context($$,$1,$4); - parsertools.create_source_context($2,$1,$3); - parsertools.create_source_context($$.defs,$1,$1); - //$$.defs.defs.Add() - *! - - ::= - - ::= - | !*3statement_list<> $$.subnodes.Add(new empty_statement());*! - - ::= !*3statement_list<> - $$.subnodes.Add((statement)$1); - *! - | !*1statement_list<>$1; - $$.subnodes.Add((statement)$2); - *! - - ::= tkGreater !*4IncCaret<>*! ! > Increment p - | tkLower !*4DecCaret<>*! ! < Decrement p - | tkPlus !*4IncCaretValue<>*! ! + Increment *p - | tkMinus !*4DecCaretValue<>*! ! - Decrement *p - | tkPoint !*4WriteCaretValue<>*! ! . Output *p - | tkComma !*4ReadCaretValue<>*! ! , Input *p - | tkSquareOpen tkSquareClose !*5CaretValueNotNull<>*! ![ ] - | tkDotDot !*4WriteCaretValue2<>*! ! .. Output *p Output *p - - - - ::= tkSemiColon !*3block<(declarations)$1,(statement_list)$2> - parsertools.create_source_context($$,parsertools.sc_not_null($1,$2),$3);*! - - - ::= tkSemiColon !*3block<(declarations)$1,(statement_list)$2> - parsertools.create_source_context($$,parsertools.sc_not_null($1,$2),$3);*! - - - ::= - | tkRoundOpen tkRoundClose !* if($2!=null) parsertools.create_source_context($2,$1,$3); - $$=$2;*! - - - ::= - | !*3formal_parametres<> - $$.params_list.Add((typed_parametres)$1); - *! - | tkSemiColon !*1formal_parametres<>$1; - $$.params_list.Add((typed_parametres)$3); - *! - - - ::= tkColon !*0typed_parametres<(ident_list)$1,(type_definition)$3,parametr_kind.none,null>*! - | !*0typed_parametres<(ident_list)$1,null,parametr_kind.none,null>*! - | tkVar tkColon !*3typed_parametres<(ident_list)$2,(type_definition)$4,parametr_kind.var_parametr,null> parsertools.create_source_context($$,$1,$4);*! - | tkVar !*3typed_parametres<(ident_list)$2,null,parametr_kind.var_parametr,null> parsertools.create_source_context($$,$1,$2);*! - | tkOut tkColon !*3typed_parametres<(ident_list)$2,(type_definition)$4,parametr_kind.out_parametr,null> parsertools.create_source_context($$,$1,$4);*! - | tkOut !*3typed_parametres<(ident_list)$2,null,parametr_kind.out_parametr,null> parsertools.create_source_context($$,$1,$2);*! - | tkConst tkColon !*3typed_parametres<(ident_list)$2,(type_definition)$4,parametr_kind.const_parametr,null> parsertools.create_source_context($$,$1,$4);*! - | tkConst !*3typed_parametres<(ident_list)$2,null,parametr_kind.const_parametr,null> parsertools.create_source_context($$,$1,$2);*! - | tkParams tkColon !*3typed_parametres<(ident_list)$2,(type_definition)$4,parametr_kind.params_parametr,null> parsertools.create_source_context($$,$1,$4);*! - | tkParams !*3typed_parametres<(ident_list)$2,null,parametr_kind.params_parametr,null> parsertools.create_source_context($$,$1,$2);*! - | tkColon tkAssign !*0typed_parametres<(ident_list)$1,(type_definition)$3,parametr_kind.none,(expression)$5>*! - | tkVar tkColon tkAssign !*3typed_parametres<(ident_list)$2,(type_definition)$4,parametr_kind.var_parametr,(expression)$6> parsertools.create_source_context($$,$1,$4);*! - | tkOut tkColon tkAssign !*3typed_parametres<(ident_list)$2,(type_definition)$4,parametr_kind.out_parametr,(expression)$6> parsertools.create_source_context($$,$1,$4);*! - | tkConst tkColon tkAssign !*3typed_parametres<(ident_list)$2,(type_definition)$4,parametr_kind.const_parametr,(expression)$6> parsertools.create_source_context($$,$1,$4);*! - - - ::= !*6ident_listident*! - | tkComma !*7ident_listident*! - - - ::= - - - ::= -! ::= !* {if ($1 is known_type_definition) return $1; -! named_type_reference ntr=new named_type_reference(null,(ident)$1); -! parsertools.create_source_context(ntr,$1,$1); -! return ntr;} -! *! -! | tkPoint !* {if ($3 is known_type_definition) {((known_type_definition)$3).unit_name=(ident)$1;return $3;} -! named_type_reference ntr=new named_type_reference((ident)$1,(ident)$3); -! parsertools.create_source_context(ntr,$1,$3); -! return ntr;} -! *! - - - ::= - | tkArray tkOf tkConst !*3array_of_const_type_definition<> parsertools.create_source_context($$,$1,$3);*! - -! ::= -! | tkEqual -! | tkArray tkOf !*3array_of_named_type_definition<(named_type_reference)$3> parsertools.create_source_context($$,$1,$3);*! - - - ::= - | tkColon !*3labeled_statement<(ident)$1,(statement)$3> parsertools.create_source_context($$,$1,parsertools.sc_not_null($3,$2));*! - - - ::= !*3empty_statement<>*! - | - | - | - | - | - | - | - | - | - | - | -! | - | - | - | - | - | - | - | - - - ::= tkVar !*3var_statement<$2 as var_def_statement> parsertools.create_source_context($$,$1,$2);*! - - - - ::= !*0assign<$1 as addressed_value,$3 as expression,((op_type_node)$2).type>*! -! ::= tkAssign !*0assign -! if ($1 is addressed_value_funcname) -! $$.to=(addressed_value)$1; -! else -! errors.Add(new Errors.bad_leftside_assigment(current_file_name,((syntax_tree_node)$1).source_context,$$)); -! *! - - - ::= !*0procedure_call<$1 as addressed_value>*! -! ::= !*0procedure_call<> -! if ($1 is addressed_value_funcname) -! $$.func_name=(addressed_value)$1; -! else -! errors.Add(new Errors.statement_expected(current_file_name,((syntax_tree_node)$1).source_context,$$)); -! *! - - - ::= tkGoto !*0goto_statement<(ident)$2>*! - - - ::= tkBegin tkEnd !* - parsertools.create_source_context($2,$1,$3); - ((statement_list)$2).left_logical_bracket=(syntax_tree_node)$1; - ((statement_list)$2).right_logical_bracket=(syntax_tree_node)$3; - $$=$2; - *! - | tkILCode - - - ::= !*3statement_list<> - $$.subnodes.Add((statement)$1); - parsertools.assign_source_context($$,$1); - *! - | tkSemiColon !*2statement_list<> $$=(statement_list)$1; - $$.subnodes.Add((statement)$3); - parsertools.create_source_context($$,$$,parsertools.sc_not_null($3,$2)); - *! - - - ::= tkIf !*((if_node)$3).condition=(expression)$2; - parsertools.create_source_context($3,$1,$3); - $$=$3; - *! - - - ::= tkThen !*3if_node - parsertools.create_source_context($$,$1,parsertools.sc_not_null($2,$1)); - *! - | tkThen tkElse !*3if_node - parsertools.create_source_context($$,$3,parsertools.sc_not_null($4,$3)); - *! - - - ::= - - - ::= - - - ::= tkCase tkOf tkEnd !*3case_node<(expression)$2,$4 as case_variants,$5 as statement> - parsertools.create_source_context($$,$1,$6);*! - - - ::= !*3case_variants<> - if ($1 is case_variant) - { - $$.variants.Add((case_variant)$1); - parsertools.create_source_context($$,$1,$1); - }*! - | tkSemiColon !*1case_variants<>$1; - parsertools.create_source_context($$,parsertools.sc_not_null($1,$2),parsertools.sc_not_null($3,$2)); - if ($3 is case_variant) $$.variants.Add((case_variant)$3);*! - - - ::= !*3empty_statement<>*! - | tkColon !*3case_variant<(expression_list)$1,(statement)$3> - parsertools.create_source_context($$,$1,parsertools.sc_not_null($3,$2));*! - - - ::= !*6expression_listexpression*! - | tkComma !*7expression_listexpression*! - - - ::= -! ::= -! | tkDotDot - - - ::= - | tkElse !*$$=$2;*! - - - ::= tkRepeat tkUntil !*3repeat_node<(statement)$2,(expression)$4> - ((statement_list)$2).left_logical_bracket=(syntax_tree_node)$1; - ((statement_list)$2).right_logical_bracket=(syntax_tree_node)$3; - parsertools.create_source_context($2,$1,$3); - parsertools.create_source_context($$,$1,$4); - *! - - ::= tkWhile tkDo !*3while_node<(expression)$2,(statement)$4,WhileCycleType.While> - parsertools.create_source_context($$,$1,parsertools.sc_not_null($4,$3)); - *! - - ::= tkLock tkDo !*3lock_stmt<(expression)$2,(statement)$4> - parsertools.create_source_context($$,$1,parsertools.sc_not_null($4,$3)); - *! - - ::= tkForeach tkIn tkDo !*3foreach_stmt<(ident)$2,(type_definition)$3,(expression)$5,(statement)$7> - parsertools.create_source_context($$,$1,parsertools.sc_not_null($7,$6)); - *! - - - ::= tkColon !* $$=$2; *! - | - - - ::= tkFor tkDo !*3for_node<(ident)$3,(expression)$5,(expression)$7,(statement)$9,(for_cycle_type)$6,null,$4 as type_definition, $2!=null> - parsertools.create_source_context($$,$1,parsertools.sc_not_null($9,$8)); - *! - - ::= tkVar !*$$=true;*! - | - - - ::= tkAssign - | tkColon tkAssign !*$$=$2;*! - - - ::= tkTo !* $$=for_cycle_type.to; *! - | tkDownto !* $$=for_cycle_type.downto; *! - - - ::= tkWith tkDo !*3with_statement<(statement)$4,(expression_list)$2> - parsertools.create_source_context($$,$1,parsertools.sc_not_null($4,$3));*! - - - ::= tkInherited !*3inherited_message<> parsertools.assign_source_context($$,$1);*! - - - ::= tkTry !*3try_stmt<((statement_list)$2),(try_handler)$3> - ((statement_list)$2).left_logical_bracket=(syntax_tree_node)$1; - parsertools.create_source_context($$,$1,$3); - *! - - - ::= tkFinally tkEnd !*3try_handler_finally<(statement_list)$2> - ((statement_list)$2).left_logical_bracket=(syntax_tree_node)$1; - ((statement_list)$2).right_logical_bracket=(syntax_tree_node)$3; - parsertools.create_source_context($$,$1,$3);*! - | tkExcept tkEnd !*3try_handler_except<(exception_block)$2> parsertools.create_source_context($$,$1,$3);*! - - - ::= !*3exception_block - parsertools.create_source_context($$,$1,parsertools.sc_not_null($2,$1));*! - | tkSemiColon !*3exception_block - parsertools.create_source_context($$,$1,parsertools.sc_not_null($3,$2));*! - | !*3exception_block<(statement_list)$1,null,null> - if (((syntax_tree_node)$1).source_context!=null) parsertools.assign_source_context($$,$1);*! - -!!!!!SR??? -!!!!! ::= - - - ::= !*6exception_handler_listexception_handler*! - | tkSemiColon !*7exception_handler_listexception_handler*! - - - ::= - | tkElse !*$$=$2;*! - - - ::= tkOn tkDo !*3exception_handler<((exception_ident)$2).variable,((exception_ident)$2).type_name,(statement)$4> - parsertools.create_source_context($$,$1,parsertools.sc_not_null($3,$4));*! - - - ::= !*0exception_ident*! - | tkColon !*0exception_ident<(ident)$1,(named_type_reference)$3>*! - - - ::= - - - ::= - - - ::= tkRaise !*3raise_stmt<> parsertools.assign_source_context($$,$1);*! - | tkRaise !*3raise_stmt<(expression)$2,null> parsertools.create_source_context($$,$1,$2);*! - | tkRaise tkAt !*3raise_stmt<(expression)$2,(expression)$4> parsertools.create_source_context($$,$1,$4);*! - - - ::= tkAsmBody - - - ::= !*6expression_listexpression*! - | tkComma !*7expression_listexpression*! - - - ::= !*3expression_as_statement<(expression)$1> parsertools.create_source_context($$,$1,$1);*! - - - ::= - - - ::= - | - - - ::= - | - | - - - - ::= tkSizeOf tkRoundOpen tkRoundClose !*3sizeof_operator<(named_type_reference)$3,null> parsertools.create_source_context($$,$1,$4);*! - - - ::= tkTypeOf tkRoundOpen tkRoundClose !*3typeof_operator<(named_type_reference)$3> parsertools.create_source_context($$,$1,$4);*! - - - ::= tkQuestion tkColon !*3question_colon_expression<(expression)$1,(expression)$3,(expression)$5> parsertools.create_source_context($$,$1,$5);*! - - - ::= !* - { - named_type_reference ntr; - if($3!=null) - { - ntr=new template_type_reference((named_type_reference)$2,(template_param_list)$3); - parsertools.create_source_context(ntr,$2,$3); - } - else - ntr=(named_type_reference)$2; - new_expr newexpr=new new_expr(ntr,$4 as expression_list,false,null); - parsertools.create_source_context(newexpr,$1,parsertools.sc_not_null($4,$3,$2)); - if (($1 as ident).name.ToLower()!="new") - errors.Add(new Errors.PABCNETUnexpectedToken(current_file_name,";",((syntax_tree_node)$1).source_context,newexpr)); - $$=newexpr; - } - *! - | tkSquareOpen tkSquareClose !* - { - new_expr newexpr=new new_expr((type_definition)$2,$4 as expression_list,true,null); - parsertools.create_source_context(newexpr,$1,$5); - if (($1 as ident).name.ToLower()!="new") - errors.Add(new Errors.PABCNETUnexpectedToken(current_file_name,";",((syntax_tree_node)$1).source_context,newexpr)); - $$=newexpr; - } - *! - - - ::= - | - - - ::= - | - - - ::= - | tkRoundOpen tkRoundClose !*$$=$2;*! - - - - ::= - | !*0bin_expr<(expression)$1,(expression)$3,((op_type_node)$2).type>*! - - - ::= tkColon !*0format_expr<(expression)$1,(expression)$3,null>*! - | tkColon tkColon !*0format_expr<(expression)$1,(expression)$3,(expression)$5>*! - - - ::= tkEqual - | tkNotEqual - | tkLower - | tkGreater - | tkLowerEqual - | tkGreaterEqual - | tkIn - - - ::= - | !*0bin_expr<$1 as expression,$3 as expression,((op_type_node)$2).type>*! - - - ::= tkPlus - | tkMinus - | tkOr - | tkXor - - - ::= tkAs !* $$=op_typecast.as_op; *! - | tkIs !* $$=op_typecast.is_op; *! - - - ::= - | !*0bin_expr<$1 as expression,$3 as expression,((op_type_node)$2).type>*! - | !*0typecast_node<(addressed_value)$1,(type_definition)$3,(op_typecast)$2> - if (!($1 is addressed_value)) - errors.Add(new Errors.bad_operand_type(current_file_name,((syntax_tree_node)$1).source_context,$$)); - *! - - - ::= tkStar - | tkSlash - | tkDiv - | tkMod - | tkShl - | tkShr - | tkAnd -! | tkAs - - - ::= tkNil !*3nil_const<> parsertools.create_source_context($$,$1,$1);*! - | - | tkSquareOpen tkSquareClose !*3pascal_set_constant<$2 as expression_list> parsertools.create_source_context($$,$1,$3);*! - | tkNot !*0un_expr<$2 as expression,((op_type_node)$1).type>*! - | !*0un_expr<$2 as expression,((op_type_node)$1).type>*! - | tkDeref !*3roof_dereference<> - $$.dereferencing_value=(addressed_value)$2; - parsertools.create_source_context($$,$1,$2);*! - | - - - ::= - | - - - ::= !*((get_address)$1).address_of=(addressed_value)$2;parsertools.create_source_context(NodesStack.Peek(),NodesStack.Peek(),$2);$$=NodesStack.Pop();*! - | - - - - ::= tkAddressOf !*3get_address<> parsertools.assign_source_context($$,$1); NodesStack.Push($$);*! - | tkAddressOf !*3get_address<> ((get_address)$1).address_of=(addressed_value)$$;parsertools.create_source_context($$,$2,$2);*! - - - ::= -! | tkAmpersend !*0ident_with_templateparams<(ident)$1,(template_param_list)$3> *! - !SR! -! | !*((template_param_list)$2).dereferencing_value=(addressed_value)$1;parsertools.create_source_context($2,$1,$2);$$=$2;*! - | - | tkInherited !*3inherited_ident<> $$.name=((ident)$2).name; parsertools.create_source_context($$,$1,$2);*! - | tkRoundOpen tkRoundClose !*parsertools.create_source_context($2,$1,$3);$$=$2;*! - | - | - | tkRoundOpen tkRoundClose - | tkPoint !*0dot_node<(addressed_value)$1,(addressed_value)$3>*! - | !* - if ($2 is dot_node) - { - ((dot_node)$2).left=(addressed_value)$1; - parsertools.create_source_context($2,$1,((dot_node)$2).right); - } - else - if ($2 is template_param_list) - { - ((dot_node)(((template_param_list)$2).dereferencing_value)).left=(addressed_value)$1; - parsertools.create_source_context($2,$1,$2); - parsertools.create_source_context(((template_param_list)$2).dereferencing_value,$1,((template_param_list)$2).dereferencing_value); - } - else - if ($2 is dereference) - { - ((dereference)$2).dereferencing_value=(addressed_value)$1; - parsertools.create_source_context($2,$1,$2); - } - else - if ($2 is ident_with_templateparams) - { - ((ident_with_templateparams)$2).name=(addressed_value_funcname)$1; - } - $$=$2; - *! - - - ::= - | - - - ::= tkSquareOpen tkSquareClose !*3indexer<(expression_list)$2> parsertools.create_source_context($$,$1,$3);*! - | tkSquareOpen tkSquareClose - | tkRoundOpen tkRoundClose !*3method_call<$2 as expression_list> parsertools.create_source_context($$,$1,$3);*! - | tkPoint !*3dot_node parsertools.create_source_context($$,$1,$2);*! - | tkDeref !*3roof_dereference<> parsertools.assign_source_context($$,$1);*! - | tkAmpersend !*3ident_with_templateparams parsertools.create_source_context($$,$1,$2);*! - !SR! -! | !*((template_param_list)$2).dereferencing_value=(addressed_value)$1;$$=$2;*! - -! -! ::= -! | -! - - - ::= tkRoundOpen tkRoundClose !*3method_call<(expression_list)$2> parsertools.create_source_context($$,$1,$3);*! - | tkRoundOpen tkRoundClose !*3method_call<> parsertools.create_source_context($$,$1,$2);*! - - - - ::= - | - - - ::= !*6expression_listexpression*! - | tkComma !*7expression_listexpression*! - - - ::= - | tkDotDot !*0diapason_expr<(expression)$1,(expression)$3>*! - -! -! ::= tkInline tkRoundOpen tkRoundClose - -! -! ::= -! | tkSlash - -! -! ::= tkLower -! | tkGreater -! | - -! -! ::= -! | -! | tkHex - -! -! ::= - - - ::= tkStringLiteral - | tkAsciiChar - - - ::= !* literal_const_line lcl=(literal_const_line)$1; - if (lcl.literals.Count==1) $$=lcl.literals[0]; - $$=lcl; - *! - - ::= !*0literal_const_line<> - $$.literals.Add((literal)$1); - *! - | !*1literal_const_line<>$1; - $$.literals.Add((literal)$2); - parsertools.create_source_context($$,$$,$2); - *! - - - ::= tkOperator !*3operator_name_ident<((op_type_node)$2).type> - $$.name=((op_type_node)$2).text; - parsertools.create_source_context($$,$1,$2);*! - - ::= tkSemiColon !*3procedure_attributes_list<> parsertools.AddModifier($$,proc_attribute.attr_overload); parsertools.create_source_context($$,$1,$1); *! - | tkSemiColon tkSemiColon !* parsertools.AddModifier((procedure_attributes_list)$2,proc_attribute.attr_overload); $$=$2; *! - - - ::= !*6procedure_attributes_listprocedure_attribute*! - | tkSemiColon !*7procedure_attributes_listprocedure_attribute*! - - - ::= tkInteger - | tkInteger - | tkHex - | tkHex - | - | - - - - ::= tkIdentifier - | - | - | - | - | - | - | - - - ::= - | !*3ident<($1 as token_info).text> parsertools.create_source_context($$,$1,$1);*! - | !*3ident<($1 as token_info).text> parsertools.create_source_context($$,$1,$1);*! - - - ::= - | !*3ident<($1 as token_info).text> parsertools.create_source_context($$,$1,$1);*! - | - - - ::= tkReal - | tkSingle - | tkDouble - | tkExtended - | tkComp - - - ::= tkShortInt - | tkSmallInt - | tkOrdInteger - | tkByte - | tkLongInt - | tkInt64 - | tkWord - | tkBoolean - | tkChar - | tkWideChar - | tkLongWord - | tkPChar - | tkCardinal - - - ::= tkVariant - | tkOleVariant - - - ::= tkAbstract - | tkOverload - | tkReintroduce - | tkOverride - | tkVirtual - | tkStatic -! | tkForward - - - ::= tkDefault - | tkRead - | tkWrite - | tkStored - | tkNodefault - | tkImplements - | tkWriteOnly - | tkReadOnly - | tkDispid - - - ::= tkAt - | tkAbsolute - | tkOn - | tkName - | tkIndex - | tkMessage - | tkContains - | tkRequires - | tkForward - | tkOut - | tkObject - - - ::= tkInternal - | tkPublic - | tkProtected - | tkPrivate - - - ::= tkPackage - | tkUnit - | tkLibrary - | tkExternal - | tkBF - | tkParams - - - ::= !*3token_info<($1 as ident).name> parsertools.create_source_context($$,$1,$1);*! - | tkFinal - | tkTemplate - | tkOr - | tkTypeOf - | tkSizeOf - | tkWhere - | tkXor - | tkAnd - | tkDiv - | tkMod - | tkShl - | tkShr - | tkNot - | tkAs - | tkIn - | tkIs - | tkArray - | tkBegin - | tkCase - | tkClass - | tkConst - | tkConstructor - | tkDestructor - | tkDownto - | tkDo - | tkElse - | tkEnd - | tkExcept - | tkFile - | tkFinalization - | tkFinally - | tkFor - | tkFunction - | tkIf - | tkImplementation - | tkInherited - | tkInitialization - | tkInterface - | tkProcedure - | tkProperty - | tkRaise - | tkRecord - | tkRepeat - | tkSet - | tkTry - | tkType - | tkThen - | tkTo - | tkUntil - | tkUses - | tkUsing - | tkVar - | tkWhile - | tkWith - | tkNil - | tkGoto - | tkOf - | tkLabel - | tkProgram - - - ::= tkOperator - - - ::= tkMinus - | tkPlus - | tkSquareOpen tkSquareClose - | tkRoundOpen tkRoundClose - | tkSlash - | tkStar - | tkEqual - | tkGreater - | tkGreaterEqual - | tkLower - | tkLowerEqual - | tkNotEqual - | tkOr - | tkXor - | tkAnd - | tkDiv - | tkMod - | tkShl - | tkShr - | tkNot - | tkIn - | tkAddressOf - | tkDeref - | - - - ::= tkAssign - | tkPlusEqual - | tkMinusEqual - | tkMultEqual - | tkDivEqual - - - - - ::= - - - ::= tkError diff --git a/Grammars/PNET/PNET.pgt b/Grammars/PNET/PNET.pgt deleted file mode 100644 index 42a56416f..000000000 --- a/Grammars/PNET/PNET.pgt +++ /dev/null @@ -1,157 +0,0 @@ -##TEMPLATE-NAME '_ C# - Calitha Engine - PNET' -##LANGUAGE 'C#' -##ENGINE-NAME 'Calitha GOLD Parser Engine' -##AUTHOR 'DarkStar' -##FILE-EXTENSION 'cs' -##NOTES -PNET parser template. -Version 0.3 -##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.PNETParser.Errors; -using PascalABCCompiler.ParserTools; -using GoldParser; - -namespace PascalABCCompiler.PNETParser -{ -public partial class GPBParser_PNET : 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 Object CreateNonTerminalObject(int ReductionRuleIndex) -{ -switch (ReductionRuleIndex) -{ -##RULES - case (int)RuleConstants.%ID% : - //%Description% - //NONTERMINAL:%Description% - return null; - //ENDNONTERMINAL -##END-RULES -} -throw new RuleException("Unknown rule"); -} - - - - - - -} -} diff --git a/Grammars/PNET/compile_ALL.bat b/Grammars/PNET/compile_ALL.bat deleted file mode 100644 index f0f2d3e9d..000000000 --- a/Grammars/PNET/compile_ALL.bat +++ /dev/null @@ -1,29 +0,0 @@ -cls -@echo off -echo [PNET] GRM to CS,RES compiler. (c) DarkStar 2008 -echo. - -echo Delete old files... -del PNET.cs -del PNET.cgt -del PNETLang.resources - -echo Compile: GRM to CGT... -start /wait ..\..\Utils\gpbcmd\goldbuilder_main PNET.grm PNET.cgt -copy PNET.log con -echo. - -echo Compile: CGT,PGT to TEMPLATE... -start /wait ..\..\Utils\gpbcmd\createskelprog_main PNET.cgt PNET.pgt PNET.tmpl -echo. - -echo Compile: GRM,TEMPLATE to CS... -..\..\Utils\grmCommentCompiler\bin\Debug\grmCommentCompiler.exe PNET.grm PNET.tmpl PNET.cs -echo. - -echo Compile: CGT to RES... -..\..\Utils\ResXMaker\ResXMaker.exe PNET.CGT PNETLanguage PNETLang.resources -echo. - -copy PNETLang.resources ..\..\Parsers\PNETParser\PNETLang.resources -copy PNET.cs ..\..\Parsers\PNETParser\PNET_lrparser_rules.cs \ No newline at end of file diff --git a/Grammars/PNET/compile_GRM.bat b/Grammars/PNET/compile_GRM.bat deleted file mode 100644 index f5d6ffd34..000000000 --- a/Grammars/PNET/compile_GRM.bat +++ /dev/null @@ -1,3 +0,0 @@ -del PNET.cs -..\..\Utils\grmCommentCompiler\bin\Debug\grmCommentCompiler.exe PNET.grm PNET.tmpl PNET.cs -copy PNET.cs ..\..\Parsers\PNETParser\PNET_lrparser_rules.cs \ No newline at end of file diff --git a/Grammars/PNET/compile_PGT.bat b/Grammars/PNET/compile_PGT.bat deleted file mode 100644 index 3499eff95..000000000 --- a/Grammars/PNET/compile_PGT.bat +++ /dev/null @@ -1,4 +0,0 @@ -del PABCParser.cs -start /wait ..\..\Utils\gpbcmd\createskelprog_main PNET.cgt PNET.pgt PNET.tmpl -..\..\Utils\grmCommentCompiler\bin\Debug\grmCommentCompiler.exe PNET.grm PNET.tmpl PNET.cs -copy PNET.cs ..\..\..\PABCSVN\Parsers\PNETParser\PNET_lrparser_rules.cs \ No newline at end of file diff --git a/Grammars/PNET/compile_RES.bat b/Grammars/PNET/compile_RES.bat deleted file mode 100644 index 94b868229..000000000 --- a/Grammars/PNET/compile_RES.bat +++ /dev/null @@ -1,2 +0,0 @@ -..\..\Utils\ResXMaker\ResXMaker.exe PNET.CGT PNETLanguage PNETLang.resources -copy PNETLang.resources ..\..\Parsers\PNETParser\PNETLang.resources \ No newline at end of file