代码搜索结果
找到约 10,000 项符合
G 的代码
p.g
options {
language = "Sather";
}
class P_PARSER extends Parser;
{
println( s : STR ) is
OUT::create + s + '\n';
end;
}
startRule
: ( decl )+
;
decl: INT a:ID { println("decl "
treewalk.g
options {
language = "Sather";
}
class LANG_PARSER extends Parser;
options {
codeGenMakeSwitchThreshold = 3;
codeGenBitsetTestThreshold = 4;
buildAST=true;
}
block
: LCURLY^ ( sta
sather.g
/*
* Sather 1.2 Grammar
*
* Version 0.1 Mika Illouz mika@sdna2.ucsd.edu
* Beware: full of mistakes, but its a start. I'm particularly unsure
* about expression precendence, external
expr.g
options {
language = "Sather";
}
class EXPR_PARSER extends Parser;
options {
codeGenMakeSwitchThreshold = 3;
codeGenBitsetTestThreshold = 4;
buildAST=true;
}
expr
: assignExpr
test.g
options {
language = "Sather";
}
{
class MAIN is
main( args : ARRAY{STR} ) is
AST_TEST{ANTLR_COMMON_TOKEN,ANTLR_COMMON_AST}::test;
end;
end;
}
class AST_TEST extends P
treewalk.g
options {
language = "Sather";
}
class LANG_PARSER extends Parser;
options {
buildAST=true;
}
tokens {
BLOCK; // imaginary token
}
block
: LCURLY! ( statement )* RCURLY!
// a
html.g
options {
language = "Sather";
}
/*
Based on the HTML 3.2 spec. by the W3 (http://www.w3.org)
Alexander Hinds & Terence Parr
Magelang Institute, Ltd.
Send comments to: parrt@jguru.com
data.g
options {
language = "Sather";
}
class DATA_PARSER extends Parser;
{
println ( s : STR ) is
#OUT + s + "\n";
end;
}
file: ( sh:SHORT {println(sh.text);}
| st:STRING {pri
calc.g
options {
language = "Sather";
}
/* This example demonstrates the heterogeneous tree construction
* mechanism. Compare this example to examples/calc/calc.g
* to see that I use tree node methods
instr.g
options {
language = "Sather";
}
class INSTR_PARSER extends Parser;
options {
buildAST = true;
k=2;
}
tokens {
CALL; // define imaginary token CALL
}
slist
: ( stat )+
;
st