2009-04-24 18:22:58 -06:00
|
|
|
//string =
|
|
|
|
// "%s" ;
|
2009-04-23 22:53:01 -06:00
|
|
|
|
2009-04-24 18:22:58 -06:00
|
|
|
pointer =
|
|
|
|
^ ;
|
2009-04-23 22:53:01 -06:00
|
|
|
|
2009-04-24 18:22:58 -06:00
|
|
|
array =
|
|
|
|
^ ;
|
2009-04-23 22:53:01 -06:00
|
|
|
|
2009-04-24 18:22:58 -06:00
|
|
|
//token.Token =
|
|
|
|
// "token<%d>" ; // this should be a Go-installed formatter
|
2009-04-23 22:53:01 -06:00
|
|
|
|
2009-04-24 18:22:58 -06:00
|
|
|
ast
|
|
|
|
;
|
|
|
|
|
|
|
|
Comments =
|
|
|
|
"comments\n" ;
|
|
|
|
|
|
|
|
Ident =
|
|
|
|
Value ;
|
|
|
|
|
|
|
|
Program =
|
|
|
|
"package " Name "\n\n" { Decls "\n\n" } ;
|
|
|
|
|
|
|
|
GenDecl =
|
|
|
|
Doc
|
|
|
|
Tok " (\n"
|
|
|
|
")\n";
|
|
|
|
|
|
|
|
FuncType =
|
|
|
|
"(" { Params } ")" ;
|
|
|
|
|
|
|
|
BlockStmt =
|
|
|
|
"{\n" "}\n" ;
|
|
|
|
|
|
|
|
FuncDecl =
|
|
|
|
"func " Name Type [ " " Body ] ;
|
|
|
|
|
|
|
|
Decl =
|
|
|
|
^ ;
|