mirror of
https://github.com/golang/go
synced 2024-10-03 18:11:22 -06:00
3aa892c4f9
- more work on template-driven ast printing R=r OCL=27851 CL=27851
40 lines
394 B
Plaintext
40 lines
394 B
Plaintext
//string =
|
|
// "%s" ;
|
|
|
|
pointer =
|
|
^ ;
|
|
|
|
array =
|
|
^ ;
|
|
|
|
//token.Token =
|
|
// "token<%d>" ; // this should be a Go-installed formatter
|
|
|
|
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 =
|
|
^ ; |