gnuctreeparser.java
来自「plugin for eclipse」· Java 代码 · 共 3,123 行 · 第 1/5 页
JAVA
3,123 行
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
_retTree = _t;
}
public final void parameterDeclaration(AST _t) throws RecognitionException {
TNode parameterDeclaration_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
AST __t1898 = _t;
TNode tmp89_AST_in = (TNode)_t;
match(_t,NParameterDeclaration);
_t = _t.getFirstChild();
declSpecifiers(_t);
_t = _retTree;
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NDeclarator:
{
declarator(_t);
_t = _retTree;
break;
}
case NNonemptyAbstractDeclarator:
{
nonemptyAbstractDeclarator(_t);
_t = _retTree;
break;
}
case 3:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
_t = __t1898;
_t = _t.getNextSibling();
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
_retTree = _t;
}
public final void nonemptyAbstractDeclarator(AST _t) throws RecognitionException {
TNode nonemptyAbstractDeclarator_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
AST __t2013 = _t;
TNode tmp90_AST_in = (TNode)_t;
match(_t,NNonemptyAbstractDeclarator);
_t = _t.getFirstChild();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NPointerGroup:
{
pointerGroup(_t);
_t = _retTree;
{
_loop2020:
do {
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LPAREN:
{
{
TNode tmp91_AST_in = (TNode)_t;
match(_t,LPAREN);
_t = _t.getNextSibling();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NNonemptyAbstractDeclarator:
{
nonemptyAbstractDeclarator(_t);
_t = _retTree;
break;
}
case NParameterDeclaration:
{
parameterTypeList(_t);
_t = _retTree;
break;
}
case RPAREN:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
TNode tmp92_AST_in = (TNode)_t;
match(_t,RPAREN);
_t = _t.getNextSibling();
}
break;
}
case LBRACKET:
{
{
TNode tmp93_AST_in = (TNode)_t;
match(_t,LBRACKET);
_t = _t.getNextSibling();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case ID:
case ASSIGN:
case STAR:
case LPAREN:
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:
case QUESTION:
case LOR:
case LAND:
case BOR:
case BXOR:
case BAND:
case EQUAL:
case NOT_EQUAL:
case LT:
case LTE:
case GT:
case GTE:
case LSHIFT:
case RSHIFT:
case PLUS:
case MINUS:
case DIV:
case MOD:
case INC:
case DEC:
case LITERAL_sizeof:
case CharLiteral:
case NCast:
case NExpressionGroup:
case NInitializer:
case NEmptyExpression:
case NCommaExpr:
case NUnaryExpr:
case NPostfixExpr:
case NRangeExpr:
case NStringSeq:
case NLcurlyInitializer:
case NGnuAsmExpr:
case Number:
case LITERAL___alignof:
{
expr(_t);
_t = _retTree;
break;
}
case RBRACKET:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
TNode tmp94_AST_in = (TNode)_t;
match(_t,RBRACKET);
_t = _t.getNextSibling();
}
break;
}
default:
{
break _loop2020;
}
}
} while (true);
}
break;
}
case LPAREN:
case LBRACKET:
{
{
int _cnt2026=0;
_loop2026:
do {
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LPAREN:
{
{
TNode tmp95_AST_in = (TNode)_t;
match(_t,LPAREN);
_t = _t.getNextSibling();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NNonemptyAbstractDeclarator:
{
nonemptyAbstractDeclarator(_t);
_t = _retTree;
break;
}
case NParameterDeclaration:
{
parameterTypeList(_t);
_t = _retTree;
break;
}
case RPAREN:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
TNode tmp96_AST_in = (TNode)_t;
match(_t,RPAREN);
_t = _t.getNextSibling();
}
break;
}
case LBRACKET:
{
{
TNode tmp97_AST_in = (TNode)_t;
match(_t,LBRACKET);
_t = _t.getNextSibling();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case ID:
case ASSIGN:
case STAR:
case LPAREN:
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:
case QUESTION:
case LOR:
case LAND:
case BOR:
case BXOR:
case BAND:
case EQUAL:
case NOT_EQUAL:
case LT:
case LTE:
case GT:
case GTE:
case LSHIFT:
case RSHIFT:
case PLUS:
case MINUS:
case DIV:
case MOD:
case INC:
case DEC:
case LITERAL_sizeof:
case CharLiteral:
case NCast:
case NExpressionGroup:
case NInitializer:
case NEmptyExpression:
case NCommaExpr:
case NUnaryExpr:
case NPostfixExpr:
case NRangeExpr:
case NStringSeq:
case NLcurlyInitializer:
case NGnuAsmExpr:
case Number:
case LITERAL___alignof:
{
expr(_t);
_t = _retTree;
break;
}
case RBRACKET:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
TNode tmp98_AST_in = (TNode)_t;
match(_t,RBRACKET);
_t = _t.getNextSibling();
}
break;
}
default:
{
if ( _cnt2026>=1 ) { break _loop2026; } else {throw new NoViableAltException(_t);}
}
}
_cnt2026++;
} while (true);
}
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
_t = __t2013;
_t = _t.getNextSibling();
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
_retTree = _t;
}
public final void functionDeclSpecifiers(AST _t) throws RecognitionException {
TNode functionDeclSpecifiers_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
{
int _cnt1907=0;
_loop1907:
do {
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LITERAL_extern:
case LITERAL_static:
case LITERAL_inline:
{
functionStorageClassSpecifier(_t);
_t = _retTree;
break;
}
case LITERAL_volatile:
case LITERAL_const:
{
typeQualifier(_t);
_t = _retTree;
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;
break;
}
default:
{
if ( _cnt1907>=1 ) { break _loop1907; } else {throw new NoViableAltException(_t);}
}
}
_cnt1907++;
} while (true);
}
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
_retTree = _t;
}
public final void compoundStatement(AST _t) throws RecognitionException {
TNode compoundStatement_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
AST __t1916 = _t;
TNode tmp99_AST_in = (TNode)_t;
match(_t,NCompoundStatement);
_t = _t.getFirstChild();
{
_loop1918:
do {
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NDeclaration:
case LITERAL___label__:
{
declarationList(_t);
_t = _retTree;
break;
}
case NFunctionDef:
{
functionDef(_t);
_t = _retTree;
break;
}
default:
{
break _loop1918;
}
}
} while (true);
}
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case SEMI:
case LITERAL_while:
case LITERAL_do:
case LITERAL_for:
case LITERAL_goto:
case LITERAL_continue:
case LITERAL_break:
case LITERAL_return:
case LITERAL_case:
case LITERAL_default:
case LITERAL_if:
case LITERAL_switch:
case NStatementExpr:
case NCompoundStatement:
case NLabel:
{
statementList(_t);
_t = _retTree;
break;
}
case RCURLY:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
TNode tmp100_AST_in = (TNode)_t;
match(_t,RCURLY);
_t = _t.getNextSibling();
_t = __t1916;
_t = _t.getNextSibling();
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
_retTree = _t;
}
public final void declarationList(AST _t) throws RecognitionException {
TNode declarationList_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
{
int _cnt1910=0;
_loop1910:
do {
if (_t==null) _t=ASTNULL;
if ((_t.getType()==LITERAL___label__)) {
localLabelDecl(_t);
_t = _retTree;
}
else if ((_t.getType()==NDeclaration)) {
declaration(_t);
_t = _retTree;
}
else {
if ( _cnt1910>=1 ) { break _loop1910; } else {throw new NoViableAltException(_t);}
}
_cnt1910++;
} while (true);
}
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
_retTree = _t;
}
public final void localLabelDecl(AST _t) throws RecognitionException {
TNode localLabelDecl_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
AST __t1912 = _t;
TNode tmp101_AST_in = (TNode)_t;
match(_t,LITERAL___label__);
_t = _t.getFirstChild();
{
int _cnt1914=0;
_loop1914:
do {
if (_t==null) _t=ASTNULL;
if ((_t.getType()==ID)) {
TNode tmp102_AST_in = (TNode)_t;
match(_t,ID);
_t = _t.getNextSibling();
}
else {
if ( _cnt1914>=1 ) { break _loop1914; } else {throw new NoViableAltException(_t);}
}
_cnt1914++;
} while (true);
}
_t = __t1912;
_t = _t.getNextSibling();
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
_retTree = _t;
}
public final void statementList(AST _t) throws RecognitionException {
TNode statementList_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
{
int _cnt1922=0;
_loop1922:
do {
if (_t==null) _t=ASTNULL;
if ((_tokenSet_2.member(_t.getType()))) {
statement(_t);
_t = _retTree;
}
else {
if ( _cnt1922>=1 ) { break _loop1922; } else {throw new NoViableAltException(_t);}
}
_cnt1922++;
} while (true);
}
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?