代码搜索结果
找到约 10,000 项符合
G 的代码
calculator.g
grammar Calculator;
options {
language = Ruby;
}
evaluate returns [result]: r=expression { result = r };
expression returns [result]: r=mult (
'+' r2=mult {
r += r2
}
| '-' r2=mu
java.g
lexer grammar FuzzyJava;
options {filter=true; language=ObjC;}
IMPORT
: 'import' WS name=QIDStar WS? ';'
;
/** Avoids having "return foo;" match as a field */
RETURN
: 'return' (options {greedy=
fuzzyjava.g
lexer grammar FuzzyJava;
options {
filter=true;
language=ObjC;
}
IMPORT
: 'import' WS name=QIDStar WS? ';'
;
/** Avoids having "return foo;" match as a field */
RETURN
: 'return' (options {gr
test.g
lexer grammar Test;
options {
language=ObjC;
}
@header {}
ID : LETTER (LETTER | DIGIT)*
;
fragment DIGIT : '0'..'9'
;
fragment LETTER
: 'a'..'z' | 'A'..'Z'
;
t.g
/** Demonstrates how semantic predicates get hoisted out of the rule in
* which they are found and used in other decisions. This grammar illustrates
* how predicates can be used to distinguish b
symboltable.g
grammar SymbolTable;
/* Scope of symbol names. Both globals and block rules need to push a new
* symbol table upon entry and they must use the same stack. So, I must
* define a global scope and s
simplec.g
grammar SimpleC;
options {
language=ObjC;
}
program
: declaration+
;
/** In this rule, the functionHeader left prefix on the last two
* alternatives is not LL(k) for a fixed k. Howeve
simplec.g
grammar SimpleC;
options {
output=AST;
language=ObjC;
}
tokens {
VAR_DEF;
ARG_DEF;
FUNC_HDR;
FUNC_DECL;
FUNC_DEF;
BLOCK;
}
program
: declaration+
;
declara
simplectp.g
tree grammar SimpleCTP;
options {
tokenVocab=SimpleC;
language=ObjC;
ASTLabelType=ANTLRCommonTree;
}
program
: declaration+
;
declaration
: variable
| ^(FUNC_DECL functio
combined.g
grammar Combined;
options {
language=ObjC;
}
stat: identifier+ ;
identifier
: ID
;
ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*
;
INT : ('0'..'9')+
;
WS