📄 nesctreeparser.java
字号:
AST __t3500 = _t;
TNode tmp14_AST = null;
TNode tmp14_AST_in = null;
tmp14_AST = (TNode)astFactory.create((TNode)_t);
tmp14_AST_in = (TNode)_t;
astFactory.addASTChild(currentAST, tmp14_AST);
ASTPair __currentAST3500 = currentAST.copy();
currentAST.root = currentAST.child;
currentAST.child = null;
match(_t,LITERAL_asm);
_t = _t.getFirstChild();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LITERAL_volatile:
{
TNode tmp15_AST = null;
TNode tmp15_AST_in = null;
tmp15_AST = (TNode)astFactory.create((TNode)_t);
tmp15_AST_in = (TNode)_t;
astFactory.addASTChild(currentAST, tmp15_AST);
match(_t,LITERAL_volatile);
_t = _t.getNextSibling();
break;
}
case LCURLY:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
TNode tmp16_AST = null;
TNode tmp16_AST_in = null;
tmp16_AST = (TNode)astFactory.create((TNode)_t);
tmp16_AST_in = (TNode)_t;
astFactory.addASTChild(currentAST, tmp16_AST);
match(_t,LCURLY);
_t = _t.getNextSibling();
expr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
TNode tmp17_AST = null;
TNode tmp17_AST_in = null;
tmp17_AST = (TNode)astFactory.create((TNode)_t);
tmp17_AST_in = (TNode)_t;
astFactory.addASTChild(currentAST, tmp17_AST);
match(_t,RCURLY);
_t = _t.getNextSibling();
{
int _cnt3503=0;
_loop3503:
do {
if (_t==null) _t=ASTNULL;
if ((_t.getType()==SEMI)) {
TNode tmp18_AST = null;
TNode tmp18_AST_in = null;
tmp18_AST = (TNode)astFactory.create((TNode)_t);
tmp18_AST_in = (TNode)_t;
astFactory.addASTChild(currentAST, tmp18_AST);
match(_t,SEMI);
_t = _t.getNextSibling();
}
else {
if ( _cnt3503>=1 ) { break _loop3503; } else {throw new NoViableAltException(_t);}
}
_cnt3503++;
} while (true);
}
currentAST = __currentAST3500;
_t = __t3500;
_t = _t.getNextSibling();
asm_expr_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
returnAST = asm_expr_AST;
_retTree = _t;
}
public final void typelessDeclaration(AST _t) throws RecognitionException {
TNode typelessDeclaration_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode typelessDeclaration_AST = null;
try { // for error handling
AST __t3498 = _t;
TNode tmp19_AST = null;
TNode tmp19_AST_in = null;
tmp19_AST = (TNode)astFactory.create((TNode)_t);
tmp19_AST_in = (TNode)_t;
astFactory.addASTChild(currentAST, tmp19_AST);
ASTPair __currentAST3498 = currentAST.copy();
currentAST.root = currentAST.child;
currentAST.child = null;
match(_t,NTypeMissing);
_t = _t.getFirstChild();
initDeclList(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
TNode tmp20_AST = null;
TNode tmp20_AST_in = null;
tmp20_AST = (TNode)astFactory.create((TNode)_t);
tmp20_AST_in = (TNode)_t;
astFactory.addASTChild(currentAST, tmp20_AST);
match(_t,SEMI);
_t = _t.getNextSibling();
currentAST = __currentAST3498;
_t = __t3498;
_t = _t.getNextSibling();
typelessDeclaration_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
returnAST = typelessDeclaration_AST;
_retTree = _t;
}
public final void initDeclList(AST _t) throws RecognitionException {
TNode initDeclList_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode initDeclList_AST = null;
try { // for error handling
{
int _cnt3570=0;
_loop3570:
do {
if (_t==null) _t=ASTNULL;
if ((_t.getType()==NInitDecl)) {
initDecl(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
}
else {
if ( _cnt3570>=1 ) { break _loop3570; } else {throw new NoViableAltException(_t);}
}
_cnt3570++;
} while (true);
}
initDeclList_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
returnAST = initDeclList_AST;
_retTree = _t;
}
public final void expr(AST _t) throws RecognitionException {
TNode expr_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode expr_AST = null;
try { // for error handling
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case ASSIGN:
case DIV_ASSIGN:
case PLUS_ASSIGN:
case MINUS_ASSIGN:
case STAR_ASSIGN:
case MOD_ASSIGN:
case RSHIFT_ASSIGN:
case LSHIFT_ASSIGN:
case BAND_ASSIGN:
case BOR_ASSIGN:
case BXOR_ASSIGN:
{
assignExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case QUESTION:
{
conditionalExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case LOR:
{
logicalOrExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case LAND:
{
logicalAndExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case BOR:
{
inclusiveOrExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case BXOR:
{
exclusiveOrExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case BAND:
{
bitAndExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case EQUAL:
case NOT_EQUAL:
{
equalityExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case LT:
case LTE:
case GT:
case GTE:
{
relationalExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case LSHIFT:
case RSHIFT:
{
shiftExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case PLUS:
case MINUS:
{
additiveExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case STAR:
case DIV:
case MOD:
{
multExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case NCast:
{
castExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case INC:
case DEC:
case LITERAL_sizeof:
case NUnaryExpr:
case LITERAL___alignof:
{
unaryExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case NPostfixExpr:
{
postfixExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case ID:
case CharLiteral:
case NExpressionGroup:
case NStringSeq:
case Number:
{
primaryExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case NCommaExpr:
{
commaExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case NEmptyExpression:
{
emptyExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case LPAREN:
{
compoundStatementExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case NInitializer:
case NLcurlyInitializer:
{
initializer(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case NRangeExpr:
{
rangeExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
case NGnuAsmExpr:
{
gnuAsmExpr(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
expr_AST = (TNode)currentAST.root;
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
returnAST = expr_AST;
_retTree = _t;
}
public final void declSpecifiers(AST _t) throws RecognitionException {
TNode declSpecifiers_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode declSpecifiers_AST = null;
try { // for error handling
{
int _cnt3511=0;
_loop3511:
do {
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LITERAL_typedef:
case LITERAL_auto:
case LITERAL_register:
case LITERAL_extern:
case LITERAL_static:
case LITERAL_default:
case LITERAL_inline:
case LITERAL_norace:
case LITERAL_async:
case LITERAL_command:
case LITERAL_event:
case LITERAL_task:
{
storageClassSpecifier(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
break;
}
case LITERAL_volatile:
case LITERAL_const:
{
typeQualifier(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
break;
}
case LITERAL_struct:
case LITERAL_union:
case LITERAL_enum:
case LITERAL_void:
case LITERAL_char:
case LITERAL_short:
case LITERAL_int:
case LITERAL_long:
case LITERAL_float:
case LITERAL_double:
case LITERAL_signed:
case LITERAL_unsigned:
case NTypedefName:
case LITERAL_typeof:
case LITERAL___complex:
{
typeSpecifier(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
break;
}
default:
{
if ( _cnt3511>=1 ) { break _loop3511; } else {throw new NoViableAltException(_t);}
}
}
_cnt3511++;
} while (true);
}
declSpecifiers_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
returnAST = declSpecifiers_AST;
_retTree = _t;
}
public final void storageClassSpecifier(AST _t) throws RecognitionException {
TNode storageClassSpecifier_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode storageClassSpecifier_AST = null;
TNode a = null;
TNode a_AST = null;
TNode b = null;
TNode b_AST = null;
TNode c = null;
TNode c_AST = null;
TNode d = null;
TNode d_AST = null;
try { // for error handling
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LITERAL_auto:
{
a = (TNode)_t;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -