diff options
author | Alex AUVOLAT <alex.auvolat@ens.fr> | 2013-11-19 13:46:24 +0100 |
---|---|---|
committer | Alex AUVOLAT <alex.auvolat@ens.fr> | 2013-11-19 13:46:24 +0100 |
commit | 18c57ed99f55c999080000ebe12ffbae68357eee (patch) | |
tree | 70bd7df003f5f379cc086862594dcf7854ed3f38 /src | |
parent | f20d043f9d9ace0ed6cd1359c8308c0eb39e0919 (diff) | |
download | LPC-Projet-18c57ed99f55c999080000ebe12ffbae68357eee.tar.gz LPC-Projet-18c57ed99f55c999080000ebe12ffbae68357eee.zip |
Corrected parsing problem...
Diffstat (limited to 'src')
-rw-r--r-- | src/parser.mly | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/parser.mly b/src/parser.mly index 307a679..eb0a959 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -224,7 +224,7 @@ expression: | e1 = expression ASSIGN e2 = expression { EAssign(e1, e2) } | a = expression b = binop c = expression { EBinary(a, b, c) } | a = expression LPAREN arg = separated_list(COMMA, expression) RPAREN { ECall(a, arg) } -| a = unop { a } +| a = lunop { a } | NEW c = TIDENT LPAREN args = separated_list(COMMA, expression) RPAREN { ENew(c, args) } ; @@ -256,10 +256,10 @@ primary: | a = primary DOT b = IDENT { EMember(a, b) } ; -unop: -| e = lunop { e } -| e = unop INCR { EUnary(PostIncr, e) } -| e = unop DECR { EUnary(PostDecr, e) } +runop: +| e = primary { e } +| e = runop INCR { EUnary(PostIncr, e) } +| e = runop DECR { EUnary(PostDecr, e) } ; lunop: @@ -270,7 +270,7 @@ lunop: | TIMES e = lunop { EUnary(Deref, e) } | INCR e = lunop { EUnary(PreIncr, e) } | DECR e = lunop { EUnary(PreDecr, e) } -| e = primary { e } +| e = runop { e } ; str_expression: |