1
0
forked from GitHub/gf-core

Use LCLR algorithm for eliminating left-recursion, with lambda terms in SISR for getting trees right.

This commit is contained in:
bringert
2006-12-20 20:10:15 +00:00
parent 5b8680b8fd
commit cb70ffadaa
14 changed files with 541 additions and 308 deletions

View File

@@ -122,6 +122,7 @@ Expr16 : Ident { EVar $1 }
| 'null' { ENull }
| 'this' { EThis }
| 'function' '(' ListIdent ')' '{' ListStmt '}' { EFun $3 (reverse $6) }
| '(' Expr ',' ListExpr ')' { eseq1_ $2 $4 }
| '(' Expr ')' { $2 }
@@ -201,5 +202,6 @@ happyError ts =
_ -> " before " ++ unwords (map prToken (take 4 ts))
myLexer = tokens
eseq1_ x_ xs_ = ESeq (x_ : xs_)
}