📄 parser.whl.svn-base
字号:
// the reference file.method=SLR1;dump_lr_automaton_to_file=true;lexical_analyzer_class = LexicalAnalyzer;whale_class = Parser;//compress_goto_table = false;terminal identifier(IdentLX), real-number(RealNumberLX), int-number(IntNumberLX), string(StringLX), "+"(PlusLX), "!="(NotEqualLX), "-"(MinusLX), "*"(MulLX), "/"(DivLX), ":="(AssignLX), "&"(AmpersandLX), "~"(TildeLX), "="(EqualLX), "<"(LessLX), ">"(GreaterLX), "<="(LessEqLX), ">="(GreaterEqLX), "("(LeftBrackLX), ")"(RightBrackLX), "["(LeftSqBrackLX), "]"(RightSqBrackLX), "{"(LeftFigBrackLX), "}"(RightFigBrackLX), "^"(CoverLX), ","(CommaLX), "."(PointLX), ";"(SemicolonLX), ":"(ColonLX), "|"(VertSlashLX), ".."(DotsLX);terminal DEFINITION(DefinitionRW), IMPLEMENTATION(ImplementationRW), POINTER(PointerRW), PROCEDURE(ProcedureRW), QUALIFIED(QualifiedRW), AND(AndRW), ARRAY(ArrayRW), BEGIN(BeginRW), BY(ByRW), CASE(CaseRW), CONST(ConstRW), DIV(DivRW), DO(DoRW), ELSE(ElseRW), ELSIF(ElseifRW), END(EndRW), EXIT(ExitRW), EXPORT(ExportRW), FOR(ForRW), FROM(FromRW), IF(IfRW), IMPORT(ImportRW), IN(InRW), LOOP(LoopRW), MOD(ModRW), MODULE(ModuleRW), NOT(NotRW), OF(OfRW), OR(OrRW), RECORD(RecordRW), REPEAT(RepeatRW), RETURN(ReturnRW), SET(SetRW), THEN(ThenRW), TO(ToRW), TYPE(TypeRW), UNTIL(UntilRW), VAR(VarRW), WHILE(WhileRW), WITH(WithRW);S -> definition-module | [ IMPLEMENTATION ] program-module;//S -> IMPLEMENTATION MODULE identifier ";" BEGIN END identifier ".";definition-module -> DEFINITION MODULE identifier ";" ( import )* ( definition )* END identifier ".";program-module -> MODULE identifier ";" ( import )* block identifier ".";import -> [ FROM identifier ] IMPORT list-ident ";";definition -> CONST ( const-description ";" )* | TYPE ( identifier [ "=" type ] ";" )* | VAR ( var-description ";" )* | head-procedure ;block -> ( description )* [ BEGIN sequence-operator ] END;list-ident -> identifier ( "," identifier )*;const-description -> identifier "=" const-expression;type -> simple-type | array-type | record-type | set-type | pointer-type | procedure-type;var-description -> list-ident ":" type;head-procedure -> PROCEDURE identifier [ form-param ];description -> CONST ( const-description ";" )* | TYPE ( type-description ";" )* | VAR ( var-description ";" )* | proc-description ";" | module-description ";";sequence-operator -> operator ( ";" operator )*;const-expression -> expression;simple-type -> qual-ident | enumeration | type-range;array-type -> ARRAY simple-type ( "," simple-type )* OF type;record-type -> RECORD seq-list-component END;set-type -> SET OF simple-type;pointer-type -> POINTER TO type;procedure-type -> PROCEDURE [ list-form-type ];form-param -> "(" [ fp-section ( ";" fp-section )* ] ")" [ ";" qual-ident ];type-description -> identifier "=" type;proc-description -> head-procedure ";" block identifier;module-description -> MODULE identifier ";" ( import )* [ export ] block identifier;operator -> [ assignment | call-proc | cond-operator | select-operator | loop-while | loop-until | loop | loop-step | join-operator | EXIT | RETURN [ expression ] ];expression -> simple-expression [ relation simple-expression ];qual-ident -> identifier ( "." identifier )*;enumeration -> "(" list-ident ")";type-range -> [ identifier ] "[" const-expression ".." const-expression "]";seq-list-component -> list-component ( ";" list-component )*;list-form-type -> "(" [ [ VAR ] form-type ( ";" [ VAR ] form-type )* ] ")" [ ":" qual-ident ];fp-section -> [ VAR ] list-ident ":" form-type;export -> EXPORT [ QUALIFIED ] list-ident ";";assignment -> signature ":=" expression;call-proc -> signature [ actual-params ];cond-operator -> IF expression THEN sequence-operator ( ELSIF expression THEN sequence-operator )* [ ELSE sequence-operator ] END;select-operator -> CASE expression OF alternative ( "|" alternative )* [ ELSE sequence-operator ] END;loop-while -> WHILE expression DO sequence-operator END;loop-until -> REPEAT sequence-operator UNTIL expression;loop -> LOOP sequence-operator END;loop-step -> FOR identifier ":=" expression TO expression [ BY const-expression ] DO sequence-operator END;join-operator -> WITH signature DO sequence-operator END;simple-expression -> [ "+" | "-" ] addend ( add-operation addend )*;relation -> "=" | "!=" | "<" | ">" | "<=" | ">=" | IN;list-component -> [ list-ident ":" type ];form-type -> [ ARRAY OF ] qual-ident;signature -> qual-ident ( "." identifier | "[" list-expression "]" | "^" )*;alternative -> [ list-label-variant ":" sequence-operator ];addend -> multiplier ( mul-operation multiplier )*;add-operation -> "+" | "-" | OR;list-expression -> expression ( "," expression )*;list-label-variant -> label-variant ( "," label-variant )*;label-variant -> const-expression [ ".." const-expression ];multiplier -> int-number | real-number | string | set | signature [ actual-params ] | "(" expression ")" | NOT multiplier;actual-params -> "(" [ list-expression ] ")";set -> [ qual-ident ] "{" [ element ( "," element )* ] "}";element -> expression [ ".." expression ];mul-operation -> "*" | "/" | DIV | MOD | AND;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -