1
0
forked from GitHub/gf-core

Added the beginnings of GFCC to JavaScript conversion.

This commit is contained in:
bringert
2006-11-30 22:50:25 +00:00
parent 1e3ea113bb
commit ae188e067f
13 changed files with 2001 additions and 3 deletions

33
src/GF/JavaScript/JS.cf Normal file
View File

@@ -0,0 +1,33 @@
entrypoints Program;
Program. Program ::= [Element];
FunDef. Element ::= "function" Ident "(" [Ident] ")" "{" [Stmt] "}" ;
ElStmt. Element ::= Stmt;
separator Element "" ;
separator Ident "," ;
Compound. Stmt ::= "{" [Stmt] "}" ;
ReturnVoid. Stmt ::= "return" ";" ;
Return. Stmt ::= "return" Expr ";" ;
separator Stmt "" ;
ENew. Expr14 ::= "new" Ident "(" [Expr] ")" ;
EMember. Expr15 ::= Expr15 "." Expr16 ;
EIndex. Expr15 ::= Expr15 "[" Expr "]" ;
ECall. Expr15 ::= Expr15 "(" [Expr] ")" ;
EVar. Expr16 ::= Ident ;
EInt. Expr16 ::= Integer ;
EDbl. Expr16 ::= Double ;
EStr. Expr16 ::= String ;
ETrue. Expr16 ::= "true" ;
EFalse. Expr16 ::= "false" ;
ENull. Expr16 ::= "null" ;
EThis. Expr16 ::= "this" ;
separator Expr "," ;
coercions Expr 16 ;