/* do not edit automatically generated by mc from mcp4. */ /* output from mc-4.bnf, automatically generated do not edit. Copyright (C) 2016-2022 Free Software Foundation, Inc. Contributed by Gaius Mulley . This file is part of GNU Modula-2. GNU Modula-2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Modula-2; see the file COPYING. If not, see . */ #include "config.h" #include "system.h" # if !defined (PROC_D) # define PROC_D typedef void (*PROC_t) (void); typedef struct { PROC_t proc; } PROC; # endif # if !defined (TRUE) # define TRUE (1==1) # endif # if !defined (FALSE) # define FALSE (1==0) # endif #if defined(__cplusplus) # undef NULL # define NULL 0 #endif #define _mcp4_H #define _mcp4_C # include "GDynamicStrings.h" # include "GmcError.h" # include "GnameKey.h" # include "GmcPrintf.h" # include "GmcDebug.h" # include "GmcReserved.h" # include "GmcMetaError.h" # include "GmcStack.h" # include "GmcLexBuf.h" # include "Gdecl.h" # define Pass1 FALSE # define Debugging FALSE typedef unsigned int mcp4_stop0; typedef unsigned int mcp4_SetOfStop0; typedef unsigned int mcp4_stop1; typedef unsigned int mcp4_SetOfStop1; typedef unsigned int mcp4_stop2; typedef unsigned int mcp4_SetOfStop2; static unsigned int WasNoError; static nameKey_Name curstring; static nameKey_Name curident; static decl_node curproc; static decl_node typeDes; static decl_node typeExp; static decl_node curmodule; static mcStack_stack stk; /* CompilationUnit - returns TRUE if the input was correct enough to parse in future passes. */ extern "C" unsigned int mcp4_CompilationUnit (void); /* push - */ static decl_node push (decl_node n); /* pop - */ static decl_node pop (void); /* replace - */ static decl_node replace (decl_node n); /* peep - returns the top node on the stack without removing it. */ static decl_node peep (void); /* depth - returns the depth of the stack. */ static unsigned int depth (void); /* checkDuplicate - */ static void checkDuplicate (unsigned int b); /* checkDuplicate - */ static void ErrorString (DynamicStrings_String s); /* checkDuplicate - */ static void ErrorArray (const char *a_, unsigned int _a_high); /* pushNunbounded - */ static void pushNunbounded (unsigned int c); /* makeIndexedArray - builds and returns an array of type, t, with, c, indices. */ static decl_node makeIndexedArray (unsigned int c, decl_node t); /* importInto - from, m, import, name, into module, current. It checks to see if curident is an enumeration type and if so automatically includes all enumeration fields as well. */ static void importInto (decl_node m, nameKey_Name name, decl_node current); /* checkEndName - if module does not have, name, then issue an error containing, desc. */ static void checkEndName (decl_node module, nameKey_Name name, const char *desc_, unsigned int _desc_high); /* DescribeStop - issues a message explaining what tokens were expected */ static DynamicStrings_String DescribeStop (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DescribeError - issues a message explaining what tokens were expected */ static void DescribeError (void); /* SyntaxError - after a syntax error we skip all tokens up until we reach a stop symbol. */ static void SyntaxError (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* SyntaxCheck - */ static void SyntaxCheck (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* WarnMissingToken - generates a warning message about a missing token, t. */ static void WarnMissingToken (mcReserved_toktype t); /* MissingToken - generates a warning message about a missing token, t. */ static void MissingToken (mcReserved_toktype t); /* CheckAndInsert - */ static unsigned int CheckAndInsert (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* InStopSet */ static unsigned int InStopSet (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* PeepToken - peep token checks to see whether the stopset is satisfied by currenttoken If it is not then it will insert a token providing the token is one of ; ] ) } . OF END , if the stopset contains then we do not insert a token */ static void PeepToken (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Expect - */ static void Expect (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Ident - error checking varient of Ident */ static void Ident (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* string - */ static void string (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Integer - */ static void Integer (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Real - */ static void Real (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FileUnit := DefinitionModule | ImplementationOrProgramModule first symbols:implementationtok, moduletok, definitiontok cannot reachend */ static void FileUnit (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ProgramModule := 'MODULE' Ident % curmodule := lookupModule (curident) % % enterScope (curmodule) % % resetConstExpPos (curmodule) % [ Priority ] ';' { Import } Block Ident % checkEndName (curmodule, curident, 'program module') % % leaveScope % '.' first symbols:moduletok cannot reachend */ static void ProgramModule (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ImplementationModule := 'IMPLEMENTATION' 'MODULE' Ident % curmodule := lookupImp (curident) % % enterScope (lookupDef (curident)) % % enterScope (curmodule) % % resetConstExpPos (curmodule) % [ Priority ] ';' { Import } Block Ident % checkEndName (curmodule, curident, 'implementation module') % % leaveScope ; leaveScope % '.' first symbols:implementationtok cannot reachend */ static void ImplementationModule (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ImplementationOrProgramModule := ImplementationModule | ProgramModule first symbols:moduletok, implementationtok cannot reachend */ static void ImplementationOrProgramModule (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Number := Integer | Real first symbols:realtok, integertok cannot reachend */ static void Number (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Qualident := Ident { '.' Ident } first symbols:identtok cannot reachend */ static void Qualident (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstantDeclaration := % VAR d, e: node ; % Ident % d := lookupSym (curident) % '=' ConstExpression % e := pop () % % assert (isConst (d)) % % putConst (d, e) % first symbols:identtok cannot reachend */ static void ConstantDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstExpression := % VAR c, l, r: node ; op: toktype ; d: CARDINAL ; % % d := depth () % % c := push (getNextConstExp ()) % SimpleConstExpr % op := currenttoken % [ Relation SimpleConstExpr % r := pop () % % l := pop () % % l := push (makeBinaryTok (op, l, r)) % ] % c := replace (fixupConstExp (c, pop ())) % % assert (d+1 = depth ()) % first symbols:identtok, attributetok, lcbratok, stringtok, nottok, lparatok, integertok, realtok, minustok, plustok cannot reachend */ static void ConstExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Relation := '=' | '#' | '<>' | '<' | '<=' | '>' | '>=' | 'IN' first symbols:intok, greaterequaltok, greatertok, lessequaltok, lesstok, lessgreatertok, hashtok, equaltok cannot reachend */ static void Relation (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* SimpleConstExpr := % VAR op: toktype ; n: node ; % UnaryOrConstTerm % n := pop () % { % op := currenttoken % AddOperator ConstTerm % n := makeBinaryTok (op, n, pop ()) % } % n := push (n) % first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok cannot reachend */ static void SimpleConstExpr (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* UnaryOrConstTerm := % VAR n: node ; % '+' ConstTerm % n := push (makeUnaryTok (plustok, pop ())) % | '-' ConstTerm % n := push (makeUnaryTok (minustok, pop ())) % | ConstTerm first symbols:identtok, attributetok, lcbratok, stringtok, nottok, lparatok, integertok, realtok, minustok, plustok cannot reachend */ static void UnaryOrConstTerm (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* AddOperator := '+' | '-' | 'OR' first symbols:ortok, minustok, plustok cannot reachend */ static void AddOperator (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstTerm := % VAR op: toktype ; n: node ; % ConstFactor % n := pop () % { % op := currenttoken % MulOperator ConstFactor % n := makeBinaryTok (op, n, pop ()) % } % n := push (n) % first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok cannot reachend */ static void ConstTerm (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* MulOperator := '*' | '/' | 'DIV' | 'MOD' | 'REM' | 'AND' | '&' first symbols:ambersandtok, andtok, remtok, modtok, divtok, dividetok, timestok cannot reachend */ static void MulOperator (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* NotConstFactor := 'NOT' ConstFactor % VAR n: node ; % % n := push (makeUnaryTok (nottok, pop ())) % first symbols:nottok cannot reachend */ static void NotConstFactor (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstFactor := Number | ConstString | ConstSetOrQualidentOrFunction | '(' ConstExpression ')' | NotConstFactor | ConstAttribute first symbols:identtok, attributetok, lcbratok, stringtok, nottok, lparatok, integertok, realtok cannot reachend */ static void ConstFactor (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstString := string % VAR n: node ; % % n := push (makeString (curstring)) % first symbols:stringtok cannot reachend */ static void ConstString (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstComponentElement := ConstExpression % VAR l, h, n: node ; % % l := pop () % % h := NIL % [ '..' ConstExpression % h := pop () % % ErrorArray ('implementation restriction range is not allowed') % ] % n := push (includeSetValue (pop (), l, h)) % first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok cannot reachend */ static void ConstComponentElement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstComponentValue := ConstComponentElement [ 'BY' % ErrorArray ('implementation restriction BY not allowed') % ConstExpression ] first symbols:identtok, attributetok, lcbratok, stringtok, nottok, lparatok, integertok, realtok, minustok, plustok cannot reachend */ static void ConstComponentValue (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstArraySetRecordValue := ConstComponentValue { ',' ConstComponentValue } first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok cannot reachend */ static void ConstArraySetRecordValue (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstConstructor := '{' % VAR n: node ; % % n := push (makeSetValue ()) % [ ConstArraySetRecordValue ] '}' first symbols:lcbratok cannot reachend */ static void ConstConstructor (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstSetOrQualidentOrFunction := % VAR q, p, n: node ; d: CARDINAL ; % % d := depth () % PushQualident % assert (d+1 = depth ()) % [ ConstConstructor % p := pop () % % q := pop () % % n := push (putSetValue (p, q)) % % assert (d+1 = depth ()) % | ConstActualParameters % p := pop () % % q := pop () % % n := push (makeFuncCall (q, p)) % % assert (d+1 = depth ()) % ] | % d := depth () % ConstConstructor % assert (d+1 = depth ()) % first symbols:identtok, lcbratok cannot reachend */ static void ConstSetOrQualidentOrFunction (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstActualParameters := '(' % VAR n: node ; % % n := push (makeExpList ()) % [ ConstExpList ] ')' % assert (isExpList (peep ())) % first symbols:lparatok cannot reachend */ static void ConstActualParameters (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstExpList := % VAR p, n: node ; % % p := peep () % % assert (isExpList (p)) % ConstExpression % putExpList (p, pop ()) % % assert (p = peep ()) % % assert (isExpList (peep ())) % { ',' ConstExpression % putExpList (p, pop ()) % % assert (isExpList (peep ())) % } first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok cannot reachend */ static void ConstExpList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstAttribute := '__ATTRIBUTE__' '__BUILTIN__' '(' '(' ConstAttributeExpression ')' ')' first symbols:attributetok cannot reachend */ static void ConstAttribute (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ConstAttributeExpression := Ident % VAR n: node ; % % n := push (getBuiltinConst (curident)) % | '<' Qualident ',' Ident '>' first symbols:lesstok, identtok cannot reachend */ static void ConstAttributeExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ByteAlignment := '' first symbols:ldirectivetok cannot reachend */ static void ByteAlignment (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* OptAlignmentExpression := [ AlignmentExpression ] first symbols:lparatok reachend */ static void OptAlignmentExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* AlignmentExpression := '(' ConstExpression ')' first symbols:lparatok cannot reachend */ static void AlignmentExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Alignment := [ ByteAlignment ] first symbols:ldirectivetok reachend */ static void Alignment (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* IdentList := Ident { ',' Ident } first symbols:identtok cannot reachend */ static void IdentList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* PushIdentList := % VAR n: node ; % % n := makeIdentList () % Ident % checkDuplicate (putIdent (n, curident)) % { ',' Ident % checkDuplicate (putIdent (n, curident)) % } % n := push (n) % first symbols:identtok cannot reachend */ static void PushIdentList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* SubrangeType := '[' ConstExpression '..' ConstExpression ']' first symbols:lsbratok cannot reachend */ static void SubrangeType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ArrayType := 'ARRAY' SimpleType { ',' SimpleType } 'OF' Type first symbols:arraytok cannot reachend */ static void ArrayType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* RecordType := 'RECORD' [ DefaultRecordAttributes ] FieldListSequence 'END' first symbols:recordtok cannot reachend */ static void RecordType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefaultRecordAttributes := '' first symbols:ldirectivetok cannot reachend */ static void DefaultRecordAttributes (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* RecordFieldPragma := [ '' ] first symbols:ldirectivetok reachend */ static void RecordFieldPragma (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FieldPragmaExpression := Ident PragmaConstExpression first symbols:identtok cannot reachend */ static void FieldPragmaExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* PragmaConstExpression := [ '(' ConstExpression ')' ] first symbols:lparatok reachend */ static void PragmaConstExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* AttributeExpression := Ident '(' ConstExpression ')' first symbols:identtok cannot reachend */ static void AttributeExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FieldListSequence := FieldListStatement { ';' FieldListStatement } first symbols:casetok, identtok, semicolontok reachend */ static void FieldListSequence (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FieldListStatement := [ FieldList ] first symbols:identtok, casetok reachend */ static void FieldListStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FieldList := IdentList ':' Type RecordFieldPragma | 'CASE' CaseTag 'OF' Varient { '|' Varient } [ 'ELSE' FieldListSequence ] 'END' first symbols:casetok, identtok cannot reachend */ static void FieldList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* TagIdent := Ident | % curident := NulName % first symbols:identtok reachend */ static void TagIdent (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* CaseTag := TagIdent [ ':' Qualident ] first symbols:colontok, identtok reachend */ static void CaseTag (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Varient := [ VarientCaseLabelList ':' FieldListSequence ] first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok reachend */ static void Varient (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* VarientCaseLabelList := VarientCaseLabels { ',' VarientCaseLabels } first symbols:identtok, attributetok, lcbratok, stringtok, nottok, lparatok, integertok, realtok, minustok, plustok cannot reachend */ static void VarientCaseLabelList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* VarientCaseLabels := ConstExpression [ '..' ConstExpression ] first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok cannot reachend */ static void VarientCaseLabels (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* SetType := ( 'SET' | 'PACKEDSET' ) 'OF' SimpleType first symbols:oftok, packedsettok, settok cannot reachend */ static void SetType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* PointerType := 'POINTER' 'TO' Type first symbols:pointertok cannot reachend */ static void PointerType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ProcedureType := 'PROCEDURE' [ FormalTypeList ] first symbols:proceduretok cannot reachend */ static void ProcedureType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FormalTypeList := '(' ( ')' FormalReturn | ProcedureParameters ')' FormalReturn ) first symbols:lparatok cannot reachend */ static void FormalTypeList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FormalReturn := [ ':' OptReturnType ] first symbols:colontok reachend */ static void FormalReturn (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* OptReturnType := '[' Qualident ']' | Qualident first symbols:identtok, lsbratok cannot reachend */ static void OptReturnType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ProcedureParameters := ProcedureParameter { ',' ProcedureParameter } first symbols:identtok, arraytok, periodperiodperiodtok, vartok cannot reachend */ static void ProcedureParameters (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ProcedureParameter := '...' | 'VAR' FormalType | FormalType first symbols:identtok, arraytok, vartok, periodperiodperiodtok cannot reachend */ static void ProcedureParameter (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* VarIdent := Ident [ '[' ConstExpression % VAR n: node ; % % n := pop () % ']' ] first symbols:identtok cannot reachend */ static void VarIdent (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* VarIdentList := VarIdent { ',' VarIdent } first symbols:identtok cannot reachend */ static void VarIdentList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* VariableDeclaration := VarIdentList ':' Type Alignment first symbols:identtok cannot reachend */ static void VariableDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Designator := Qualident { SubDesignator } first symbols:identtok cannot reachend */ static void Designator (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* SubDesignator := '.' Ident | '[' ArrayExpList ']' | '^' first symbols:uparrowtok, lsbratok, periodtok cannot reachend */ static void SubDesignator (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ArrayExpList := Expression { ',' Expression } first symbols:lcbratok, identtok, realtok, integertok, stringtok, lparatok, nottok, plustok, minustok cannot reachend */ static void ArrayExpList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ExpList := Expression { ',' Expression } first symbols:lcbratok, identtok, realtok, integertok, stringtok, lparatok, nottok, plustok, minustok cannot reachend */ static void ExpList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Expression := SimpleExpression [ Relation SimpleExpression ] first symbols:identtok, lcbratok, nottok, lparatok, stringtok, integertok, realtok, minustok, plustok cannot reachend */ static void Expression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* SimpleExpression := UnaryOrTerm { AddOperator Term } first symbols:lcbratok, identtok, realtok, integertok, stringtok, lparatok, nottok, plustok, minustok cannot reachend */ static void SimpleExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* UnaryOrTerm := '+' Term | '-' Term | Term first symbols:identtok, lcbratok, nottok, lparatok, stringtok, integertok, realtok, minustok, plustok cannot reachend */ static void UnaryOrTerm (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Term := Factor { MulOperator Factor } first symbols:lcbratok, identtok, realtok, integertok, stringtok, lparatok, nottok cannot reachend */ static void Term (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Factor := Number | string | SetOrDesignatorOrFunction | '(' Expression ')' | 'NOT' ( Factor | ConstAttribute ) first symbols:identtok, lcbratok, nottok, lparatok, stringtok, integertok, realtok cannot reachend */ static void Factor (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ComponentElement := Expression [ '..' Expression % ErrorArray ('implementation restriction range not allowed') % ] first symbols:lcbratok, identtok, realtok, integertok, stringtok, lparatok, nottok, plustok, minustok cannot reachend */ static void ComponentElement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ComponentValue := ComponentElement [ 'BY' % ErrorArray ('implementation restriction BY not allowed') % Expression ] first symbols:identtok, lcbratok, nottok, lparatok, stringtok, integertok, realtok, minustok, plustok cannot reachend */ static void ComponentValue (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ArraySetRecordValue := ComponentValue { ',' ComponentValue } first symbols:lcbratok, identtok, realtok, integertok, stringtok, lparatok, nottok, plustok, minustok cannot reachend */ static void ArraySetRecordValue (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Constructor := '{' [ ArraySetRecordValue ] '}' first symbols:lcbratok cannot reachend */ static void Constructor (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* SetOrDesignatorOrFunction := Qualident [ Constructor | SimpleDes [ ActualParameters ] ] | Constructor first symbols:lcbratok, identtok cannot reachend */ static void SetOrDesignatorOrFunction (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* SimpleDes := { SubDesignator } first symbols:periodtok, lsbratok, uparrowtok reachend */ static void SimpleDes (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ActualParameters := '(' [ ExpList ] ')' first symbols:lparatok cannot reachend */ static void ActualParameters (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ExitStatement := 'EXIT' first symbols:exittok cannot reachend */ static void ExitStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ReturnStatement := 'RETURN' [ Expression ] first symbols:returntok cannot reachend */ static void ReturnStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Statement := [ AssignmentOrProcedureCall | IfStatement | CaseStatement | WhileStatement | RepeatStatement | LoopStatement | ForStatement | WithStatement | AsmStatement | ExitStatement | ReturnStatement | RetryStatement ] first symbols:retrytok, asmtok, withtok, fortok, looptok, repeattok, whiletok, casetok, iftok, identtok, returntok, exittok reachend */ static void Statement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* RetryStatement := 'RETRY' first symbols:retrytok cannot reachend */ static void RetryStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* AssignmentOrProcedureCall := Designator ( ':=' Expression | ActualParameters | % epsilon % ) first symbols:identtok cannot reachend */ static void AssignmentOrProcedureCall (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* StatementSequence := Statement { ';' Statement } first symbols:identtok, iftok, casetok, whiletok, repeattok, looptok, fortok, withtok, asmtok, retrytok, semicolontok, exittok, returntok reachend */ static void StatementSequence (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* IfStatement := 'IF' Expression 'THEN' StatementSequence { 'ELSIF' Expression 'THEN' StatementSequence } [ 'ELSE' StatementSequence ] 'END' first symbols:iftok cannot reachend */ static void IfStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* CaseStatement := 'CASE' Expression 'OF' Case { '|' Case } CaseEndStatement first symbols:casetok cannot reachend */ static void CaseStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* CaseEndStatement := 'END' | 'ELSE' StatementSequence 'END' first symbols:elsetok, endtok cannot reachend */ static void CaseEndStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Case := [ CaseLabelList ':' StatementSequence ] first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok reachend */ static void Case (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* CaseLabelList := CaseLabels { ',' CaseLabels } first symbols:identtok, attributetok, lcbratok, stringtok, nottok, lparatok, integertok, realtok, minustok, plustok cannot reachend */ static void CaseLabelList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* CaseLabels := ConstExpression [ '..' ConstExpression ] first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok cannot reachend */ static void CaseLabels (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* WhileStatement := 'WHILE' Expression 'DO' StatementSequence 'END' first symbols:whiletok cannot reachend */ static void WhileStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* RepeatStatement := 'REPEAT' StatementSequence 'UNTIL' Expression first symbols:repeattok cannot reachend */ static void RepeatStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ForStatement := 'FOR' Ident ':=' Expression 'TO' Expression [ 'BY' ConstExpression ] 'DO' StatementSequence 'END' first symbols:fortok cannot reachend */ static void ForStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* LoopStatement := 'LOOP' StatementSequence 'END' first symbols:looptok cannot reachend */ static void LoopStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* WithStatement := 'WITH' Designator 'DO' StatementSequence 'END' first symbols:withtok cannot reachend */ static void WithStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ProcedureDeclaration := ProcedureHeading ';' ProcedureBlock Ident % leaveScope % first symbols:proceduretok cannot reachend */ static void ProcedureDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ProcedureIdent := Ident % curproc := lookupSym (curident) % % enterScope (curproc) % first symbols:identtok cannot reachend */ static void ProcedureIdent (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefProcedureIdent := Ident % curproc := lookupSym (curident) % first symbols:identtok cannot reachend */ static void DefProcedureIdent (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefineBuiltinProcedure := [ '__ATTRIBUTE__' '__BUILTIN__' '(' '(' Ident ')' ')' | '__INLINE__' ] first symbols:inlinetok, attributetok reachend */ static void DefineBuiltinProcedure (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ProcedureHeading := 'PROCEDURE' DefineBuiltinProcedure ( ProcedureIdent [ FormalParameters ] AttributeNoReturn ) first symbols:proceduretok cannot reachend */ static void ProcedureHeading (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Builtin := [ '__BUILTIN__' | '__INLINE__' ] first symbols:inlinetok, builtintok reachend */ static void Builtin (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefProcedureHeading := 'PROCEDURE' Builtin ( DefProcedureIdent [ DefFormalParameters ] AttributeNoReturn ) first symbols:proceduretok cannot reachend */ static void DefProcedureHeading (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ProcedureBlock := { Declaration } [ 'BEGIN' ProcedureBlockBody ] 'END' first symbols:proceduretok, moduletok, consttok, typetok, vartok, endtok, begintok cannot reachend */ static void ProcedureBlock (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Block := { Declaration } InitialBlock FinalBlock 'END' first symbols:proceduretok, moduletok, finallytok, begintok, consttok, typetok, vartok, endtok cannot reachend */ static void Block (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* InitialBlock := [ 'BEGIN' InitialBlockBody ] first symbols:begintok reachend */ static void InitialBlock (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FinalBlock := [ 'FINALLY' FinalBlockBody ] first symbols:finallytok reachend */ static void FinalBlock (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* InitialBlockBody := NormalPart [ 'EXCEPT' ExceptionalPart ] first symbols:identtok, iftok, casetok, whiletok, repeattok, looptok, fortok, withtok, asmtok, retrytok, semicolontok, exittok, returntok, excepttok reachend */ static void InitialBlockBody (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FinalBlockBody := NormalPart [ 'EXCEPT' ExceptionalPart ] first symbols:identtok, iftok, casetok, whiletok, repeattok, looptok, fortok, withtok, asmtok, retrytok, semicolontok, exittok, returntok, excepttok reachend */ static void FinalBlockBody (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ProcedureBlockBody := NormalPart [ 'EXCEPT' ExceptionalPart ] first symbols:identtok, iftok, casetok, whiletok, repeattok, looptok, fortok, withtok, asmtok, retrytok, semicolontok, exittok, returntok, excepttok reachend */ static void ProcedureBlockBody (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* NormalPart := StatementSequence first symbols:retrytok, asmtok, withtok, fortok, looptok, repeattok, whiletok, casetok, iftok, identtok, returntok, exittok, semicolontok reachend */ static void NormalPart (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ExceptionalPart := StatementSequence first symbols:retrytok, asmtok, withtok, fortok, looptok, repeattok, whiletok, casetok, iftok, identtok, returntok, exittok, semicolontok reachend */ static void ExceptionalPart (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Declaration := 'CONST' { ConstantDeclaration ';' } | 'TYPE' { TypeDeclaration } | 'VAR' { VariableDeclaration ';' } | ProcedureDeclaration ';' | ModuleDeclaration ';' first symbols:moduletok, proceduretok, vartok, typetok, consttok cannot reachend */ static void Declaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefFormalParameters := '(' % paramEnter (curproc) % [ DefMultiFPSection ] ')' % paramLeave (curproc) % FormalReturn first symbols:lparatok cannot reachend */ static void DefFormalParameters (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefMultiFPSection := DefExtendedFP | FPSection [ ';' DefMultiFPSection ] first symbols:identtok, vartok, lsbratok, periodperiodperiodtok cannot reachend */ static void DefMultiFPSection (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FormalParameters := '(' % paramEnter (curproc) % [ MultiFPSection ] ')' % paramLeave (curproc) % FormalReturn first symbols:lparatok cannot reachend */ static void FormalParameters (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* AttributeNoReturn := [ '' ] first symbols:ldirectivetok reachend */ static void AttributeNoReturn (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* AttributeUnused := [ '' ] first symbols:ldirectivetok reachend */ static void AttributeUnused (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* MultiFPSection := ExtendedFP | FPSection [ ';' MultiFPSection ] first symbols:identtok, vartok, lsbratok, periodperiodperiodtok cannot reachend */ static void MultiFPSection (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FPSection := NonVarFPSection | VarFPSection first symbols:vartok, identtok cannot reachend */ static void FPSection (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefExtendedFP := DefOptArg | '...' first symbols:lsbratok, periodperiodperiodtok cannot reachend */ static void DefExtendedFP (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ExtendedFP := OptArg | '...' first symbols:lsbratok, periodperiodperiodtok cannot reachend */ static void ExtendedFP (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* VarFPSection := 'VAR' PushIdentList ':' FormalType [ AttributeUnused ] first symbols:vartok cannot reachend */ static void VarFPSection (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* NonVarFPSection := PushIdentList ':' FormalType [ AttributeUnused ] first symbols:identtok cannot reachend */ static void NonVarFPSection (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* OptArg := '[' Ident ':' FormalType [ '=' ConstExpression ] ']' first symbols:lsbratok cannot reachend */ static void OptArg (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefOptArg := '[' Ident ':' FormalType '=' ConstExpression ']' first symbols:lsbratok cannot reachend */ static void DefOptArg (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FormalType := { 'ARRAY' 'OF' } PushQualident first symbols:identtok, arraytok cannot reachend */ static void FormalType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ModuleDeclaration := 'MODULE' Ident [ Priority ] ';' { Import } [ Export ] Block Ident first symbols:moduletok cannot reachend */ static void ModuleDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Priority := '[' ConstExpression ']' first symbols:lsbratok cannot reachend */ static void Priority (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Export := 'EXPORT' ( 'QUALIFIED' IdentList | 'UNQUALIFIED' IdentList | IdentList ) ';' first symbols:exporttok cannot reachend */ static void Export (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FromIdentList := Ident { ',' Ident } first symbols:identtok cannot reachend */ static void FromIdentList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* FromImport := 'FROM' Ident 'IMPORT' FromIdentList ';' first symbols:fromtok cannot reachend */ static void FromImport (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* ImportModuleList := Ident { ',' Ident } first symbols:identtok cannot reachend */ static void ImportModuleList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* WithoutFromImport := 'IMPORT' ImportModuleList ';' first symbols:importtok cannot reachend */ static void WithoutFromImport (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Import := FromImport | WithoutFromImport first symbols:importtok, fromtok cannot reachend */ static void Import (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefinitionModule := 'DEFINITION' 'MODULE' [ 'FOR' string ] Ident % curmodule := lookupDef (curident) % % addCommentBody (curmodule) % ';' % enterScope (curmodule) % % resetConstExpPos (curmodule) % { Import } [ Export ] { Definition } 'END' Ident '.' % checkEndName (curmodule, curident, 'definition module') % % leaveScope % first symbols:definitiontok cannot reachend */ static void DefinitionModule (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* PushQualident := Ident % typeExp := push (lookupSym (curident)) % % IF typeExp = NIL THEN metaError1 ('the symbol {%1k} is not visible in this scope (or any other nested scope)', curident) END % [ '.' % IF NOT isDef (typeExp) THEN ErrorArray ('the first component of this qualident must be a definition module') END % Ident % typeExp := replace (lookupInScope (typeExp, curident)) ; IF typeExp=NIL THEN ErrorArray ('identifier not found in definition module') END % ] first symbols:identtok cannot reachend */ static void PushQualident (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* OptSubrange := [ SubrangeType ] first symbols:lsbratok reachend */ static void OptSubrange (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* TypeEquiv := PushQualident OptSubrange first symbols:identtok cannot reachend */ static void TypeEquiv (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* EnumIdentList := Ident { ',' Ident } first symbols:identtok cannot reachend */ static void EnumIdentList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Enumeration := '(' EnumIdentList ')' first symbols:lparatok cannot reachend */ static void Enumeration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* SimpleType := TypeEquiv | Enumeration | SubrangeType first symbols:lsbratok, lparatok, identtok cannot reachend */ static void SimpleType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Type := SimpleType | ArrayType | RecordType | SetType | PointerType | ProcedureType first symbols:proceduretok, pointertok, settok, packedsettok, oftok, recordtok, arraytok, identtok, lparatok, lsbratok cannot reachend */ static void Type (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* TypeDeclaration := { Ident ( ';' | '=' Type Alignment ';' ) } first symbols:identtok reachend */ static void TypeDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefQualident := Ident % typeExp := lookupSym (curident) % [ '.' % IF NOT isDef (typeExp) THEN ErrorArray ('the first component of this qualident must be a definition module') END % Ident % typeExp := lookupInScope (typeExp, curident) ; IF typeExp=NIL THEN ErrorArray ('identifier not found in definition module') END % ] first symbols:identtok cannot reachend */ static void DefQualident (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefTypeEquiv := DefQualident OptSubrange first symbols:identtok cannot reachend */ static void DefTypeEquiv (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefEnumIdentList := Ident { ',' Ident } first symbols:identtok cannot reachend */ static void DefEnumIdentList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefEnumeration := '(' DefEnumIdentList ')' first symbols:lparatok cannot reachend */ static void DefEnumeration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefSimpleType := DefTypeEquiv | DefEnumeration | SubrangeType first symbols:lsbratok, lparatok, identtok cannot reachend */ static void DefSimpleType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefType := DefSimpleType | ArrayType | RecordType | SetType | PointerType | ProcedureType first symbols:proceduretok, pointertok, settok, packedsettok, oftok, recordtok, arraytok, identtok, lparatok, lsbratok cannot reachend */ static void DefType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefTypeDeclaration := { Ident ( ';' | '=' DefType Alignment ';' ) } first symbols:identtok reachend */ static void DefTypeDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* DefConstantDeclaration := Ident '=' ConstExpression first symbols:identtok cannot reachend */ static void DefConstantDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* Definition := 'CONST' { DefConstantDeclaration ';' } | 'TYPE' { DefTypeDeclaration } | 'VAR' { VariableDeclaration ';' } | DefProcedureHeading ';' first symbols:proceduretok, vartok, typetok, consttok cannot reachend */ static void Definition (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* AsmStatement := 'ASM' [ 'VOLATILE' ] '(' AsmOperands ')' first symbols:asmtok cannot reachend */ static void AsmStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* AsmOperands := string [ AsmOperandSpec ] first symbols:stringtok cannot reachend */ static void AsmOperands (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* AsmOperandSpec := [ ':' AsmList [ ':' AsmList [ ':' TrashList ] ] ] first symbols:colontok reachend */ static void AsmOperandSpec (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* AsmList := [ AsmElement ] { ',' AsmElement } first symbols:lsbratok, stringtok, commatok reachend */ static void AsmList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* NamedOperand := '[' Ident ']' first symbols:lsbratok cannot reachend */ static void NamedOperand (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* AsmOperandName := [ NamedOperand ] first symbols:lsbratok reachend */ static void AsmOperandName (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* AsmElement := AsmOperandName string '(' Expression ')' first symbols:stringtok, lsbratok cannot reachend */ static void AsmElement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* TrashList := [ string ] { ',' string } first symbols:commatok, stringtok reachend */ static void TrashList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2); /* push - */ static decl_node push (decl_node n) { return static_cast (mcStack_push (stk, reinterpret_cast (n))); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } /* pop - */ static decl_node pop (void) { return static_cast (mcStack_pop (stk)); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } /* replace - */ static decl_node replace (decl_node n) { return static_cast (mcStack_replace (stk, reinterpret_cast (n))); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } /* peep - returns the top node on the stack without removing it. */ static decl_node peep (void) { return push (pop ()); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } /* depth - returns the depth of the stack. */ static unsigned int depth (void) { return mcStack_depth (stk); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } /* checkDuplicate - */ static void checkDuplicate (unsigned int b) { } /* checkDuplicate - */ static void ErrorString (DynamicStrings_String s) { mcError_errorStringAt (s, mcLexBuf_getTokenNo ()); WasNoError = FALSE; } /* checkDuplicate - */ static void ErrorArray (const char *a_, unsigned int _a_high) { char a[_a_high+1]; /* make a local copy of each unbounded array. */ memcpy (a, a_, _a_high+1); ErrorString (DynamicStrings_InitString ((const char *) a, _a_high)); } /* pushNunbounded - */ static void pushNunbounded (unsigned int c) { decl_node type; decl_node array; decl_node subrange; while (c != 0) { type = pop (); subrange = decl_makeSubrange (static_cast (NULL), static_cast (NULL)); decl_putSubrangeType (subrange, decl_getCardinal ()); array = decl_makeArray (subrange, type); decl_putUnbounded (array); type = push (array); c -= 1; } } /* makeIndexedArray - builds and returns an array of type, t, with, c, indices. */ static decl_node makeIndexedArray (unsigned int c, decl_node t) { decl_node i; while (c > 0) { t = decl_makeArray (pop (), t); c -= 1; } return t; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } /* importInto - from, m, import, name, into module, current. It checks to see if curident is an enumeration type and if so automatically includes all enumeration fields as well. */ static void importInto (decl_node m, nameKey_Name name, decl_node current) { decl_node s; decl_node o; mcDebug_assert (decl_isDef (m)); mcDebug_assert (((decl_isDef (current)) || (decl_isModule (current))) || (decl_isImp (current))); s = decl_lookupExported (m, name); if (s == NULL) { mcMetaError_metaError2 ((const char *) "{%1k} was not exported from definition module {%2a}", 51, (const unsigned char *) &name, (sizeof (name)-1), (const unsigned char *) &m, (sizeof (m)-1)); } else { o = decl_import (current, s); if (s != o) { mcMetaError_metaError2 ((const char *) "{%1ad} cannot be imported into the current module as it causes a name clash with {%2ad}", 87, (const unsigned char *) &s, (sizeof (s)-1), (const unsigned char *) &o, (sizeof (o)-1)); } } } /* checkEndName - if module does not have, name, then issue an error containing, desc. */ static void checkEndName (decl_node module, nameKey_Name name, const char *desc_, unsigned int _desc_high) { DynamicStrings_String s; char desc[_desc_high+1]; /* make a local copy of each unbounded array. */ memcpy (desc, desc_, _desc_high+1); if ((decl_getSymName (module)) != name) { s = DynamicStrings_InitString ((const char *) "inconsistent module name found with this ", 41); s = DynamicStrings_ConCat (s, DynamicStrings_Mark (DynamicStrings_InitString ((const char *) desc, _desc_high))); ErrorString (s); } } /* DescribeStop - issues a message explaining what tokens were expected */ static DynamicStrings_String DescribeStop (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { unsigned int n; DynamicStrings_String str; DynamicStrings_String message; n = 0; message = DynamicStrings_InitString ((const char *) "", 0); if ((((1 << (mcReserved_stringtok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "string", 6))); n += 1; } if ((((1 << (mcReserved_realtok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "real number", 11))); n += 1; } if ((((1 << (mcReserved_identtok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "identifier", 10))); n += 1; } if ((((1 << (mcReserved_integertok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "integer number", 14))); n += 1; } if ((((1 << (mcReserved_inlinetok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "__INLINE__", 10))); n += 1; } if ((((1 << (mcReserved_builtintok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "__BUILTIN__", 11))); n += 1; } if ((((1 << (mcReserved_attributetok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "__ATTRIBUTE__", 13))); n += 1; } if ((((1 << (mcReserved_filetok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "__FILE__", 8))); n += 1; } if ((((1 << (mcReserved_linetok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "__LINE__", 8))); n += 1; } if ((((1 << (mcReserved_datetok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "__DATE__", 8))); n += 1; } if ((((1 << (mcReserved_periodperiodperiodtok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "...", 3))); n += 1; } if ((((1 << (mcReserved_volatiletok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "VOLATILE", 8))); n += 1; } if ((((1 << (mcReserved_asmtok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "ASM", 3))); n += 1; } if ((((1 << (mcReserved_withtok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "WITH", 4))); n += 1; } if ((((1 << (mcReserved_whiletok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "WHILE", 5))); n += 1; } if ((((1 << (mcReserved_vartok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "VAR", 3))); n += 1; } if ((((1 << (mcReserved_untiltok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "UNTIL", 5))); n += 1; } if ((((1 << (mcReserved_typetok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "TYPE", 4))); n += 1; } if ((((1 << (mcReserved_totok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "TO", 2))); n += 1; } if ((((1 << (mcReserved_thentok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "THEN", 4))); n += 1; } if ((((1 << (mcReserved_settok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "SET", 3))); n += 1; } if ((((1 << (mcReserved_returntok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "RETURN", 6))); n += 1; } if ((((1 << (mcReserved_retrytok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "RETRY", 5))); n += 1; } if ((((1 << (mcReserved_repeattok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "REPEAT", 6))); n += 1; } if ((((1 << (mcReserved_remtok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "REM", 3))); n += 1; } if ((((1 << (mcReserved_recordtok-mcReserved_recordtok)) & (stopset2)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "RECORD", 6))); n += 1; } if ((((1 << (mcReserved_unqualifiedtok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "UNQUALIFIED", 11))); n += 1; } if ((((1 << (mcReserved_qualifiedtok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "QUALIFIED", 9))); n += 1; } if ((((1 << (mcReserved_proceduretok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "PROCEDURE", 9))); n += 1; } if ((((1 << (mcReserved_pointertok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "POINTER", 7))); n += 1; } if ((((1 << (mcReserved_packedsettok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "PACKEDSET", 9))); n += 1; } if ((((1 << (mcReserved_ortok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "OR", 2))); n += 1; } if ((((1 << (mcReserved_oftok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "OF", 2))); n += 1; } if ((((1 << (mcReserved_nottok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "NOT", 3))); n += 1; } if ((((1 << (mcReserved_moduletok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "MODULE", 6))); n += 1; } if ((((1 << (mcReserved_modtok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "MOD", 3))); n += 1; } if ((((1 << (mcReserved_looptok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "LOOP", 4))); n += 1; } if ((((1 << (mcReserved_intok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "IN", 2))); n += 1; } if ((((1 << (mcReserved_importtok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "IMPORT", 6))); n += 1; } if ((((1 << (mcReserved_implementationtok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "IMPLEMENTATION", 14))); n += 1; } if ((((1 << (mcReserved_iftok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "IF", 2))); n += 1; } if ((((1 << (mcReserved_fromtok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "FROM", 4))); n += 1; } if ((((1 << (mcReserved_fortok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "FOR", 3))); n += 1; } if ((((1 << (mcReserved_finallytok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "FINALLY", 7))); n += 1; } if ((((1 << (mcReserved_exporttok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "EXPORT", 6))); n += 1; } if ((((1 << (mcReserved_exittok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "EXIT", 4))); n += 1; } if ((((1 << (mcReserved_excepttok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "EXCEPT", 6))); n += 1; } if ((((1 << (mcReserved_endtok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "END", 3))); n += 1; } if ((((1 << (mcReserved_elsiftok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "ELSIF", 5))); n += 1; } if ((((1 << (mcReserved_elsetok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "ELSE", 4))); n += 1; } if ((((1 << (mcReserved_dotok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "DO", 2))); n += 1; } if ((((1 << (mcReserved_divtok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "DIV", 3))); n += 1; } if ((((1 << (mcReserved_definitiontok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "DEFINITION", 10))); n += 1; } if ((((1 << (mcReserved_consttok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "CONST", 5))); n += 1; } if ((((1 << (mcReserved_casetok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "CASE", 4))); n += 1; } if ((((1 << (mcReserved_bytok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "BY", 2))); n += 1; } if ((((1 << (mcReserved_begintok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "BEGIN", 5))); n += 1; } if ((((1 << (mcReserved_arraytok-mcReserved_arraytok)) & (stopset1)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "ARRAY", 5))); n += 1; } if ((((1 << (mcReserved_andtok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "AND", 3))); n += 1; } if ((((1 << (mcReserved_colontok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) ":", 1))); n += 1; } if ((((1 << (mcReserved_periodperiodtok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "..", 2))); n += 1; } if ((((1 << (mcReserved_rdirectivetok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "*>", 2))); n += 1; } if ((((1 << (mcReserved_ldirectivetok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "<*", 2))); n += 1; } if ((((1 << (mcReserved_greaterequaltok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) ">=", 2))); n += 1; } if ((((1 << (mcReserved_lessequaltok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "<=", 2))); n += 1; } if ((((1 << (mcReserved_lessgreatertok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "<>", 2))); n += 1; } if ((((1 << (mcReserved_hashtok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "#", 1))); n += 1; } if ((((1 << (mcReserved_equaltok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "=", 1))); n += 1; } if ((((1 << (mcReserved_uparrowtok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "^", 1))); n += 1; } if ((((1 << (mcReserved_semicolontok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) ";", 1))); n += 1; } if ((((1 << (mcReserved_commatok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) ",", 1))); n += 1; } if ((((1 << (mcReserved_periodtok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) ".", 1))); n += 1; } if ((((1 << (mcReserved_ambersandtok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "&", 1))); n += 1; } if ((((1 << (mcReserved_dividetok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "/", 1))); n += 1; } if ((((1 << (mcReserved_timestok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "*", 1))); n += 1; } if ((((1 << (mcReserved_minustok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "-", 1))); n += 1; } if ((((1 << (mcReserved_plustok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "+", 1))); n += 1; } if ((((1 << (mcReserved_doublequotestok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCatChar (DynamicStrings_ConCatChar (DynamicStrings_ConCatChar (DynamicStrings_ConCatChar (DynamicStrings_ConCatChar (message, ' '), '`'), '"'), '\''), ','); n += 1; } if ((((1 << (mcReserved_singlequotetok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCatChar (DynamicStrings_ConCatChar (DynamicStrings_ConCatChar (DynamicStrings_ConCatChar (DynamicStrings_ConCatChar (message, ' '), '"'), '\''), '"'), ','); n += 1; } if ((((1 << (mcReserved_greatertok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) ">", 1))); n += 1; } if ((((1 << (mcReserved_lesstok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "<", 1))); n += 1; } if ((((1 << (mcReserved_rparatok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) ")", 1))); n += 1; } if ((((1 << (mcReserved_lparatok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "(", 1))); n += 1; } if ((((1 << (mcReserved_rcbratok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "}", 1))); n += 1; } if ((((1 << (mcReserved_lcbratok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "{", 1))); n += 1; } if ((((1 << (mcReserved_rsbratok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "]", 1))); n += 1; } if ((((1 << (mcReserved_lsbratok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "[", 1))); n += 1; } if ((((1 << (mcReserved_bartok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "|", 1))); n += 1; } if ((((1 << (mcReserved_becomestok-mcReserved_eoftok)) & (stopset0)) != 0)) { message = DynamicStrings_ConCat (DynamicStrings_ConCatChar (message, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) ":=", 2))); n += 1; } if ((((1 << (mcReserved_eoftok-mcReserved_eoftok)) & (stopset0)) != 0)) {} /* empty. */ /* eoftok has no token name (needed to generate error messages) */ if (n == 0) { str = DynamicStrings_InitString ((const char *) " syntax error", 13); message = DynamicStrings_KillString (message); } else if (n == 1) { /* avoid dangling else. */ str = DynamicStrings_ConCat (message, DynamicStrings_Mark (DynamicStrings_InitString ((const char *) " missing ", 9))); } else { /* avoid dangling else. */ str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) " expecting one of", 17), message); message = DynamicStrings_KillString (message); } return str; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } /* DescribeError - issues a message explaining what tokens were expected */ static void DescribeError (void) { DynamicStrings_String str; str = DynamicStrings_InitString ((const char *) "", 0); switch (mcLexBuf_currenttoken) { case mcReserved_stringtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found string", 26), DynamicStrings_Mark (str)); break; case mcReserved_realtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found real number", 31), DynamicStrings_Mark (str)); break; case mcReserved_identtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found identifier", 30), DynamicStrings_Mark (str)); break; case mcReserved_integertok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found integer number", 34), DynamicStrings_Mark (str)); break; case mcReserved_inlinetok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found __INLINE__", 30), DynamicStrings_Mark (str)); break; case mcReserved_builtintok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found __BUILTIN__", 31), DynamicStrings_Mark (str)); break; case mcReserved_attributetok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found __ATTRIBUTE__", 33), DynamicStrings_Mark (str)); break; case mcReserved_filetok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found __FILE__", 28), DynamicStrings_Mark (str)); break; case mcReserved_linetok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found __LINE__", 28), DynamicStrings_Mark (str)); break; case mcReserved_datetok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found __DATE__", 28), DynamicStrings_Mark (str)); break; case mcReserved_periodperiodperiodtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found ...", 23), DynamicStrings_Mark (str)); break; case mcReserved_volatiletok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found VOLATILE", 28), DynamicStrings_Mark (str)); break; case mcReserved_asmtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found ASM", 23), DynamicStrings_Mark (str)); break; case mcReserved_withtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found WITH", 24), DynamicStrings_Mark (str)); break; case mcReserved_whiletok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found WHILE", 25), DynamicStrings_Mark (str)); break; case mcReserved_vartok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found VAR", 23), DynamicStrings_Mark (str)); break; case mcReserved_untiltok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found UNTIL", 25), DynamicStrings_Mark (str)); break; case mcReserved_typetok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found TYPE", 24), DynamicStrings_Mark (str)); break; case mcReserved_totok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found TO", 22), DynamicStrings_Mark (str)); break; case mcReserved_thentok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found THEN", 24), DynamicStrings_Mark (str)); break; case mcReserved_settok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found SET", 23), DynamicStrings_Mark (str)); break; case mcReserved_returntok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found RETURN", 26), DynamicStrings_Mark (str)); break; case mcReserved_retrytok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found RETRY", 25), DynamicStrings_Mark (str)); break; case mcReserved_repeattok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found REPEAT", 26), DynamicStrings_Mark (str)); break; case mcReserved_remtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found REM", 23), DynamicStrings_Mark (str)); break; case mcReserved_recordtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found RECORD", 26), DynamicStrings_Mark (str)); break; case mcReserved_unqualifiedtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found UNQUALIFIED", 31), DynamicStrings_Mark (str)); break; case mcReserved_qualifiedtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found QUALIFIED", 29), DynamicStrings_Mark (str)); break; case mcReserved_proceduretok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found PROCEDURE", 29), DynamicStrings_Mark (str)); break; case mcReserved_pointertok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found POINTER", 27), DynamicStrings_Mark (str)); break; case mcReserved_packedsettok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found PACKEDSET", 29), DynamicStrings_Mark (str)); break; case mcReserved_ortok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found OR", 22), DynamicStrings_Mark (str)); break; case mcReserved_oftok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found OF", 22), DynamicStrings_Mark (str)); break; case mcReserved_nottok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found NOT", 23), DynamicStrings_Mark (str)); break; case mcReserved_moduletok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found MODULE", 26), DynamicStrings_Mark (str)); break; case mcReserved_modtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found MOD", 23), DynamicStrings_Mark (str)); break; case mcReserved_looptok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found LOOP", 24), DynamicStrings_Mark (str)); break; case mcReserved_intok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found IN", 22), DynamicStrings_Mark (str)); break; case mcReserved_importtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found IMPORT", 26), DynamicStrings_Mark (str)); break; case mcReserved_implementationtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found IMPLEMENTATION", 34), DynamicStrings_Mark (str)); break; case mcReserved_iftok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found IF", 22), DynamicStrings_Mark (str)); break; case mcReserved_fromtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found FROM", 24), DynamicStrings_Mark (str)); break; case mcReserved_fortok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found FOR", 23), DynamicStrings_Mark (str)); break; case mcReserved_finallytok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found FINALLY", 27), DynamicStrings_Mark (str)); break; case mcReserved_exporttok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found EXPORT", 26), DynamicStrings_Mark (str)); break; case mcReserved_exittok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found EXIT", 24), DynamicStrings_Mark (str)); break; case mcReserved_excepttok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found EXCEPT", 26), DynamicStrings_Mark (str)); break; case mcReserved_endtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found END", 23), DynamicStrings_Mark (str)); break; case mcReserved_elsiftok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found ELSIF", 25), DynamicStrings_Mark (str)); break; case mcReserved_elsetok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found ELSE", 24), DynamicStrings_Mark (str)); break; case mcReserved_dotok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found DO", 22), DynamicStrings_Mark (str)); break; case mcReserved_divtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found DIV", 23), DynamicStrings_Mark (str)); break; case mcReserved_definitiontok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found DEFINITION", 30), DynamicStrings_Mark (str)); break; case mcReserved_consttok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found CONST", 25), DynamicStrings_Mark (str)); break; case mcReserved_casetok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found CASE", 24), DynamicStrings_Mark (str)); break; case mcReserved_bytok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found BY", 22), DynamicStrings_Mark (str)); break; case mcReserved_begintok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found BEGIN", 25), DynamicStrings_Mark (str)); break; case mcReserved_arraytok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found ARRAY", 25), DynamicStrings_Mark (str)); break; case mcReserved_andtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found AND", 23), DynamicStrings_Mark (str)); break; case mcReserved_colontok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found :", 21), DynamicStrings_Mark (str)); break; case mcReserved_periodperiodtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found ..", 22), DynamicStrings_Mark (str)); break; case mcReserved_rdirectivetok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found *>", 22), DynamicStrings_Mark (str)); break; case mcReserved_ldirectivetok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found <*", 22), DynamicStrings_Mark (str)); break; case mcReserved_greaterequaltok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found >=", 22), DynamicStrings_Mark (str)); break; case mcReserved_lessequaltok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found <=", 22), DynamicStrings_Mark (str)); break; case mcReserved_lessgreatertok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found <>", 22), DynamicStrings_Mark (str)); break; case mcReserved_hashtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found #", 21), DynamicStrings_Mark (str)); break; case mcReserved_equaltok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found =", 21), DynamicStrings_Mark (str)); break; case mcReserved_uparrowtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found ^", 21), DynamicStrings_Mark (str)); break; case mcReserved_semicolontok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found ;", 21), DynamicStrings_Mark (str)); break; case mcReserved_commatok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found ,", 21), DynamicStrings_Mark (str)); break; case mcReserved_periodtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found .", 21), DynamicStrings_Mark (str)); break; case mcReserved_ambersandtok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found &", 21), DynamicStrings_Mark (str)); break; case mcReserved_dividetok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found /", 21), DynamicStrings_Mark (str)); break; case mcReserved_timestok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found *", 21), DynamicStrings_Mark (str)); break; case mcReserved_minustok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found -", 21), DynamicStrings_Mark (str)); break; case mcReserved_plustok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found +", 21), DynamicStrings_Mark (str)); break; case mcReserved_doublequotestok: str = DynamicStrings_ConCat (DynamicStrings_ConCatChar (DynamicStrings_ConCatChar (DynamicStrings_InitString ((const char *) "syntax error, found '", 21), '"'), '\''), DynamicStrings_Mark (str)); break; case mcReserved_singlequotetok: str = DynamicStrings_ConCat (DynamicStrings_ConCatChar (DynamicStrings_ConCatChar (DynamicStrings_InitString ((const char *) "syntax error, found \"", 21), '\''), '"'), DynamicStrings_Mark (str)); break; case mcReserved_greatertok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found >", 21), DynamicStrings_Mark (str)); break; case mcReserved_lesstok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found <", 21), DynamicStrings_Mark (str)); break; case mcReserved_rparatok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found )", 21), DynamicStrings_Mark (str)); break; case mcReserved_lparatok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found (", 21), DynamicStrings_Mark (str)); break; case mcReserved_rcbratok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found }", 21), DynamicStrings_Mark (str)); break; case mcReserved_lcbratok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found {", 21), DynamicStrings_Mark (str)); break; case mcReserved_rsbratok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found ]", 21), DynamicStrings_Mark (str)); break; case mcReserved_lsbratok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found [", 21), DynamicStrings_Mark (str)); break; case mcReserved_bartok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found |", 21), DynamicStrings_Mark (str)); break; case mcReserved_becomestok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found :=", 22), DynamicStrings_Mark (str)); break; case mcReserved_eoftok: str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error, found ", 20), DynamicStrings_Mark (str)); break; default: break; } ErrorString (str); } /* SyntaxError - after a syntax error we skip all tokens up until we reach a stop symbol. */ static void SyntaxError (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { DescribeError (); if (Debugging) { mcPrintf_printf0 ((const char *) "\\nskipping token *** ", 21); } /* yes the ORD(currenttoken) looks ugly, but it is *much* safer than using currenttoken= 32) && ( ((unsigned int) (mcLexBuf_currenttoken)) < 64)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (mcLexBuf_currenttoken)) >= 64) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & (stopset2)) != 0))))) { mcLexBuf_getToken (); } if (Debugging) { mcPrintf_printf0 ((const char *) " ***\\n", 6); } } /* SyntaxCheck - */ static void SyntaxCheck (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { /* and again (see above re: ORD) */ if (! (((( ((unsigned int) (mcLexBuf_currenttoken)) < 32) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (mcLexBuf_currenttoken)) >= 32) && ( ((unsigned int) (mcLexBuf_currenttoken)) < 64)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (mcLexBuf_currenttoken)) >= 64) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & (stopset2)) != 0))))) { SyntaxError (stopset0, stopset1, stopset2); } } /* WarnMissingToken - generates a warning message about a missing token, t. */ static void WarnMissingToken (mcReserved_toktype t) { mcp4_SetOfStop0 s0; mcp4_SetOfStop1 s1; mcp4_SetOfStop2 s2; DynamicStrings_String str; s0 = (mcp4_SetOfStop0) 0; s1 = (mcp4_SetOfStop1) 0; s2 = (mcp4_SetOfStop2) 0; if ( ((unsigned int) (t)) < 32) { s0 = (mcp4_SetOfStop0) ((1 << (t-mcReserved_eoftok))); } else if ( ((unsigned int) (t)) < 64) { /* avoid dangling else. */ s1 = (mcp4_SetOfStop1) ((1 << (t-mcReserved_arraytok))); } else { /* avoid dangling else. */ s2 = (mcp4_SetOfStop2) ((1 << (t-mcReserved_recordtok))); } str = DescribeStop (s0, s1, s2); str = DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "syntax error,", 13), DynamicStrings_Mark (str)); mcError_errorStringAt (str, mcLexBuf_getTokenNo ()); } /* MissingToken - generates a warning message about a missing token, t. */ static void MissingToken (mcReserved_toktype t) { WarnMissingToken (t); if ((((t != mcReserved_identtok) && (t != mcReserved_integertok)) && (t != mcReserved_realtok)) && (t != mcReserved_stringtok)) { if (Debugging) { mcPrintf_printf0 ((const char *) "inserting token\\n", 17); } mcLexBuf_insertToken (t); } } /* CheckAndInsert - */ static unsigned int CheckAndInsert (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (((( ((unsigned int) (t)) < 32) && ((((1 << (t-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (t)) >= 32) && ( ((unsigned int) (t)) < 64)) && ((((1 << (t-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (t)) >= 64) && ((((1 << (t-mcReserved_recordtok)) & (stopset2)) != 0)))) { WarnMissingToken (t); mcLexBuf_insertTokenAndRewind (t); return TRUE; } else { return FALSE; } /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } /* InStopSet */ static unsigned int InStopSet (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (((( ((unsigned int) (t)) < 32) && ((((1 << (t-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (t)) >= 32) && ( ((unsigned int) (t)) < 64)) && ((((1 << (t-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (t)) >= 64) && ((((1 << (t-mcReserved_recordtok)) & (stopset2)) != 0)))) { return TRUE; } else { return FALSE; } /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } /* PeepToken - peep token checks to see whether the stopset is satisfied by currenttoken If it is not then it will insert a token providing the token is one of ; ] ) } . OF END , if the stopset contains then we do not insert a token */ static void PeepToken (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { /* and again (see above re: ORD) */ if ((! (((( ((unsigned int) (mcLexBuf_currenttoken)) < 32) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (mcLexBuf_currenttoken)) >= 32) && ( ((unsigned int) (mcLexBuf_currenttoken)) < 64)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (mcLexBuf_currenttoken)) >= 64) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & (stopset2)) != 0))))) && (! (InStopSet (mcReserved_identtok, stopset0, stopset1, stopset2)))) { /* SyntaxCheck would fail since currentoken is not part of the stopset we check to see whether any of currenttoken might be a commonly omitted token */ if ((((((((CheckAndInsert (mcReserved_semicolontok, stopset0, stopset1, stopset2)) || (CheckAndInsert (mcReserved_rsbratok, stopset0, stopset1, stopset2))) || (CheckAndInsert (mcReserved_rparatok, stopset0, stopset1, stopset2))) || (CheckAndInsert (mcReserved_rcbratok, stopset0, stopset1, stopset2))) || (CheckAndInsert (mcReserved_periodtok, stopset0, stopset1, stopset2))) || (CheckAndInsert (mcReserved_oftok, stopset0, stopset1, stopset2))) || (CheckAndInsert (mcReserved_endtok, stopset0, stopset1, stopset2))) || (CheckAndInsert (mcReserved_commatok, stopset0, stopset1, stopset2))) {} /* empty. */ } } /* Expect - */ static void Expect (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == t) { /* avoid dangling else. */ mcLexBuf_getToken (); if (Pass1) { PeepToken (stopset0, stopset1, stopset2); } } else { MissingToken (t); } SyntaxCheck (stopset0, stopset1, stopset2); } /* Ident - error checking varient of Ident */ static void Ident (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { curident = nameKey_makekey (mcLexBuf_currentstring); Expect (mcReserved_identtok, stopset0, stopset1, stopset2); } /* string - */ static void string (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { curstring = nameKey_makekey (mcLexBuf_currentstring); Expect (mcReserved_stringtok, stopset0, stopset1, stopset2); } /* Integer - */ static void Integer (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node n; n = push (decl_makeLiteralInt (nameKey_makekey (mcLexBuf_currentstring))); Expect (mcReserved_integertok, stopset0, stopset1, stopset2); } /* Real - */ static void Real (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node n; n = push (decl_makeLiteralReal (nameKey_makekey (mcLexBuf_currentstring))); Expect (mcReserved_realtok, stopset0, stopset1, stopset2); } /* FileUnit := DefinitionModule | ImplementationOrProgramModule first symbols:implementationtok, moduletok, definitiontok cannot reachend */ static void FileUnit (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_definitiontok) { DefinitionModule (stopset0, stopset1, stopset2); } else if (((mcLexBuf_currenttoken >= mcReserved_arraytok) && (mcLexBuf_currenttoken < mcReserved_recordtok)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & ((mcp4_SetOfStop1) ((1 << (mcReserved_implementationtok-mcReserved_arraytok)) | (1 << (mcReserved_moduletok-mcReserved_arraytok))))) != 0))) { /* avoid dangling else. */ ImplementationOrProgramModule (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: IMPLEMENTATION MODULE DEFINITION", 50); } } /* ProgramModule := 'MODULE' Ident % curmodule := lookupModule (curident) % % enterScope (curmodule) % % resetConstExpPos (curmodule) % [ Priority ] ';' { Import } Block Ident % checkEndName (curmodule, curident, 'program module') % % leaveScope % '.' first symbols:moduletok cannot reachend */ static void ProgramModule (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_moduletok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2); curmodule = decl_lookupModule (curident); decl_enterScope (curmodule); decl_resetConstExpPos (curmodule); if (mcLexBuf_currenttoken == mcReserved_lsbratok) { Priority (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); } Expect (mcReserved_semicolontok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_importtok-mcReserved_arraytok)) | (1 << (mcReserved_fromtok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_finallytok-mcReserved_arraytok)) | (1 << (mcReserved_begintok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_moduletok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_typetok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)))); while (((mcLexBuf_currenttoken >= mcReserved_arraytok) && (mcLexBuf_currenttoken < mcReserved_recordtok)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & ((mcp4_SetOfStop1) ((1 << (mcReserved_fromtok-mcReserved_arraytok)) | (1 << (mcReserved_importtok-mcReserved_arraytok))))) != 0))) { Import (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_fromtok-mcReserved_arraytok)) | (1 << (mcReserved_importtok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_begintok-mcReserved_arraytok)) | (1 << (mcReserved_finallytok-mcReserved_arraytok)) | (1 << (mcReserved_moduletok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_vartok-mcReserved_recordtok)) | (1 << (mcReserved_typetok-mcReserved_recordtok)))); } /* while */ Block (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodtok-mcReserved_eoftok))), stopset1, stopset2); checkEndName (curmodule, curident, (const char *) "program module", 14); decl_leaveScope (); Expect (mcReserved_periodtok, stopset0, stopset1, stopset2); } /* ImplementationModule := 'IMPLEMENTATION' 'MODULE' Ident % curmodule := lookupImp (curident) % % enterScope (lookupDef (curident)) % % enterScope (curmodule) % % resetConstExpPos (curmodule) % [ Priority ] ';' { Import } Block Ident % checkEndName (curmodule, curident, 'implementation module') % % leaveScope ; leaveScope % '.' first symbols:implementationtok cannot reachend */ static void ImplementationModule (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_implementationtok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_moduletok-mcReserved_arraytok))), stopset2); Expect (mcReserved_moduletok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2); curmodule = decl_lookupImp (curident); decl_enterScope (decl_lookupDef (curident)); decl_enterScope (curmodule); decl_resetConstExpPos (curmodule); if (mcLexBuf_currenttoken == mcReserved_lsbratok) { Priority (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); } Expect (mcReserved_semicolontok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_importtok-mcReserved_arraytok)) | (1 << (mcReserved_fromtok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_finallytok-mcReserved_arraytok)) | (1 << (mcReserved_begintok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_moduletok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_typetok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)))); while (((mcLexBuf_currenttoken >= mcReserved_arraytok) && (mcLexBuf_currenttoken < mcReserved_recordtok)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & ((mcp4_SetOfStop1) ((1 << (mcReserved_fromtok-mcReserved_arraytok)) | (1 << (mcReserved_importtok-mcReserved_arraytok))))) != 0))) { Import (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_fromtok-mcReserved_arraytok)) | (1 << (mcReserved_importtok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_begintok-mcReserved_arraytok)) | (1 << (mcReserved_finallytok-mcReserved_arraytok)) | (1 << (mcReserved_moduletok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_vartok-mcReserved_recordtok)) | (1 << (mcReserved_typetok-mcReserved_recordtok)))); } /* while */ Block (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodtok-mcReserved_eoftok))), stopset1, stopset2); checkEndName (curmodule, curident, (const char *) "implementation module", 21); decl_leaveScope (); decl_leaveScope (); Expect (mcReserved_periodtok, stopset0, stopset1, stopset2); } /* ImplementationOrProgramModule := ImplementationModule | ProgramModule first symbols:moduletok, implementationtok cannot reachend */ static void ImplementationOrProgramModule (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_implementationtok) { ImplementationModule (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_moduletok) { /* avoid dangling else. */ ProgramModule (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: MODULE IMPLEMENTATION", 39); } } /* Number := Integer | Real first symbols:realtok, integertok cannot reachend */ static void Number (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_integertok) { Integer (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_realtok) { /* avoid dangling else. */ Real (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: real number integer number", 44); } } /* Qualident := Ident { '.' Ident } first symbols:identtok cannot reachend */ static void Qualident (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodtok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_periodtok) { Expect (mcReserved_periodtok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodtok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* ConstantDeclaration := % VAR d, e: node ; % Ident % d := lookupSym (curident) % '=' ConstExpression % e := pop () % % assert (isConst (d)) % % putConst (d, e) % first symbols:identtok cannot reachend */ static void ConstantDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node d; decl_node e; Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_equaltok-mcReserved_eoftok))), stopset1, stopset2); d = decl_lookupSym (curident); Expect (mcReserved_equaltok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0, stopset1, stopset2); e = pop (); mcDebug_assert (decl_isConst (d)); decl_putConst (d, e); } /* ConstExpression := % VAR c, l, r: node ; op: toktype ; d: CARDINAL ; % % d := depth () % % c := push (getNextConstExp ()) % SimpleConstExpr % op := currenttoken % [ Relation SimpleConstExpr % r := pop () % % l := pop () % % l := push (makeBinaryTok (op, l, r)) % ] % c := replace (fixupConstExp (c, pop ())) % % assert (d+1 = depth ()) % first symbols:identtok, attributetok, lcbratok, stringtok, nottok, lparatok, integertok, realtok, minustok, plustok cannot reachend */ static void ConstExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node c; decl_node l; decl_node r; mcReserved_toktype op; unsigned int d; d = depth (); c = push (decl_getNextConstExp ()); SimpleConstExpr (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_greaterequaltok-mcReserved_eoftok)) | (1 << (mcReserved_greatertok-mcReserved_eoftok)) | (1 << (mcReserved_lessequaltok-mcReserved_eoftok)) | (1 << (mcReserved_lesstok-mcReserved_eoftok)) | (1 << (mcReserved_lessgreatertok-mcReserved_eoftok)) | (1 << (mcReserved_hashtok-mcReserved_eoftok)) | (1 << (mcReserved_equaltok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_intok-mcReserved_arraytok))), stopset2); op = mcLexBuf_currenttoken; if (((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_equaltok-mcReserved_eoftok)) | (1 << (mcReserved_hashtok-mcReserved_eoftok)) | (1 << (mcReserved_lessgreatertok-mcReserved_eoftok)) | (1 << (mcReserved_lesstok-mcReserved_eoftok)) | (1 << (mcReserved_lessequaltok-mcReserved_eoftok)) | (1 << (mcReserved_greatertok-mcReserved_eoftok)) | (1 << (mcReserved_greaterequaltok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_intok)) { Relation (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); SimpleConstExpr (stopset0, stopset1, stopset2); r = pop (); l = pop (); l = push (decl_makeBinaryTok (op, l, r)); } c = replace (decl_fixupConstExp (c, pop ())); mcDebug_assert ((d+1) == (depth ())); } /* Relation := '=' | '#' | '<>' | '<' | '<=' | '>' | '>=' | 'IN' first symbols:intok, greaterequaltok, greatertok, lessequaltok, lesstok, lessgreatertok, hashtok, equaltok cannot reachend */ static void Relation (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_equaltok) { Expect (mcReserved_equaltok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_hashtok) { /* avoid dangling else. */ Expect (mcReserved_hashtok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_lessgreatertok) { /* avoid dangling else. */ Expect (mcReserved_lessgreatertok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_lesstok) { /* avoid dangling else. */ Expect (mcReserved_lesstok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_lessequaltok) { /* avoid dangling else. */ Expect (mcReserved_lessequaltok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_greatertok) { /* avoid dangling else. */ Expect (mcReserved_greatertok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_greaterequaltok) { /* avoid dangling else. */ Expect (mcReserved_greaterequaltok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_intok) { /* avoid dangling else. */ Expect (mcReserved_intok, stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: IN >= > <= < <> # =", 37); } } /* SimpleConstExpr := % VAR op: toktype ; n: node ; % UnaryOrConstTerm % n := pop () % { % op := currenttoken % AddOperator ConstTerm % n := makeBinaryTok (op, n, pop ()) % } % n := push (n) % first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok cannot reachend */ static void SimpleConstExpr (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { mcReserved_toktype op; decl_node n; UnaryOrConstTerm (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_ortok-mcReserved_arraytok))), stopset2); n = pop (); while (((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_ortok)) { op = mcLexBuf_currenttoken; AddOperator (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstTerm (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_ortok-mcReserved_arraytok))), stopset2); n = decl_makeBinaryTok (op, n, pop ()); } /* while */ n = push (n); } /* UnaryOrConstTerm := % VAR n: node ; % '+' ConstTerm % n := push (makeUnaryTok (plustok, pop ())) % | '-' ConstTerm % n := push (makeUnaryTok (minustok, pop ())) % | ConstTerm first symbols:identtok, attributetok, lcbratok, stringtok, nottok, lparatok, integertok, realtok, minustok, plustok cannot reachend */ static void UnaryOrConstTerm (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node n; if (mcLexBuf_currenttoken == mcReserved_plustok) { Expect (mcReserved_plustok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstTerm (stopset0, stopset1, stopset2); n = push (decl_makeUnaryTok (mcReserved_plustok, pop ())); } else if (mcLexBuf_currenttoken == mcReserved_minustok) { /* avoid dangling else. */ Expect (mcReserved_minustok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstTerm (stopset0, stopset1, stopset2); n = push (decl_makeUnaryTok (mcReserved_minustok, pop ())); } else if ((((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_nottok)) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { /* avoid dangling else. */ ConstTerm (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: NOT ( integer number real number __ATTRIBUTE__ { string identifier - +", 88); } } /* AddOperator := '+' | '-' | 'OR' first symbols:ortok, minustok, plustok cannot reachend */ static void AddOperator (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_plustok) { Expect (mcReserved_plustok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_minustok) { /* avoid dangling else. */ Expect (mcReserved_minustok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_ortok) { /* avoid dangling else. */ Expect (mcReserved_ortok, stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: OR - +", 24); } } /* ConstTerm := % VAR op: toktype ; n: node ; % ConstFactor % n := pop () % { % op := currenttoken % MulOperator ConstFactor % n := makeBinaryTok (op, n, pop ()) % } % n := push (n) % first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok cannot reachend */ static void ConstTerm (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { mcReserved_toktype op; decl_node n; ConstFactor (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_ambersandtok-mcReserved_eoftok)) | (1 << (mcReserved_andtok-mcReserved_eoftok)) | (1 << (mcReserved_dividetok-mcReserved_eoftok)) | (1 << (mcReserved_timestok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_modtok-mcReserved_arraytok)) | (1 << (mcReserved_divtok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_remtok-mcReserved_recordtok)))); n = pop (); while ((((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_timestok-mcReserved_eoftok)) | (1 << (mcReserved_dividetok-mcReserved_eoftok)) | (1 << (mcReserved_andtok-mcReserved_eoftok)) | (1 << (mcReserved_ambersandtok-mcReserved_eoftok))))) != 0))) || (((mcLexBuf_currenttoken >= mcReserved_arraytok) && (mcLexBuf_currenttoken < mcReserved_recordtok)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & ((mcp4_SetOfStop1) ((1 << (mcReserved_divtok-mcReserved_arraytok)) | (1 << (mcReserved_modtok-mcReserved_arraytok))))) != 0)))) || (mcLexBuf_currenttoken == mcReserved_remtok)) { op = mcLexBuf_currenttoken; MulOperator (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstFactor (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_timestok-mcReserved_eoftok)) | (1 << (mcReserved_dividetok-mcReserved_eoftok)) | (1 << (mcReserved_andtok-mcReserved_eoftok)) | (1 << (mcReserved_ambersandtok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_divtok-mcReserved_arraytok)) | (1 << (mcReserved_modtok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_remtok-mcReserved_recordtok)))); n = decl_makeBinaryTok (op, n, pop ()); } /* while */ n = push (n); } /* MulOperator := '*' | '/' | 'DIV' | 'MOD' | 'REM' | 'AND' | '&' first symbols:ambersandtok, andtok, remtok, modtok, divtok, dividetok, timestok cannot reachend */ static void MulOperator (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_timestok) { Expect (mcReserved_timestok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_dividetok) { /* avoid dangling else. */ Expect (mcReserved_dividetok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_divtok) { /* avoid dangling else. */ Expect (mcReserved_divtok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_modtok) { /* avoid dangling else. */ Expect (mcReserved_modtok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_remtok) { /* avoid dangling else. */ Expect (mcReserved_remtok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_andtok) { /* avoid dangling else. */ Expect (mcReserved_andtok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_ambersandtok) { /* avoid dangling else. */ Expect (mcReserved_ambersandtok, stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: & AND REM MOD DIV / *", 39); } } /* NotConstFactor := 'NOT' ConstFactor % VAR n: node ; % % n := push (makeUnaryTok (nottok, pop ())) % first symbols:nottok cannot reachend */ static void NotConstFactor (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node n; Expect (mcReserved_nottok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstFactor (stopset0, stopset1, stopset2); n = push (decl_makeUnaryTok (mcReserved_nottok, pop ())); } /* ConstFactor := Number | ConstString | ConstSetOrQualidentOrFunction | '(' ConstExpression ')' | NotConstFactor | ConstAttribute first symbols:identtok, attributetok, lcbratok, stringtok, nottok, lparatok, integertok, realtok cannot reachend */ static void ConstFactor (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok))))) != 0))) { Number (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_stringtok) { /* avoid dangling else. */ ConstString (stopset0, stopset1, stopset2); } else if ((mcLexBuf_currenttoken == mcReserved_lcbratok) || (mcLexBuf_currenttoken == mcReserved_identtok)) { /* avoid dangling else. */ ConstSetOrQualidentOrFunction (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_lparatok) { /* avoid dangling else. */ Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_nottok) { /* avoid dangling else. */ NotConstFactor (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_attributetok) { /* avoid dangling else. */ ConstAttribute (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: __ATTRIBUTE__ NOT ( { identifier string integer number real number", 84); } } /* ConstString := string % VAR n: node ; % % n := push (makeString (curstring)) % first symbols:stringtok cannot reachend */ static void ConstString (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node n; string (stopset0, stopset1, stopset2); n = push (decl_makeString (curstring)); } /* ConstComponentElement := ConstExpression % VAR l, h, n: node ; % % l := pop () % % h := NIL % [ '..' ConstExpression % h := pop () % % ErrorArray ('implementation restriction range is not allowed') % ] % n := push (includeSetValue (pop (), l, h)) % first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok cannot reachend */ static void ConstComponentElement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node l; decl_node h; decl_node n; ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodperiodtok-mcReserved_eoftok))), stopset1, stopset2); l = pop (); h = static_cast (NULL); if (mcLexBuf_currenttoken == mcReserved_periodperiodtok) { Expect (mcReserved_periodperiodtok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0, stopset1, stopset2); h = pop (); ErrorArray ((const char *) "implementation restriction range is not allowed", 47); } n = push (decl_includeSetValue (pop (), l, h)); } /* ConstComponentValue := ConstComponentElement [ 'BY' % ErrorArray ('implementation restriction BY not allowed') % ConstExpression ] first symbols:identtok, attributetok, lcbratok, stringtok, nottok, lparatok, integertok, realtok, minustok, plustok cannot reachend */ static void ConstComponentValue (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { ConstComponentElement (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_bytok-mcReserved_arraytok))), stopset2); if (mcLexBuf_currenttoken == mcReserved_bytok) { Expect (mcReserved_bytok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ErrorArray ((const char *) "implementation restriction BY not allowed", 41); ConstExpression (stopset0, stopset1, stopset2); } } /* ConstArraySetRecordValue := ConstComponentValue { ',' ConstComponentValue } first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok cannot reachend */ static void ConstArraySetRecordValue (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { ConstComponentValue (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstComponentValue (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* ConstConstructor := '{' % VAR n: node ; % % n := push (makeSetValue ()) % [ ConstArraySetRecordValue ] '}' first symbols:lcbratok cannot reachend */ static void ConstConstructor (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node n; Expect (mcReserved_lcbratok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rcbratok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); n = push (decl_makeSetValue ()); if ((((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_nottok)) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { ConstArraySetRecordValue (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rcbratok-mcReserved_eoftok))), stopset1, stopset2); } Expect (mcReserved_rcbratok, stopset0, stopset1, stopset2); } /* ConstSetOrQualidentOrFunction := % VAR q, p, n: node ; d: CARDINAL ; % % d := depth () % PushQualident % assert (d+1 = depth ()) % [ ConstConstructor % p := pop () % % q := pop () % % n := push (putSetValue (p, q)) % % assert (d+1 = depth ()) % | ConstActualParameters % p := pop () % % q := pop () % % n := push (makeFuncCall (q, p)) % % assert (d+1 = depth ()) % ] | % d := depth () % ConstConstructor % assert (d+1 = depth ()) % first symbols:identtok, lcbratok cannot reachend */ static void ConstSetOrQualidentOrFunction (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node q; decl_node p; decl_node n; unsigned int d; if (mcLexBuf_currenttoken == mcReserved_identtok) { /* avoid dangling else. */ d = depth (); PushQualident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lcbratok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2); mcDebug_assert ((d+1) == (depth ())); if ((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))))) != 0))) { /* avoid gcc warning by using compound statement even if not strictly necessary. */ /* seen optional [ | ] expression */ if (mcLexBuf_currenttoken == mcReserved_lcbratok) { ConstConstructor (stopset0, stopset1, stopset2); p = pop (); q = pop (); n = push (decl_putSetValue (p, q)); mcDebug_assert ((d+1) == (depth ())); } else if (mcLexBuf_currenttoken == mcReserved_lparatok) { /* avoid dangling else. */ ConstActualParameters (stopset0, stopset1, stopset2); p = pop (); q = pop (); n = push (decl_makeFuncCall (q, p)); mcDebug_assert ((d+1) == (depth ())); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: ( {", 21); } } /* end of optional [ | ] expression */ } else { d = depth (); ConstConstructor (stopset0, stopset1, stopset2); mcDebug_assert ((d+1) == (depth ())); } } /* ConstActualParameters := '(' % VAR n: node ; % % n := push (makeExpList ()) % [ ConstExpList ] ')' % assert (isExpList (peep ())) % first symbols:lparatok cannot reachend */ static void ConstActualParameters (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node n; Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); n = push (decl_makeExpList ()); if ((((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_nottok)) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { ConstExpList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); } Expect (mcReserved_rparatok, stopset0, stopset1, stopset2); mcDebug_assert (decl_isExpList (peep ())); } /* ConstExpList := % VAR p, n: node ; % % p := peep () % % assert (isExpList (p)) % ConstExpression % putExpList (p, pop ()) % % assert (p = peep ()) % % assert (isExpList (peep ())) % { ',' ConstExpression % putExpList (p, pop ()) % % assert (isExpList (peep ())) % } first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok cannot reachend */ static void ConstExpList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node p; decl_node n; p = peep (); mcDebug_assert (decl_isExpList (p)); ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); decl_putExpList (p, pop ()); mcDebug_assert (p == (peep ())); mcDebug_assert (decl_isExpList (peep ())); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); decl_putExpList (p, pop ()); mcDebug_assert (decl_isExpList (peep ())); } /* while */ } /* ConstAttribute := '__ATTRIBUTE__' '__BUILTIN__' '(' '(' ConstAttributeExpression ')' ')' first symbols:attributetok cannot reachend */ static void ConstAttribute (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_attributetok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_builtintok-mcReserved_recordtok)))); Expect (mcReserved_builtintok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lesstok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstAttributeExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0, stopset1, stopset2); } /* ConstAttributeExpression := Ident % VAR n: node ; % % n := push (getBuiltinConst (curident)) % | '<' Qualident ',' Ident '>' first symbols:lesstok, identtok cannot reachend */ static void ConstAttributeExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node n; if (mcLexBuf_currenttoken == mcReserved_identtok) { Ident (stopset0, stopset1, stopset2); n = push (decl_getBuiltinConst (curident)); } else if (mcLexBuf_currenttoken == mcReserved_lesstok) { /* avoid dangling else. */ Expect (mcReserved_lesstok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Qualident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_commatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_greatertok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_greatertok, stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: < identifier", 30); } } /* ByteAlignment := '' first symbols:ldirectivetok cannot reachend */ static void ByteAlignment (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_ldirectivetok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); AttributeExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rdirectivetok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rdirectivetok, stopset0, stopset1, stopset2); } /* OptAlignmentExpression := [ AlignmentExpression ] first symbols:lparatok reachend */ static void OptAlignmentExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_lparatok) { AlignmentExpression (stopset0, stopset1, stopset2); } } /* AlignmentExpression := '(' ConstExpression ')' first symbols:lparatok cannot reachend */ static void AlignmentExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0, stopset1, stopset2); } /* Alignment := [ ByteAlignment ] first symbols:ldirectivetok reachend */ static void Alignment (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_ldirectivetok) { ByteAlignment (stopset0, stopset1, stopset2); } } /* IdentList := Ident { ',' Ident } first symbols:identtok cannot reachend */ static void IdentList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* PushIdentList := % VAR n: node ; % % n := makeIdentList () % Ident % checkDuplicate (putIdent (n, curident)) % { ',' Ident % checkDuplicate (putIdent (n, curident)) % } % n := push (n) % first symbols:identtok cannot reachend */ static void PushIdentList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node n; n = decl_makeIdentList (); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); checkDuplicate (decl_putIdent (n, curident)); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); checkDuplicate (decl_putIdent (n, curident)); } /* while */ n = push (n); } /* SubrangeType := '[' ConstExpression '..' ConstExpression ']' first symbols:lsbratok cannot reachend */ static void SubrangeType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_lsbratok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodperiodtok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_periodperiodtok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rsbratok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rsbratok, stopset0, stopset1, stopset2); } /* ArrayType := 'ARRAY' SimpleType { ',' SimpleType } 'OF' Type first symbols:arraytok cannot reachend */ static void ArrayType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_arraytok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lsbratok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); SimpleType (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_oftok-mcReserved_arraytok))), stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lsbratok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); SimpleType (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_oftok-mcReserved_arraytok))), stopset2); } /* while */ Expect (mcReserved_oftok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_pointertok-mcReserved_arraytok)) | (1 << (mcReserved_packedsettok-mcReserved_arraytok)) | (1 << (mcReserved_oftok-mcReserved_arraytok)) | (1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_settok-mcReserved_recordtok)) | (1 << (mcReserved_recordtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Type (stopset0, stopset1, stopset2); } /* RecordType := 'RECORD' [ DefaultRecordAttributes ] FieldListSequence 'END' first symbols:recordtok cannot reachend */ static void RecordType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_recordtok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_ldirectivetok-mcReserved_eoftok)) | (1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); if (mcLexBuf_currenttoken == mcReserved_ldirectivetok) { DefaultRecordAttributes (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); } FieldListSequence (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok))), stopset2); Expect (mcReserved_endtok, stopset0, stopset1, stopset2); } /* DefaultRecordAttributes := '' first symbols:ldirectivetok cannot reachend */ static void DefaultRecordAttributes (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_ldirectivetok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); AttributeExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rdirectivetok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rdirectivetok, stopset0, stopset1, stopset2); } /* RecordFieldPragma := [ '' ] first symbols:ldirectivetok reachend */ static void RecordFieldPragma (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_ldirectivetok) { Expect (mcReserved_ldirectivetok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); FieldPragmaExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok)) | (1 << (mcReserved_rdirectivetok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); FieldPragmaExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rdirectivetok-mcReserved_eoftok)) | (1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ Expect (mcReserved_rdirectivetok, stopset0, stopset1, stopset2); } } /* FieldPragmaExpression := Ident PragmaConstExpression first symbols:identtok cannot reachend */ static void FieldPragmaExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2); PragmaConstExpression (stopset0, stopset1, stopset2); } /* PragmaConstExpression := [ '(' ConstExpression ')' ] first symbols:lparatok reachend */ static void PragmaConstExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_lparatok) { Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0, stopset1, stopset2); } } /* AttributeExpression := Ident '(' ConstExpression ')' first symbols:identtok cannot reachend */ static void AttributeExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0, stopset1, stopset2); } /* FieldListSequence := FieldListStatement { ';' FieldListStatement } first symbols:casetok, identtok, semicolontok reachend */ static void FieldListSequence (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { FieldListStatement (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_semicolontok) { Expect (mcReserved_semicolontok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_casetok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); FieldListStatement (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* FieldListStatement := [ FieldList ] first symbols:identtok, casetok reachend */ static void FieldListStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if ((mcLexBuf_currenttoken == mcReserved_casetok) || (mcLexBuf_currenttoken == mcReserved_identtok)) { FieldList (stopset0, stopset1, stopset2); } } /* FieldList := IdentList ':' Type RecordFieldPragma | 'CASE' CaseTag 'OF' Varient { '|' Varient } [ 'ELSE' FieldListSequence ] 'END' first symbols:casetok, identtok cannot reachend */ static void FieldList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_identtok) { IdentList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_colontok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_pointertok-mcReserved_arraytok)) | (1 << (mcReserved_packedsettok-mcReserved_arraytok)) | (1 << (mcReserved_oftok-mcReserved_arraytok)) | (1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_settok-mcReserved_recordtok)) | (1 << (mcReserved_recordtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Type (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_ldirectivetok-mcReserved_eoftok))), stopset1, stopset2); RecordFieldPragma (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_casetok) { /* avoid dangling else. */ Expect (mcReserved_casetok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_oftok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); CaseTag (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_oftok-mcReserved_arraytok))), stopset2); Expect (mcReserved_oftok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_bartok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_elsetok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Varient (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_bartok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_elsetok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok))), stopset2); while (mcLexBuf_currenttoken == mcReserved_bartok) { Expect (mcReserved_bartok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_bartok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_elsetok-mcReserved_arraytok)) | (1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Varient (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_bartok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_elsetok-mcReserved_arraytok))), stopset2); } /* while */ if (mcLexBuf_currenttoken == mcReserved_elsetok) { Expect (mcReserved_elsetok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); FieldListSequence (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok))), stopset2); } Expect (mcReserved_endtok, stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: CASE identifier", 33); } } /* TagIdent := Ident | % curident := NulName % first symbols:identtok reachend */ static void TagIdent (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_identtok) { Ident (stopset0, stopset1, stopset2); } else { curident = nameKey_NulName; } } /* CaseTag := TagIdent [ ':' Qualident ] first symbols:colontok, identtok reachend */ static void CaseTag (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { TagIdent (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_colontok) { Expect (mcReserved_colontok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Qualident (stopset0, stopset1, stopset2); } } /* Varient := [ VarientCaseLabelList ':' FieldListSequence ] first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok reachend */ static void Varient (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if ((((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_nottok)) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { VarientCaseLabelList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_colontok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_casetok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); FieldListSequence (stopset0, stopset1, stopset2); } } /* VarientCaseLabelList := VarientCaseLabels { ',' VarientCaseLabels } first symbols:identtok, attributetok, lcbratok, stringtok, nottok, lparatok, integertok, realtok, minustok, plustok cannot reachend */ static void VarientCaseLabelList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { VarientCaseLabels (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); VarientCaseLabels (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* VarientCaseLabels := ConstExpression [ '..' ConstExpression ] first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok cannot reachend */ static void VarientCaseLabels (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodperiodtok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_periodperiodtok) { Expect (mcReserved_periodperiodtok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0, stopset1, stopset2); } } /* SetType := ( 'SET' | 'PACKEDSET' ) 'OF' SimpleType first symbols:oftok, packedsettok, settok cannot reachend */ static void SetType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_settok) { Expect (mcReserved_settok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_oftok-mcReserved_arraytok))), stopset2); } else if (mcLexBuf_currenttoken == mcReserved_packedsettok) { /* avoid dangling else. */ Expect (mcReserved_packedsettok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_oftok-mcReserved_arraytok))), stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: PACKEDSET SET", 31); } Expect (mcReserved_oftok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lsbratok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); SimpleType (stopset0, stopset1, stopset2); } /* PointerType := 'POINTER' 'TO' Type first symbols:pointertok cannot reachend */ static void PointerType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_pointertok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_totok-mcReserved_recordtok)))); Expect (mcReserved_totok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_pointertok-mcReserved_arraytok)) | (1 << (mcReserved_packedsettok-mcReserved_arraytok)) | (1 << (mcReserved_oftok-mcReserved_arraytok)) | (1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_settok-mcReserved_recordtok)) | (1 << (mcReserved_recordtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Type (stopset0, stopset1, stopset2); } /* ProcedureType := 'PROCEDURE' [ FormalTypeList ] first symbols:proceduretok cannot reachend */ static void ProcedureType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_proceduretok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_lparatok) { FormalTypeList (stopset0, stopset1, stopset2); } } /* FormalTypeList := '(' ( ')' FormalReturn | ProcedureParameters ')' FormalReturn ) first symbols:lparatok cannot reachend */ static void FormalTypeList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_periodperiodperiodtok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); if (mcLexBuf_currenttoken == mcReserved_rparatok) { Expect (mcReserved_rparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); FormalReturn (stopset0, stopset1, stopset2); } else if ((mcLexBuf_currenttoken == mcReserved_arraytok) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_vartok-mcReserved_recordtok)) | (1 << (mcReserved_periodperiodperiodtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { /* avoid dangling else. */ ProcedureParameters (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); FormalReturn (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: VAR ... ARRAY identifier )", 44); } } /* FormalReturn := [ ':' OptReturnType ] first symbols:colontok reachend */ static void FormalReturn (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_colontok) { Expect (mcReserved_colontok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); OptReturnType (stopset0, stopset1, stopset2); } } /* OptReturnType := '[' Qualident ']' | Qualident first symbols:identtok, lsbratok cannot reachend */ static void OptReturnType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_lsbratok) { Expect (mcReserved_lsbratok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Qualident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rsbratok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rsbratok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_identtok) { /* avoid dangling else. */ Qualident (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: identifier [", 30); } } /* ProcedureParameters := ProcedureParameter { ',' ProcedureParameter } first symbols:identtok, arraytok, periodperiodperiodtok, vartok cannot reachend */ static void ProcedureParameters (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { ProcedureParameter (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_vartok-mcReserved_recordtok)) | (1 << (mcReserved_periodperiodperiodtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ProcedureParameter (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* ProcedureParameter := '...' | 'VAR' FormalType | FormalType first symbols:identtok, arraytok, vartok, periodperiodperiodtok cannot reachend */ static void ProcedureParameter (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_periodperiodperiodtok) { Expect (mcReserved_periodperiodperiodtok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_vartok) { /* avoid dangling else. */ Expect (mcReserved_vartok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); FormalType (stopset0, stopset1, stopset2); } else if ((mcLexBuf_currenttoken == mcReserved_arraytok) || (mcLexBuf_currenttoken == mcReserved_identtok)) { /* avoid dangling else. */ FormalType (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: ARRAY identifier VAR ...", 42); } } /* VarIdent := Ident [ '[' ConstExpression % VAR n: node ; % % n := pop () % ']' ] first symbols:identtok cannot reachend */ static void VarIdent (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { decl_node n; Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_lsbratok) { Expect (mcReserved_lsbratok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rsbratok-mcReserved_eoftok))), stopset1, stopset2); n = pop (); Expect (mcReserved_rsbratok, stopset0, stopset1, stopset2); } } /* VarIdentList := VarIdent { ',' VarIdent } first symbols:identtok cannot reachend */ static void VarIdentList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { VarIdent (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); VarIdent (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* VariableDeclaration := VarIdentList ':' Type Alignment first symbols:identtok cannot reachend */ static void VariableDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { VarIdentList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_colontok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_pointertok-mcReserved_arraytok)) | (1 << (mcReserved_packedsettok-mcReserved_arraytok)) | (1 << (mcReserved_oftok-mcReserved_arraytok)) | (1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_settok-mcReserved_recordtok)) | (1 << (mcReserved_recordtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Type (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_ldirectivetok-mcReserved_eoftok))), stopset1, stopset2); Alignment (stopset0, stopset1, stopset2); } /* Designator := Qualident { SubDesignator } first symbols:identtok cannot reachend */ static void Designator (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Qualident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_uparrowtok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok)) | (1 << (mcReserved_periodtok-mcReserved_eoftok))), stopset1, stopset2); while ((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_periodtok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok)) | (1 << (mcReserved_uparrowtok-mcReserved_eoftok))))) != 0))) { SubDesignator (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodtok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok)) | (1 << (mcReserved_uparrowtok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* SubDesignator := '.' Ident | '[' ArrayExpList ']' | '^' first symbols:uparrowtok, lsbratok, periodtok cannot reachend */ static void SubDesignator (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_periodtok) { Expect (mcReserved_periodtok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_lsbratok) { /* avoid dangling else. */ Expect (mcReserved_lsbratok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ArrayExpList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rsbratok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rsbratok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_uparrowtok) { /* avoid dangling else. */ Expect (mcReserved_uparrowtok, stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: ^ [ .", 23); } } /* ArrayExpList := Expression { ',' Expression } first symbols:lcbratok, identtok, realtok, integertok, stringtok, lparatok, nottok, plustok, minustok cannot reachend */ static void ArrayExpList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Expression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* ExpList := Expression { ',' Expression } first symbols:lcbratok, identtok, realtok, integertok, stringtok, lparatok, nottok, plustok, minustok cannot reachend */ static void ExpList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Expression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* Expression := SimpleExpression [ Relation SimpleExpression ] first symbols:identtok, lcbratok, nottok, lparatok, stringtok, integertok, realtok, minustok, plustok cannot reachend */ static void Expression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { SimpleExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_greaterequaltok-mcReserved_eoftok)) | (1 << (mcReserved_greatertok-mcReserved_eoftok)) | (1 << (mcReserved_lessequaltok-mcReserved_eoftok)) | (1 << (mcReserved_lesstok-mcReserved_eoftok)) | (1 << (mcReserved_lessgreatertok-mcReserved_eoftok)) | (1 << (mcReserved_hashtok-mcReserved_eoftok)) | (1 << (mcReserved_equaltok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_intok-mcReserved_arraytok))), stopset2); if (((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_equaltok-mcReserved_eoftok)) | (1 << (mcReserved_hashtok-mcReserved_eoftok)) | (1 << (mcReserved_lessgreatertok-mcReserved_eoftok)) | (1 << (mcReserved_lesstok-mcReserved_eoftok)) | (1 << (mcReserved_lessequaltok-mcReserved_eoftok)) | (1 << (mcReserved_greatertok-mcReserved_eoftok)) | (1 << (mcReserved_greaterequaltok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_intok)) { Relation (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); SimpleExpression (stopset0, stopset1, stopset2); } } /* SimpleExpression := UnaryOrTerm { AddOperator Term } first symbols:lcbratok, identtok, realtok, integertok, stringtok, lparatok, nottok, plustok, minustok cannot reachend */ static void SimpleExpression (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { UnaryOrTerm (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_ortok-mcReserved_arraytok))), stopset2); while (((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_ortok)) { AddOperator (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Term (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_ortok-mcReserved_arraytok))), stopset2); } /* while */ } /* UnaryOrTerm := '+' Term | '-' Term | Term first symbols:identtok, lcbratok, nottok, lparatok, stringtok, integertok, realtok, minustok, plustok cannot reachend */ static void UnaryOrTerm (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_plustok) { Expect (mcReserved_plustok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Term (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_minustok) { /* avoid dangling else. */ Expect (mcReserved_minustok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Term (stopset0, stopset1, stopset2); } else if ((((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_nottok)) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { /* avoid dangling else. */ Term (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: NOT ( string integer number real number identifier { - +", 74); } } /* Term := Factor { MulOperator Factor } first symbols:lcbratok, identtok, realtok, integertok, stringtok, lparatok, nottok cannot reachend */ static void Term (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Factor (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_ambersandtok-mcReserved_eoftok)) | (1 << (mcReserved_andtok-mcReserved_eoftok)) | (1 << (mcReserved_dividetok-mcReserved_eoftok)) | (1 << (mcReserved_timestok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_modtok-mcReserved_arraytok)) | (1 << (mcReserved_divtok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_remtok-mcReserved_recordtok)))); while ((((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_timestok-mcReserved_eoftok)) | (1 << (mcReserved_dividetok-mcReserved_eoftok)) | (1 << (mcReserved_andtok-mcReserved_eoftok)) | (1 << (mcReserved_ambersandtok-mcReserved_eoftok))))) != 0))) || (((mcLexBuf_currenttoken >= mcReserved_arraytok) && (mcLexBuf_currenttoken < mcReserved_recordtok)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & ((mcp4_SetOfStop1) ((1 << (mcReserved_divtok-mcReserved_arraytok)) | (1 << (mcReserved_modtok-mcReserved_arraytok))))) != 0)))) || (mcLexBuf_currenttoken == mcReserved_remtok)) { MulOperator (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Factor (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_timestok-mcReserved_eoftok)) | (1 << (mcReserved_dividetok-mcReserved_eoftok)) | (1 << (mcReserved_andtok-mcReserved_eoftok)) | (1 << (mcReserved_ambersandtok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_divtok-mcReserved_arraytok)) | (1 << (mcReserved_modtok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_remtok-mcReserved_recordtok)))); } /* while */ } /* Factor := Number | string | SetOrDesignatorOrFunction | '(' Expression ')' | 'NOT' ( Factor | ConstAttribute ) first symbols:identtok, lcbratok, nottok, lparatok, stringtok, integertok, realtok cannot reachend */ static void Factor (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok))))) != 0))) { Number (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_stringtok) { /* avoid dangling else. */ string (stopset0, stopset1, stopset2); } else if ((mcLexBuf_currenttoken == mcReserved_lcbratok) || (mcLexBuf_currenttoken == mcReserved_identtok)) { /* avoid dangling else. */ SetOrDesignatorOrFunction (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_lparatok) { /* avoid dangling else. */ Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Expression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_nottok) { /* avoid dangling else. */ Expect (mcReserved_nottok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); if ((((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_nottok)) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { Factor (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_attributetok) { /* avoid dangling else. */ ConstAttribute (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: __ATTRIBUTE__ real number integer number string ( NOT { identifier", 84); } } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: NOT ( identifier { string integer number real number", 70); } } /* ComponentElement := Expression [ '..' Expression % ErrorArray ('implementation restriction range not allowed') % ] first symbols:lcbratok, identtok, realtok, integertok, stringtok, lparatok, nottok, plustok, minustok cannot reachend */ static void ComponentElement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodperiodtok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_periodperiodtok) { Expect (mcReserved_periodperiodtok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Expression (stopset0, stopset1, stopset2); ErrorArray ((const char *) "implementation restriction range not allowed", 44); } } /* ComponentValue := ComponentElement [ 'BY' % ErrorArray ('implementation restriction BY not allowed') % Expression ] first symbols:identtok, lcbratok, nottok, lparatok, stringtok, integertok, realtok, minustok, plustok cannot reachend */ static void ComponentValue (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { ComponentElement (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_bytok-mcReserved_arraytok))), stopset2); if (mcLexBuf_currenttoken == mcReserved_bytok) { Expect (mcReserved_bytok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ErrorArray ((const char *) "implementation restriction BY not allowed", 41); Expression (stopset0, stopset1, stopset2); } } /* ArraySetRecordValue := ComponentValue { ',' ComponentValue } first symbols:lcbratok, identtok, realtok, integertok, stringtok, lparatok, nottok, plustok, minustok cannot reachend */ static void ArraySetRecordValue (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { ComponentValue (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ComponentValue (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* Constructor := '{' [ ArraySetRecordValue ] '}' first symbols:lcbratok cannot reachend */ static void Constructor (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_lcbratok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rcbratok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); if ((((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_nottok)) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { ArraySetRecordValue (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rcbratok-mcReserved_eoftok))), stopset1, stopset2); } Expect (mcReserved_rcbratok, stopset0, stopset1, stopset2); } /* SetOrDesignatorOrFunction := Qualident [ Constructor | SimpleDes [ ActualParameters ] ] | Constructor first symbols:lcbratok, identtok cannot reachend */ static void SetOrDesignatorOrFunction (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_identtok) { /* avoid dangling else. */ Qualident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lcbratok-mcReserved_eoftok)) | (1 << (mcReserved_periodtok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok)) | (1 << (mcReserved_uparrowtok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2); if ((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_uparrowtok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok)) | (1 << (mcReserved_periodtok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))))) != 0))) { /* avoid gcc warning by using compound statement even if not strictly necessary. */ /* seen optional [ | ] expression */ if (mcLexBuf_currenttoken == mcReserved_lcbratok) { Constructor (stopset0, stopset1, stopset2); } else if ((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_uparrowtok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok)) | (1 << (mcReserved_periodtok-mcReserved_eoftok))))) != 0))) { /* avoid dangling else. */ SimpleDes (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_lparatok) { ActualParameters (stopset0, stopset1, stopset2); } } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: ( ^ [ . {", 27); } } /* end of optional [ | ] expression */ } else if (mcLexBuf_currenttoken == mcReserved_lcbratok) { /* avoid dangling else. */ Constructor (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: { identifier", 30); } } /* SimpleDes := { SubDesignator } first symbols:periodtok, lsbratok, uparrowtok reachend */ static void SimpleDes (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { while ((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_periodtok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok)) | (1 << (mcReserved_uparrowtok-mcReserved_eoftok))))) != 0))) { SubDesignator (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodtok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok)) | (1 << (mcReserved_uparrowtok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* ActualParameters := '(' [ ExpList ] ')' first symbols:lparatok cannot reachend */ static void ActualParameters (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); if ((((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_nottok)) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { ExpList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); } Expect (mcReserved_rparatok, stopset0, stopset1, stopset2); } /* ExitStatement := 'EXIT' first symbols:exittok cannot reachend */ static void ExitStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_exittok, stopset0, stopset1, stopset2); } /* ReturnStatement := 'RETURN' [ Expression ] first symbols:returntok cannot reachend */ static void ReturnStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_returntok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); if ((((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_nottok)) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { Expression (stopset0, stopset1, stopset2); } } /* Statement := [ AssignmentOrProcedureCall | IfStatement | CaseStatement | WhileStatement | RepeatStatement | LoopStatement | ForStatement | WithStatement | AsmStatement | ExitStatement | ReturnStatement | RetryStatement ] first symbols:retrytok, asmtok, withtok, fortok, looptok, repeattok, whiletok, casetok, iftok, identtok, returntok, exittok reachend */ static void Statement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if ((((mcLexBuf_currenttoken >= mcReserved_arraytok) && (mcLexBuf_currenttoken < mcReserved_recordtok)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & ((mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok))))) != 0))) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_retrytok-mcReserved_recordtok)) | (1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { /* avoid gcc warning by using compound statement even if not strictly necessary. */ /* seen optional [ | ] expression */ if (mcLexBuf_currenttoken == mcReserved_identtok) { AssignmentOrProcedureCall (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_iftok) { /* avoid dangling else. */ IfStatement (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_casetok) { /* avoid dangling else. */ CaseStatement (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_whiletok) { /* avoid dangling else. */ WhileStatement (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_repeattok) { /* avoid dangling else. */ RepeatStatement (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_looptok) { /* avoid dangling else. */ LoopStatement (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_fortok) { /* avoid dangling else. */ ForStatement (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_withtok) { /* avoid dangling else. */ WithStatement (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_asmtok) { /* avoid dangling else. */ AsmStatement (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_exittok) { /* avoid dangling else. */ ExitStatement (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_returntok) { /* avoid dangling else. */ ReturnStatement (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_retrytok) { /* avoid dangling else. */ RetryStatement (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: RETRY RETURN EXIT ASM WITH FOR LOOP REPEAT WHILE CASE IF identifier", 85); } } /* end of optional [ | ] expression */ } /* RetryStatement := 'RETRY' first symbols:retrytok cannot reachend */ static void RetryStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_retrytok, stopset0, stopset1, stopset2); } /* AssignmentOrProcedureCall := Designator ( ':=' Expression | ActualParameters | % epsilon % ) first symbols:identtok cannot reachend */ static void AssignmentOrProcedureCall (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Designator (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_becomestok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_becomestok) { Expect (mcReserved_becomestok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Expression (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_lparatok) { /* avoid dangling else. */ ActualParameters (stopset0, stopset1, stopset2); } /* epsilon */ } /* StatementSequence := Statement { ';' Statement } first symbols:identtok, iftok, casetok, whiletok, repeattok, looptok, fortok, withtok, asmtok, retrytok, semicolontok, exittok, returntok reachend */ static void StatementSequence (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Statement (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_semicolontok) { Expect (mcReserved_semicolontok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Statement (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* IfStatement := 'IF' Expression 'THEN' StatementSequence { 'ELSIF' Expression 'THEN' StatementSequence } [ 'ELSE' StatementSequence ] 'END' first symbols:iftok cannot reachend */ static void IfStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_iftok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Expression (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_thentok-mcReserved_recordtok)))); Expect (mcReserved_thentok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_elsiftok-mcReserved_arraytok)) | (1 << (mcReserved_elsetok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)))); StatementSequence (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_elsiftok-mcReserved_arraytok)) | (1 << (mcReserved_elsetok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok))), stopset2); while (mcLexBuf_currenttoken == mcReserved_elsiftok) { Expect (mcReserved_elsiftok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Expression (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_thentok-mcReserved_recordtok)))); Expect (mcReserved_thentok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_elsetok-mcReserved_arraytok)) | (1 << (mcReserved_elsiftok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)))); StatementSequence (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_elsetok-mcReserved_arraytok)) | (1 << (mcReserved_elsiftok-mcReserved_arraytok))), stopset2); } /* while */ if (mcLexBuf_currenttoken == mcReserved_elsetok) { Expect (mcReserved_elsetok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)))); StatementSequence (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok))), stopset2); } Expect (mcReserved_endtok, stopset0, stopset1, stopset2); } /* CaseStatement := 'CASE' Expression 'OF' Case { '|' Case } CaseEndStatement first symbols:casetok cannot reachend */ static void CaseStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_casetok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Expression (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_oftok-mcReserved_arraytok))), stopset2); Expect (mcReserved_oftok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_bartok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_elsetok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Case (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_bartok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_elsetok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok))), stopset2); while (mcLexBuf_currenttoken == mcReserved_bartok) { Expect (mcReserved_bartok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_bartok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_elsetok-mcReserved_arraytok)) | (1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Case (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_bartok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_elsetok-mcReserved_arraytok))), stopset2); } /* while */ CaseEndStatement (stopset0, stopset1, stopset2); } /* CaseEndStatement := 'END' | 'ELSE' StatementSequence 'END' first symbols:elsetok, endtok cannot reachend */ static void CaseEndStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_endtok) { Expect (mcReserved_endtok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_elsetok) { /* avoid dangling else. */ Expect (mcReserved_elsetok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)))); StatementSequence (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok))), stopset2); Expect (mcReserved_endtok, stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: ELSE END", 26); } } /* Case := [ CaseLabelList ':' StatementSequence ] first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok reachend */ static void Case (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if ((((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_nottok)) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { CaseLabelList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_colontok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)))); StatementSequence (stopset0, stopset1, stopset2); } } /* CaseLabelList := CaseLabels { ',' CaseLabels } first symbols:identtok, attributetok, lcbratok, stringtok, nottok, lparatok, integertok, realtok, minustok, plustok cannot reachend */ static void CaseLabelList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { CaseLabels (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); CaseLabels (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* CaseLabels := ConstExpression [ '..' ConstExpression ] first symbols:identtok, stringtok, lcbratok, attributetok, realtok, integertok, lparatok, nottok, plustok, minustok cannot reachend */ static void CaseLabels (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodperiodtok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_periodperiodtok) { Expect (mcReserved_periodperiodtok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0, stopset1, stopset2); } } /* WhileStatement := 'WHILE' Expression 'DO' StatementSequence 'END' first symbols:whiletok cannot reachend */ static void WhileStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_whiletok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Expression (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_dotok-mcReserved_arraytok))), stopset2); Expect (mcReserved_dotok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)))); StatementSequence (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok))), stopset2); Expect (mcReserved_endtok, stopset0, stopset1, stopset2); } /* RepeatStatement := 'REPEAT' StatementSequence 'UNTIL' Expression first symbols:repeattok cannot reachend */ static void RepeatStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_repeattok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_untiltok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)))); StatementSequence (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_untiltok-mcReserved_recordtok)))); Expect (mcReserved_untiltok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Expression (stopset0, stopset1, stopset2); } /* ForStatement := 'FOR' Ident ':=' Expression 'TO' Expression [ 'BY' ConstExpression ] 'DO' StatementSequence 'END' first symbols:fortok cannot reachend */ static void ForStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_fortok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_becomestok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_becomestok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Expression (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_totok-mcReserved_recordtok)))); Expect (mcReserved_totok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Expression (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_bytok-mcReserved_arraytok)) | (1 << (mcReserved_dotok-mcReserved_arraytok))), stopset2); if (mcLexBuf_currenttoken == mcReserved_bytok) { Expect (mcReserved_bytok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_dotok-mcReserved_arraytok))), stopset2); } Expect (mcReserved_dotok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)))); StatementSequence (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok))), stopset2); Expect (mcReserved_endtok, stopset0, stopset1, stopset2); } /* LoopStatement := 'LOOP' StatementSequence 'END' first symbols:looptok cannot reachend */ static void LoopStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_looptok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)))); StatementSequence (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok))), stopset2); Expect (mcReserved_endtok, stopset0, stopset1, stopset2); } /* WithStatement := 'WITH' Designator 'DO' StatementSequence 'END' first symbols:withtok cannot reachend */ static void WithStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_withtok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Designator (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_dotok-mcReserved_arraytok))), stopset2); Expect (mcReserved_dotok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)))); StatementSequence (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok))), stopset2); Expect (mcReserved_endtok, stopset0, stopset1, stopset2); } /* ProcedureDeclaration := ProcedureHeading ';' ProcedureBlock Ident % leaveScope % first symbols:proceduretok cannot reachend */ static void ProcedureDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { ProcedureHeading (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_semicolontok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_begintok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_moduletok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_typetok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)))); ProcedureBlock (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0, stopset1, stopset2); decl_leaveScope (); } /* ProcedureIdent := Ident % curproc := lookupSym (curident) % % enterScope (curproc) % first symbols:identtok cannot reachend */ static void ProcedureIdent (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Ident (stopset0, stopset1, stopset2); curproc = decl_lookupSym (curident); decl_enterScope (curproc); } /* DefProcedureIdent := Ident % curproc := lookupSym (curident) % first symbols:identtok cannot reachend */ static void DefProcedureIdent (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Ident (stopset0, stopset1, stopset2); curproc = decl_lookupSym (curident); } /* DefineBuiltinProcedure := [ '__ATTRIBUTE__' '__BUILTIN__' '(' '(' Ident ')' ')' | '__INLINE__' ] first symbols:inlinetok, attributetok reachend */ static void DefineBuiltinProcedure (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_inlinetok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok))))) != 0))) { /* avoid gcc warning by using compound statement even if not strictly necessary. */ /* seen optional [ | ] expression */ if (mcLexBuf_currenttoken == mcReserved_attributetok) { Expect (mcReserved_attributetok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_builtintok-mcReserved_recordtok)))); Expect (mcReserved_builtintok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_lparatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_inlinetok) { /* avoid dangling else. */ Expect (mcReserved_inlinetok, stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: __INLINE__ __ATTRIBUTE__", 42); } } /* end of optional [ | ] expression */ } /* ProcedureHeading := 'PROCEDURE' DefineBuiltinProcedure ( ProcedureIdent [ FormalParameters ] AttributeNoReturn ) first symbols:proceduretok cannot reachend */ static void ProcedureHeading (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_proceduretok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_inlinetok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); DefineBuiltinProcedure (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); ProcedureIdent (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_ldirectivetok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_lparatok) { FormalParameters (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_ldirectivetok-mcReserved_eoftok))), stopset1, stopset2); } AttributeNoReturn (stopset0, stopset1, stopset2); } /* Builtin := [ '__BUILTIN__' | '__INLINE__' ] first symbols:inlinetok, builtintok reachend */ static void Builtin (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_inlinetok-mcReserved_recordtok)) | (1 << (mcReserved_builtintok-mcReserved_recordtok))))) != 0))) { /* avoid gcc warning by using compound statement even if not strictly necessary. */ /* seen optional [ | ] expression */ if (mcLexBuf_currenttoken == mcReserved_builtintok) { Expect (mcReserved_builtintok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_inlinetok) { /* avoid dangling else. */ Expect (mcReserved_inlinetok, stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: __INLINE__ __BUILTIN__", 40); } } /* end of optional [ | ] expression */ } /* DefProcedureHeading := 'PROCEDURE' Builtin ( DefProcedureIdent [ DefFormalParameters ] AttributeNoReturn ) first symbols:proceduretok cannot reachend */ static void DefProcedureHeading (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_proceduretok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_inlinetok-mcReserved_recordtok)) | (1 << (mcReserved_builtintok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Builtin (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); DefProcedureIdent (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_ldirectivetok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_lparatok) { DefFormalParameters (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_ldirectivetok-mcReserved_eoftok))), stopset1, stopset2); } AttributeNoReturn (stopset0, stopset1, stopset2); } /* ProcedureBlock := { Declaration } [ 'BEGIN' ProcedureBlockBody ] 'END' first symbols:proceduretok, moduletok, consttok, typetok, vartok, endtok, begintok cannot reachend */ static void ProcedureBlock (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { while ((((mcLexBuf_currenttoken >= mcReserved_arraytok) && (mcLexBuf_currenttoken < mcReserved_recordtok)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & ((mcp4_SetOfStop1) ((1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_moduletok-mcReserved_arraytok))))) != 0))) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_typetok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok))))) != 0)))) { Declaration (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_begintok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_moduletok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_typetok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)))); } /* while */ if (mcLexBuf_currenttoken == mcReserved_begintok) { Expect (mcReserved_begintok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_excepttok-mcReserved_arraytok)) | (1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)))); ProcedureBlockBody (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok))), stopset2); } Expect (mcReserved_endtok, stopset0, stopset1, stopset2); } /* Block := { Declaration } InitialBlock FinalBlock 'END' first symbols:proceduretok, moduletok, finallytok, begintok, consttok, typetok, vartok, endtok cannot reachend */ static void Block (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { while ((((mcLexBuf_currenttoken >= mcReserved_arraytok) && (mcLexBuf_currenttoken < mcReserved_recordtok)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & ((mcp4_SetOfStop1) ((1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_moduletok-mcReserved_arraytok))))) != 0))) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_typetok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok))))) != 0)))) { Declaration (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_finallytok-mcReserved_arraytok)) | (1 << (mcReserved_begintok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_moduletok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_typetok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)))); } /* while */ InitialBlock (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_finallytok-mcReserved_arraytok))), stopset2); FinalBlock (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok))), stopset2); Expect (mcReserved_endtok, stopset0, stopset1, stopset2); } /* InitialBlock := [ 'BEGIN' InitialBlockBody ] first symbols:begintok reachend */ static void InitialBlock (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_begintok) { Expect (mcReserved_begintok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_excepttok-mcReserved_arraytok)) | (1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)))); InitialBlockBody (stopset0, stopset1, stopset2); } } /* FinalBlock := [ 'FINALLY' FinalBlockBody ] first symbols:finallytok reachend */ static void FinalBlock (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_finallytok) { Expect (mcReserved_finallytok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_excepttok-mcReserved_arraytok)) | (1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)))); FinalBlockBody (stopset0, stopset1, stopset2); } } /* InitialBlockBody := NormalPart [ 'EXCEPT' ExceptionalPart ] first symbols:identtok, iftok, casetok, whiletok, repeattok, looptok, fortok, withtok, asmtok, retrytok, semicolontok, exittok, returntok, excepttok reachend */ static void InitialBlockBody (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { NormalPart (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_excepttok-mcReserved_arraytok))), stopset2); if (mcLexBuf_currenttoken == mcReserved_excepttok) { Expect (mcReserved_excepttok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ExceptionalPart (stopset0, stopset1, stopset2); } } /* FinalBlockBody := NormalPart [ 'EXCEPT' ExceptionalPart ] first symbols:identtok, iftok, casetok, whiletok, repeattok, looptok, fortok, withtok, asmtok, retrytok, semicolontok, exittok, returntok, excepttok reachend */ static void FinalBlockBody (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { NormalPart (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_excepttok-mcReserved_arraytok))), stopset2); if (mcLexBuf_currenttoken == mcReserved_excepttok) { Expect (mcReserved_excepttok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ExceptionalPart (stopset0, stopset1, stopset2); } } /* ProcedureBlockBody := NormalPart [ 'EXCEPT' ExceptionalPart ] first symbols:identtok, iftok, casetok, whiletok, repeattok, looptok, fortok, withtok, asmtok, retrytok, semicolontok, exittok, returntok, excepttok reachend */ static void ProcedureBlockBody (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { NormalPart (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_excepttok-mcReserved_arraytok))), stopset2); if (mcLexBuf_currenttoken == mcReserved_excepttok) { Expect (mcReserved_excepttok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_exittok-mcReserved_arraytok)) | (1 << (mcReserved_fortok-mcReserved_arraytok)) | (1 << (mcReserved_looptok-mcReserved_arraytok)) | (1 << (mcReserved_casetok-mcReserved_arraytok)) | (1 << (mcReserved_iftok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_returntok-mcReserved_recordtok)) | (1 << (mcReserved_retrytok-mcReserved_recordtok)) | (1 << (mcReserved_asmtok-mcReserved_recordtok)) | (1 << (mcReserved_withtok-mcReserved_recordtok)) | (1 << (mcReserved_repeattok-mcReserved_recordtok)) | (1 << (mcReserved_whiletok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ExceptionalPart (stopset0, stopset1, stopset2); } } /* NormalPart := StatementSequence first symbols:retrytok, asmtok, withtok, fortok, looptok, repeattok, whiletok, casetok, iftok, identtok, returntok, exittok, semicolontok reachend */ static void NormalPart (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { StatementSequence (stopset0, stopset1, stopset2); } /* ExceptionalPart := StatementSequence first symbols:retrytok, asmtok, withtok, fortok, looptok, repeattok, whiletok, casetok, iftok, identtok, returntok, exittok, semicolontok reachend */ static void ExceptionalPart (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { StatementSequence (stopset0, stopset1, stopset2); } /* Declaration := 'CONST' { ConstantDeclaration ';' } | 'TYPE' { TypeDeclaration } | 'VAR' { VariableDeclaration ';' } | ProcedureDeclaration ';' | ModuleDeclaration ';' first symbols:moduletok, proceduretok, vartok, typetok, consttok cannot reachend */ static void Declaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_consttok) { Expect (mcReserved_consttok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); while (mcLexBuf_currenttoken == mcReserved_identtok) { ConstantDeclaration (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); } /* while */ } else if (mcLexBuf_currenttoken == mcReserved_typetok) { /* avoid dangling else. */ Expect (mcReserved_typetok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); while (mcLexBuf_currenttoken == mcReserved_identtok) { TypeDeclaration (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); } /* while */ } else if (mcLexBuf_currenttoken == mcReserved_vartok) { /* avoid dangling else. */ Expect (mcReserved_vartok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); while (mcLexBuf_currenttoken == mcReserved_identtok) { VariableDeclaration (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); } /* while */ } else if (mcLexBuf_currenttoken == mcReserved_proceduretok) { /* avoid dangling else. */ ProcedureDeclaration (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_moduletok) { /* avoid dangling else. */ ModuleDeclaration (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: MODULE PROCEDURE VAR TYPE CONST", 49); } } /* DefFormalParameters := '(' % paramEnter (curproc) % [ DefMultiFPSection ] ')' % paramLeave (curproc) % FormalReturn first symbols:lparatok cannot reachend */ static void DefFormalParameters (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_periodperiodperiodtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)))); decl_paramEnter (curproc); if ((mcLexBuf_currenttoken == mcReserved_lsbratok) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_periodperiodperiodtok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { DefMultiFPSection (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); } Expect (mcReserved_rparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); decl_paramLeave (curproc); FormalReturn (stopset0, stopset1, stopset2); } /* DefMultiFPSection := DefExtendedFP | FPSection [ ';' DefMultiFPSection ] first symbols:identtok, vartok, lsbratok, periodperiodperiodtok cannot reachend */ static void DefMultiFPSection (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if ((mcLexBuf_currenttoken == mcReserved_lsbratok) || (mcLexBuf_currenttoken == mcReserved_periodperiodperiodtok)) { DefExtendedFP (stopset0, stopset1, stopset2); } else if ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok))))) != 0))) { /* avoid dangling else. */ FPSection (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_semicolontok) { Expect (mcReserved_semicolontok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_periodperiodperiodtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)))); DefMultiFPSection (stopset0, stopset1, stopset2); } } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: identifier VAR ... [", 38); } } /* FormalParameters := '(' % paramEnter (curproc) % [ MultiFPSection ] ')' % paramLeave (curproc) % FormalReturn first symbols:lparatok cannot reachend */ static void FormalParameters (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_periodperiodperiodtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)))); decl_paramEnter (curproc); if ((mcLexBuf_currenttoken == mcReserved_lsbratok) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_periodperiodperiodtok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok))))) != 0)))) { MultiFPSection (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); } Expect (mcReserved_rparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); decl_paramLeave (curproc); FormalReturn (stopset0, stopset1, stopset2); } /* AttributeNoReturn := [ '' ] first symbols:ldirectivetok reachend */ static void AttributeNoReturn (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_ldirectivetok) { Expect (mcReserved_ldirectivetok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rdirectivetok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rdirectivetok, stopset0, stopset1, stopset2); } } /* AttributeUnused := [ '' ] first symbols:ldirectivetok reachend */ static void AttributeUnused (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_ldirectivetok) { Expect (mcReserved_ldirectivetok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rdirectivetok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rdirectivetok, stopset0, stopset1, stopset2); } } /* MultiFPSection := ExtendedFP | FPSection [ ';' MultiFPSection ] first symbols:identtok, vartok, lsbratok, periodperiodperiodtok cannot reachend */ static void MultiFPSection (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if ((mcLexBuf_currenttoken == mcReserved_lsbratok) || (mcLexBuf_currenttoken == mcReserved_periodperiodperiodtok)) { ExtendedFP (stopset0, stopset1, stopset2); } else if ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok))))) != 0))) { /* avoid dangling else. */ FPSection (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_semicolontok) { Expect (mcReserved_semicolontok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_periodperiodperiodtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)))); MultiFPSection (stopset0, stopset1, stopset2); } } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: identifier VAR ... [", 38); } } /* FPSection := NonVarFPSection | VarFPSection first symbols:vartok, identtok cannot reachend */ static void FPSection (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_identtok) { NonVarFPSection (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_vartok) { /* avoid dangling else. */ VarFPSection (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: VAR identifier", 32); } } /* DefExtendedFP := DefOptArg | '...' first symbols:lsbratok, periodperiodperiodtok cannot reachend */ static void DefExtendedFP (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_lsbratok) { DefOptArg (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_periodperiodperiodtok) { /* avoid dangling else. */ Expect (mcReserved_periodperiodperiodtok, stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: ... [", 23); } } /* ExtendedFP := OptArg | '...' first symbols:lsbratok, periodperiodperiodtok cannot reachend */ static void ExtendedFP (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_lsbratok) { OptArg (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_periodperiodperiodtok) { /* avoid dangling else. */ Expect (mcReserved_periodperiodperiodtok, stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: ... [", 23); } } /* VarFPSection := 'VAR' PushIdentList ':' FormalType [ AttributeUnused ] first symbols:vartok cannot reachend */ static void VarFPSection (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_vartok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); PushIdentList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_colontok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); FormalType (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_ldirectivetok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_ldirectivetok) { AttributeUnused (stopset0, stopset1, stopset2); } } /* NonVarFPSection := PushIdentList ':' FormalType [ AttributeUnused ] first symbols:identtok cannot reachend */ static void NonVarFPSection (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { PushIdentList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_colontok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); FormalType (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_ldirectivetok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_ldirectivetok) { AttributeUnused (stopset0, stopset1, stopset2); } } /* OptArg := '[' Ident ':' FormalType [ '=' ConstExpression ] ']' first symbols:lsbratok cannot reachend */ static void OptArg (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_lsbratok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_colontok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); FormalType (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_equaltok-mcReserved_eoftok)) | (1 << (mcReserved_rsbratok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_equaltok) { Expect (mcReserved_equaltok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rsbratok-mcReserved_eoftok))), stopset1, stopset2); } Expect (mcReserved_rsbratok, stopset0, stopset1, stopset2); } /* DefOptArg := '[' Ident ':' FormalType '=' ConstExpression ']' first symbols:lsbratok cannot reachend */ static void DefOptArg (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_lsbratok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_colontok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); FormalType (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_equaltok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_equaltok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rsbratok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rsbratok, stopset0, stopset1, stopset2); } /* FormalType := { 'ARRAY' 'OF' } PushQualident first symbols:identtok, arraytok cannot reachend */ static void FormalType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { while (mcLexBuf_currenttoken == mcReserved_arraytok) { Expect (mcReserved_arraytok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_oftok-mcReserved_arraytok))), stopset2); Expect (mcReserved_oftok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); } /* while */ PushQualident (stopset0, stopset1, stopset2); } /* ModuleDeclaration := 'MODULE' Ident [ Priority ] ';' { Import } [ Export ] Block Ident first symbols:moduletok cannot reachend */ static void ModuleDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_moduletok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_lsbratok) { Priority (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); } Expect (mcReserved_semicolontok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_importtok-mcReserved_arraytok)) | (1 << (mcReserved_fromtok-mcReserved_arraytok)) | (1 << (mcReserved_exporttok-mcReserved_arraytok)) | (1 << (mcReserved_finallytok-mcReserved_arraytok)) | (1 << (mcReserved_begintok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_moduletok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_typetok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)))); while (((mcLexBuf_currenttoken >= mcReserved_arraytok) && (mcLexBuf_currenttoken < mcReserved_recordtok)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & ((mcp4_SetOfStop1) ((1 << (mcReserved_fromtok-mcReserved_arraytok)) | (1 << (mcReserved_importtok-mcReserved_arraytok))))) != 0))) { Import (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_begintok-mcReserved_arraytok)) | (1 << (mcReserved_finallytok-mcReserved_arraytok)) | (1 << (mcReserved_exporttok-mcReserved_arraytok)) | (1 << (mcReserved_fromtok-mcReserved_arraytok)) | (1 << (mcReserved_importtok-mcReserved_arraytok)) | (1 << (mcReserved_moduletok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_vartok-mcReserved_recordtok)) | (1 << (mcReserved_typetok-mcReserved_recordtok)))); } /* while */ if (mcLexBuf_currenttoken == mcReserved_exporttok) { Export (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_begintok-mcReserved_arraytok)) | (1 << (mcReserved_finallytok-mcReserved_arraytok)) | (1 << (mcReserved_moduletok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_vartok-mcReserved_recordtok)) | (1 << (mcReserved_typetok-mcReserved_recordtok)))); } Block (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0, stopset1, stopset2); } /* Priority := '[' ConstExpression ']' first symbols:lsbratok cannot reachend */ static void Priority (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_lsbratok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rsbratok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rsbratok, stopset0, stopset1, stopset2); } /* Export := 'EXPORT' ( 'QUALIFIED' IdentList | 'UNQUALIFIED' IdentList | IdentList ) ';' first symbols:exporttok cannot reachend */ static void Export (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_exporttok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_qualifiedtok-mcReserved_arraytok)) | (1 << (mcReserved_unqualifiedtok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); if (mcLexBuf_currenttoken == mcReserved_qualifiedtok) { Expect (mcReserved_qualifiedtok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); IdentList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_unqualifiedtok) { /* avoid dangling else. */ Expect (mcReserved_unqualifiedtok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); IdentList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_identtok) { /* avoid dangling else. */ IdentList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: identifier UNQUALIFIED QUALIFIED", 50); } Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2); } /* FromIdentList := Ident { ',' Ident } first symbols:identtok cannot reachend */ static void FromIdentList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* FromImport := 'FROM' Ident 'IMPORT' FromIdentList ';' first symbols:fromtok cannot reachend */ static void FromImport (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_fromtok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_importtok-mcReserved_arraytok))), stopset2); Expect (mcReserved_importtok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); FromIdentList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2); } /* ImportModuleList := Ident { ',' Ident } first symbols:identtok cannot reachend */ static void ImportModuleList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* WithoutFromImport := 'IMPORT' ImportModuleList ';' first symbols:importtok cannot reachend */ static void WithoutFromImport (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_importtok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); ImportModuleList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2); } /* Import := FromImport | WithoutFromImport first symbols:importtok, fromtok cannot reachend */ static void Import (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_fromtok) { FromImport (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_importtok) { /* avoid dangling else. */ WithoutFromImport (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: IMPORT FROM", 29); } } /* DefinitionModule := 'DEFINITION' 'MODULE' [ 'FOR' string ] Ident % curmodule := lookupDef (curident) % % addCommentBody (curmodule) % ';' % enterScope (curmodule) % % resetConstExpPos (curmodule) % { Import } [ Export ] { Definition } 'END' Ident '.' % checkEndName (curmodule, curident, 'definition module') % % leaveScope % first symbols:definitiontok cannot reachend */ static void DefinitionModule (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_definitiontok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_moduletok-mcReserved_arraytok))), stopset2); Expect (mcReserved_moduletok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); if (mcLexBuf_currenttoken == mcReserved_fortok) { Expect (mcReserved_fortok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)))); string (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); } Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); curmodule = decl_lookupDef (curident); decl_addCommentBody (curmodule); Expect (mcReserved_semicolontok, stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_importtok-mcReserved_arraytok)) | (1 << (mcReserved_fromtok-mcReserved_arraytok)) | (1 << (mcReserved_exporttok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_vartok-mcReserved_recordtok)) | (1 << (mcReserved_typetok-mcReserved_recordtok)))); decl_enterScope (curmodule); decl_resetConstExpPos (curmodule); while (((mcLexBuf_currenttoken >= mcReserved_arraytok) && (mcLexBuf_currenttoken < mcReserved_recordtok)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & ((mcp4_SetOfStop1) ((1 << (mcReserved_fromtok-mcReserved_arraytok)) | (1 << (mcReserved_importtok-mcReserved_arraytok))))) != 0))) { Import (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_exporttok-mcReserved_arraytok)) | (1 << (mcReserved_fromtok-mcReserved_arraytok)) | (1 << (mcReserved_importtok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_typetok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)))); } /* while */ if (mcLexBuf_currenttoken == mcReserved_exporttok) { Export (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_typetok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)))); } while ((((mcLexBuf_currenttoken >= mcReserved_arraytok) && (mcLexBuf_currenttoken < mcReserved_recordtok)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & ((mcp4_SetOfStop1) ((1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok))))) != 0))) || ((mcLexBuf_currenttoken >= mcReserved_recordtok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_recordtok)) & ((mcp4_SetOfStop2) ((1 << (mcReserved_typetok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok))))) != 0)))) { Definition (stopset0, stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_typetok-mcReserved_recordtok)) | (1 << (mcReserved_vartok-mcReserved_recordtok)))); } /* while */ Expect (mcReserved_endtok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodtok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_periodtok, stopset0, stopset1, stopset2); checkEndName (curmodule, curident, (const char *) "definition module", 17); decl_leaveScope (); } /* PushQualident := Ident % typeExp := push (lookupSym (curident)) % % IF typeExp = NIL THEN metaError1 ('the symbol {%1k} is not visible in this scope (or any other nested scope)', curident) END % [ '.' % IF NOT isDef (typeExp) THEN ErrorArray ('the first component of this qualident must be a definition module') END % Ident % typeExp := replace (lookupInScope (typeExp, curident)) ; IF typeExp=NIL THEN ErrorArray ('identifier not found in definition module') END % ] first symbols:identtok cannot reachend */ static void PushQualident (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodtok-mcReserved_eoftok))), stopset1, stopset2); typeExp = push (decl_lookupSym (curident)); if (typeExp == NULL) { mcMetaError_metaError1 ((const char *) "the symbol {%1k} is not visible in this scope (or any other nested scope)", 73, (const unsigned char *) &curident, (sizeof (curident)-1)); } if (mcLexBuf_currenttoken == mcReserved_periodtok) { Expect (mcReserved_periodtok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); if (! (decl_isDef (typeExp))) { ErrorArray ((const char *) "the first component of this qualident must be a definition module", 65); } Ident (stopset0, stopset1, stopset2); typeExp = replace (decl_lookupInScope (typeExp, curident)); if (typeExp == NULL) { ErrorArray ((const char *) "identifier not found in definition module", 41); } } } /* OptSubrange := [ SubrangeType ] first symbols:lsbratok reachend */ static void OptSubrange (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_lsbratok) { SubrangeType (stopset0, stopset1, stopset2); } } /* TypeEquiv := PushQualident OptSubrange first symbols:identtok cannot reachend */ static void TypeEquiv (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { PushQualident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2); OptSubrange (stopset0, stopset1, stopset2); } /* EnumIdentList := Ident { ',' Ident } first symbols:identtok cannot reachend */ static void EnumIdentList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* Enumeration := '(' EnumIdentList ')' first symbols:lparatok cannot reachend */ static void Enumeration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_lparatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); EnumIdentList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0, stopset1, stopset2); } /* SimpleType := TypeEquiv | Enumeration | SubrangeType first symbols:lsbratok, lparatok, identtok cannot reachend */ static void SimpleType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_identtok) { TypeEquiv (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_lparatok) { /* avoid dangling else. */ Enumeration (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_lsbratok) { /* avoid dangling else. */ SubrangeType (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: [ ( identifier", 32); } } /* Type := SimpleType | ArrayType | RecordType | SetType | PointerType | ProcedureType first symbols:proceduretok, pointertok, settok, packedsettok, oftok, recordtok, arraytok, identtok, lparatok, lsbratok cannot reachend */ static void Type (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_identtok)) { SimpleType (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_arraytok) { /* avoid dangling else. */ ArrayType (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_recordtok) { /* avoid dangling else. */ RecordType (stopset0, stopset1, stopset2); } else if ((((mcLexBuf_currenttoken >= mcReserved_arraytok) && (mcLexBuf_currenttoken < mcReserved_recordtok)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & ((mcp4_SetOfStop1) ((1 << (mcReserved_packedsettok-mcReserved_arraytok)) | (1 << (mcReserved_oftok-mcReserved_arraytok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_settok)) { /* avoid dangling else. */ SetType (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_pointertok) { /* avoid dangling else. */ PointerType (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_proceduretok) { /* avoid dangling else. */ ProcedureType (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: PROCEDURE POINTER SET PACKEDSET OF RECORD ARRAY identifier ( [", 80); } } /* TypeDeclaration := { Ident ( ';' | '=' Type Alignment ';' ) } first symbols:identtok reachend */ static void TypeDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { while (mcLexBuf_currenttoken == mcReserved_identtok) { Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok)) | (1 << (mcReserved_equaltok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_semicolontok) { Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); } else if (mcLexBuf_currenttoken == mcReserved_equaltok) { /* avoid dangling else. */ Expect (mcReserved_equaltok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_pointertok-mcReserved_arraytok)) | (1 << (mcReserved_packedsettok-mcReserved_arraytok)) | (1 << (mcReserved_oftok-mcReserved_arraytok)) | (1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_settok-mcReserved_recordtok)) | (1 << (mcReserved_recordtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Type (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_ldirectivetok-mcReserved_eoftok)) | (1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Alignment (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: = ;", 21); } } /* while */ } /* DefQualident := Ident % typeExp := lookupSym (curident) % [ '.' % IF NOT isDef (typeExp) THEN ErrorArray ('the first component of this qualident must be a definition module') END % Ident % typeExp := lookupInScope (typeExp, curident) ; IF typeExp=NIL THEN ErrorArray ('identifier not found in definition module') END % ] first symbols:identtok cannot reachend */ static void DefQualident (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_periodtok-mcReserved_eoftok))), stopset1, stopset2); typeExp = decl_lookupSym (curident); if (mcLexBuf_currenttoken == mcReserved_periodtok) { Expect (mcReserved_periodtok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); if (! (decl_isDef (typeExp))) { ErrorArray ((const char *) "the first component of this qualident must be a definition module", 65); } Ident (stopset0, stopset1, stopset2); typeExp = decl_lookupInScope (typeExp, curident); if (typeExp == NULL) { ErrorArray ((const char *) "identifier not found in definition module", 41); } } } /* DefTypeEquiv := DefQualident OptSubrange first symbols:identtok cannot reachend */ static void DefTypeEquiv (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { DefQualident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2); OptSubrange (stopset0, stopset1, stopset2); } /* DefEnumIdentList := Ident { ',' Ident } first symbols:identtok cannot reachend */ static void DefEnumIdentList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* DefEnumeration := '(' DefEnumIdentList ')' first symbols:lparatok cannot reachend */ static void DefEnumeration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_lparatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); DefEnumIdentList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0, stopset1, stopset2); } /* DefSimpleType := DefTypeEquiv | DefEnumeration | SubrangeType first symbols:lsbratok, lparatok, identtok cannot reachend */ static void DefSimpleType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_identtok) { DefTypeEquiv (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_lparatok) { /* avoid dangling else. */ DefEnumeration (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_lsbratok) { /* avoid dangling else. */ SubrangeType (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: [ ( identifier", 32); } } /* DefType := DefSimpleType | ArrayType | RecordType | SetType | PointerType | ProcedureType first symbols:proceduretok, pointertok, settok, packedsettok, oftok, recordtok, arraytok, identtok, lparatok, lsbratok cannot reachend */ static void DefType (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (((mcLexBuf_currenttoken < mcReserved_arraytok) && ((((1 << (mcLexBuf_currenttoken-mcReserved_eoftok)) & ((mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_identtok)) { DefSimpleType (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_arraytok) { /* avoid dangling else. */ ArrayType (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_recordtok) { /* avoid dangling else. */ RecordType (stopset0, stopset1, stopset2); } else if ((((mcLexBuf_currenttoken >= mcReserved_arraytok) && (mcLexBuf_currenttoken < mcReserved_recordtok)) && ((((1 << (mcLexBuf_currenttoken-mcReserved_arraytok)) & ((mcp4_SetOfStop1) ((1 << (mcReserved_packedsettok-mcReserved_arraytok)) | (1 << (mcReserved_oftok-mcReserved_arraytok))))) != 0))) || (mcLexBuf_currenttoken == mcReserved_settok)) { /* avoid dangling else. */ SetType (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_pointertok) { /* avoid dangling else. */ PointerType (stopset0, stopset1, stopset2); } else if (mcLexBuf_currenttoken == mcReserved_proceduretok) { /* avoid dangling else. */ ProcedureType (stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: PROCEDURE POINTER SET PACKEDSET OF RECORD ARRAY identifier ( [", 80); } } /* DefTypeDeclaration := { Ident ( ';' | '=' DefType Alignment ';' ) } first symbols:identtok reachend */ static void DefTypeDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { while (mcLexBuf_currenttoken == mcReserved_identtok) { Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok)) | (1 << (mcReserved_equaltok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_semicolontok) { Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); } else if (mcLexBuf_currenttoken == mcReserved_equaltok) { /* avoid dangling else. */ Expect (mcReserved_equaltok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_pointertok-mcReserved_arraytok)) | (1 << (mcReserved_packedsettok-mcReserved_arraytok)) | (1 << (mcReserved_oftok-mcReserved_arraytok)) | (1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_settok-mcReserved_recordtok)) | (1 << (mcReserved_recordtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); DefType (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_ldirectivetok-mcReserved_eoftok)) | (1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Alignment (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: = ;", 21); } } /* while */ } /* DefConstantDeclaration := Ident '=' ConstExpression first symbols:identtok cannot reachend */ static void DefConstantDeclaration (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_equaltok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_equaltok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_attributetok-mcReserved_recordtok)) | (1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); ConstExpression (stopset0, stopset1, stopset2); } /* Definition := 'CONST' { DefConstantDeclaration ';' } | 'TYPE' { DefTypeDeclaration } | 'VAR' { VariableDeclaration ';' } | DefProcedureHeading ';' first symbols:proceduretok, vartok, typetok, consttok cannot reachend */ static void Definition (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_consttok) { Expect (mcReserved_consttok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); while (mcLexBuf_currenttoken == mcReserved_identtok) { DefConstantDeclaration (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); } /* while */ } else if (mcLexBuf_currenttoken == mcReserved_typetok) { /* avoid dangling else. */ Expect (mcReserved_typetok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); while (mcLexBuf_currenttoken == mcReserved_identtok) { DefTypeDeclaration (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); } /* while */ } else if (mcLexBuf_currenttoken == mcReserved_vartok) { /* avoid dangling else. */ Expect (mcReserved_vartok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); while (mcLexBuf_currenttoken == mcReserved_identtok) { VariableDeclaration (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); } /* while */ } else if (mcLexBuf_currenttoken == mcReserved_proceduretok) { /* avoid dangling else. */ DefProcedureHeading (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2); } else { /* avoid dangling else. */ ErrorArray ((const char *) "expecting one of: PROCEDURE VAR TYPE CONST", 42); } } /* AsmStatement := 'ASM' [ 'VOLATILE' ] '(' AsmOperands ')' first symbols:asmtok cannot reachend */ static void AsmStatement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_asmtok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_volatiletok-mcReserved_recordtok)))); if (mcLexBuf_currenttoken == mcReserved_volatiletok) { Expect (mcReserved_volatiletok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2); } Expect (mcReserved_lparatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)))); AsmOperands (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0, stopset1, stopset2); } /* AsmOperands := string [ AsmOperandSpec ] first symbols:stringtok cannot reachend */ static void AsmOperands (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { string (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_colontok) { AsmOperandSpec (stopset0, stopset1, stopset2); } } /* AsmOperandSpec := [ ':' AsmList [ ':' AsmList [ ':' TrashList ] ] ] first symbols:colontok reachend */ static void AsmOperandSpec (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_colontok) { Expect (mcReserved_colontok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok)) | (1 << (mcReserved_commatok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)))); AsmList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_colontok) { Expect (mcReserved_colontok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok)) | (1 << (mcReserved_commatok-mcReserved_eoftok)) | (1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)))); AsmList (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_colontok-mcReserved_eoftok))), stopset1, stopset2); if (mcLexBuf_currenttoken == mcReserved_colontok) { Expect (mcReserved_colontok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)))); TrashList (stopset0, stopset1, stopset2); } } } } /* AsmList := [ AsmElement ] { ',' AsmElement } first symbols:lsbratok, stringtok, commatok reachend */ static void AsmList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if ((mcLexBuf_currenttoken == mcReserved_lsbratok) || (mcLexBuf_currenttoken == mcReserved_stringtok)) { AsmElement (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lsbratok-mcReserved_eoftok))), stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)))); AsmElement (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* NamedOperand := '[' Ident ']' first symbols:lsbratok cannot reachend */ static void NamedOperand (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { Expect (mcReserved_lsbratok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok)))); Ident (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rsbratok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rsbratok, stopset0, stopset1, stopset2); } /* AsmOperandName := [ NamedOperand ] first symbols:lsbratok reachend */ static void AsmOperandName (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_lsbratok) { NamedOperand (stopset0, stopset1, stopset2); } } /* AsmElement := AsmOperandName string '(' Expression ')' first symbols:stringtok, lsbratok cannot reachend */ static void AsmElement (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { AsmOperandName (stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)))); string (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_lparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_lparatok, stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_minustok-mcReserved_eoftok)) | (1 << (mcReserved_plustok-mcReserved_eoftok)) | (1 << (mcReserved_lparatok-mcReserved_eoftok)) | (1 << (mcReserved_lcbratok-mcReserved_eoftok))), stopset1|(mcp4_SetOfStop1) ((1 << (mcReserved_nottok-mcReserved_arraytok))), stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)) | (1 << (mcReserved_integertok-mcReserved_recordtok)) | (1 << (mcReserved_realtok-mcReserved_recordtok)) | (1 << (mcReserved_identtok-mcReserved_recordtok)))); Expression (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_rparatok-mcReserved_eoftok))), stopset1, stopset2); Expect (mcReserved_rparatok, stopset0, stopset1, stopset2); } /* TrashList := [ string ] { ',' string } first symbols:commatok, stringtok reachend */ static void TrashList (mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2) { if (mcLexBuf_currenttoken == mcReserved_stringtok) { string (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } while (mcLexBuf_currenttoken == mcReserved_commatok) { Expect (mcReserved_commatok, stopset0, stopset1, stopset2|(mcp4_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok)))); string (stopset0|(mcp4_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2); } /* while */ } /* CompilationUnit - returns TRUE if the input was correct enough to parse in future passes. */ extern "C" unsigned int mcp4_CompilationUnit (void) { stk = mcStack_init (); WasNoError = TRUE; FileUnit ((mcp4_SetOfStop0) ((1 << (mcReserved_eoftok-mcReserved_eoftok))), (mcp4_SetOfStop1) 0, (mcp4_SetOfStop2) 0); mcStack_kill (&stk); return WasNoError; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } extern "C" void _M2_mcp4_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { } extern "C" void _M2_mcp4_finish (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[]) { }