Changeset 3812 for applications


Ignore:
Timestamp:
Jun 13, 2008, 5:11:33 AM (12 years ago)
Author:
orlov
Message:
  • Parser is modified correspondingly with the grammar.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/trunk/LFC/parser/Parser.rf

    r3802 r3812  
    108108Equation e.tokens = {
    109109  e.tokens : (IDENTIFIER e) e =
    110     <Parse (e.tokens) (SENTENCE (Get &Identifier) (Skip LPAR) ((Get &PatternList)) (Skip RPAR) (Skip EQ) (Get &ExpWithWhere) (Skip SC))>;
     110    <Parse (e.tokens) (SENTENCE (Get &Identifier) (Skip LPAR) ((Get &PatternList)) (Skip RPAR) (Skip EQ) (Get &ExpWithWhereOrUndef) (Skip SC))>;
    111111  <Error (e.tokens) "expected the name of a function">;
    112112};
     
    162162Exp e.tokens = {
    163163  e.tokens : (STRING e.str t.pos) e.tokens_rest = (STRING e.str) <ExpConcat e.tokens_rest>;
    164   e.tokens : (UNDEFINED e) e.tokens_rest = (UNDEFINED) <ExpConcat e.tokens_rest>;
    165164  e.tokens : (IDENTIFIER e) e = <Parse (e.tokens) (IDENT (Get &Identifier) (Get &ExpVarOrFunc)) (Get &ExpConcat)>;
    166165  e.tokens : (LPAR e) e.tokens_rest = <Parse (e.tokens_rest) (PAREN (Get &ExpWithWhere)) (Skip RPAR) (Get &ExpConcat)>;
     
    172171ExpWithWhere e.tokens = {
    173172  e.tokens : (STRING e.str t.pos) e.tokens_rest = (STRING e.str) <ExpConcatOrWhere e.tokens_rest>;
    174   e.tokens : (UNDEFINED e) e.tokens_rest = (UNDEFINED) <ExpConcatOrWhere e.tokens_rest>;
    175173  e.tokens : (IDENTIFIER e) e = <Parse (e.tokens) (IDENT (Get &Identifier) (Get &ExpVarOrFunc)) (Get &ExpConcatOrWhere)>;
    176174  e.tokens : (LPAR e) e.tokens_rest = <Parse (e.tokens_rest) (PAREN (Get &ExpWithWhere)) (Skip RPAR) (Get &ExpConcatOrWhere)>;
     
    180178};
    181179
     180$func ExpWithWhereOrUndef e.tokens = e.ast (e.tokens);
     181ExpWithWhereOrUndef e.tokens = {
     182  e.tokens : (UNDEFINED e) = (UNDEFINED);
     183  e.tokens : \{ (IDENTIFIER e) e;  (IF e) e; (LPAR e) e; (STRING e) e; } = <ExpWithWhere e.tokens>;
     184};
     185
    182186$func ExpVarOrFunc e.tokens = e.ast (e.tokens);
    183187ExpVarOrFunc e.tokens = {
     
    190194ArgList e.tokens = {
    191195  e.tokens : (RPAR e) e = (e.tokens);
    192   e.tokens : \{ (IDENTIFIER e) e;  (IF e) e; (LPAR e) e; (STRING e) e; (UNDEFINED e) e; } =
     196  e.tokens : \{ (IDENTIFIER e) e;  (IF e) e; (LPAR e) e; (STRING e) e; } =
    193197    <Parse (e.tokens) ((Get &Exp)) (Get &ArgListRest)>;
    194198  <Error (e.tokens) "expected a function argument or ')'">;
Note: See TracChangeset for help on using the changeset viewer.