代码搜索结果
找到约 10,000 项符合
G 的代码
javadocparse.g
class DemoJavaDocParser extends Parser;
options {
importVocab=JavaDoc;
}
content
: ( p:PARAM // includes ID as part of PARAM
{System.out.println("found: "+p.getText());}
| e:EXCEPTION
{Syst
javadoclex.g
class DemoJavaDocLexer extends Lexer;
options {
k=2;
importVocab = Common;
exportVocab = JavaDoc;
filter=true;
}
PARAM
: "@param" ' ' ID
;
EXCEPTION
: "@exception" ' ' ID
;
protected
ID : (
javaparse.g
class DemoJavaParser extends Parser;
options {
importVocab=Java;
}
input
: ( (javadoc)? INT ID SEMI )+
;
javadoc
: JAVADOC_OPEN
{
DemoJavaDocParser jdocparser = new DemoJavaDocParser(getInpu
subc.g
options {
mangleLiteralPrefix = "TK_";
}
class MyCParser extends TinyCParser;
// add initializers to variables
variable
{
// init action
}
: type declarator (ASSIGN aexpr)? SEMI
;
lexer.g
/*
* Make sure to run antlr.Tool on the lexer.g file first!
*/
options {
mangleLiteralPrefix = "TK_";
}
class TinyCLexer extends Lexer;
options {
k=2;
exportVocab=TinyC;
charVocabulary = '\3'..
tinyc.g
/*
* Make sure to run antlr.Tool on the lexer.g file first!
*/
options {
mangleLiteralPrefix = "TK_";
}
{
import java.io.*;
class Main {
public static void main(String[] args) {
try {
TinyC
calc.g
class CalcParser extends Parser;
options {
buildAST = true; // uses CommonAST by default
}
expr
: mexpr (PLUS^ mexpr)* SEMI!
;
mexpr
: atom (STAR^ atom)*
;
atom: INT
;
class
p.g
class PParser extends Parser;
{
public void traceOut(String rname) throws TokenStreamException {
System.out.println("exit "+rname+"; LT(1)="+LT(1));
}
public void traceIn(String rname) thro
treewalk.g
class LangParser extends Parser;
options {
codeGenMakeSwitchThreshold = 3;
codeGenBitsetTestThreshold = 4;
buildAST=true;
}
block
: LCURLY^ ( statement )* RCURLY!
;
statement
: expr SEMI!
|
links.g
{
import java.util.Vector;
}
/** Parse an entire html file, firing events to a single listener
* for each image and href link encountered. All tokens are
* defined to skip so the lexer will cont