gnuctreeparser.java
来自「plugin for eclipse」· Java 代码 · 共 3,123 行 · 第 1/5 页
JAVA
3,123 行
case LCURLY:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LCURLY:
{
TNode tmp43_AST_in = (TNode)_t;
match(_t,LCURLY);
_t = _t.getNextSibling();
enumList(_t);
_t = _retTree;
TNode tmp44_AST_in = (TNode)_t;
match(_t,RCURLY);
_t = _t.getNextSibling();
break;
}
case 3:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
_t = __t1839;
_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 typedefName(AST _t) throws RecognitionException {
TNode typedefName_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
AST __t1811 = _t;
TNode tmp45_AST_in = (TNode)_t;
match(_t,NTypedefName);
_t = _t.getFirstChild();
TNode tmp46_AST_in = (TNode)_t;
match(_t,ID);
_t = _t.getNextSibling();
_t = __t1811;
_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 typeName(AST _t) throws RecognitionException {
TNode typeName_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
specifierQualifierList(_t);
_t = _retTree;
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NNonemptyAbstractDeclarator:
{
nonemptyAbstractDeclarator(_t);
_t = _retTree;
break;
}
case RPAREN:
{
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 structOrUnionBody(AST _t) throws RecognitionException {
TNode structOrUnionBody_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
{
boolean synPredMatched1819 = false;
if (((_t.getType()==ID))) {
AST __t1819 = _t;
synPredMatched1819 = true;
inputState.guessing++;
try {
{
TNode tmp47_AST_in = (TNode)_t;
match(_t,ID);
_t = _t.getNextSibling();
TNode tmp48_AST_in = (TNode)_t;
match(_t,LCURLY);
_t = _t.getNextSibling();
}
}
catch (RecognitionException pe) {
synPredMatched1819 = false;
}
_t = __t1819;
inputState.guessing--;
}
if ( synPredMatched1819 ) {
TNode tmp49_AST_in = (TNode)_t;
match(_t,ID);
_t = _t.getNextSibling();
TNode tmp50_AST_in = (TNode)_t;
match(_t,LCURLY);
_t = _t.getNextSibling();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LITERAL_volatile:
case LITERAL_struct:
case LITERAL_union:
case LITERAL_enum:
case LITERAL_const:
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:
{
structDeclarationList(_t);
_t = _retTree;
break;
}
case RCURLY:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
TNode tmp51_AST_in = (TNode)_t;
match(_t,RCURLY);
_t = _t.getNextSibling();
}
else if ((_t.getType()==LCURLY)) {
TNode tmp52_AST_in = (TNode)_t;
match(_t,LCURLY);
_t = _t.getNextSibling();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LITERAL_volatile:
case LITERAL_struct:
case LITERAL_union:
case LITERAL_enum:
case LITERAL_const:
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:
{
structDeclarationList(_t);
_t = _retTree;
break;
}
case RCURLY:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
TNode tmp53_AST_in = (TNode)_t;
match(_t,RCURLY);
_t = _t.getNextSibling();
}
else if ((_t.getType()==ID)) {
TNode tmp54_AST_in = (TNode)_t;
match(_t,ID);
_t = _t.getNextSibling();
}
else {
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 structDeclarationList(AST _t) throws RecognitionException {
TNode structDeclarationList_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
{
int _cnt1824=0;
_loop1824:
do {
if (_t==null) _t=ASTNULL;
if ((_tokenSet_1.member(_t.getType()))) {
structDeclaration(_t);
_t = _retTree;
}
else {
if ( _cnt1824>=1 ) { break _loop1824; } else {throw new NoViableAltException(_t);}
}
_cnt1824++;
} 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 structDeclaration(AST _t) throws RecognitionException {
TNode structDeclaration_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
specifierQualifierList(_t);
_t = _retTree;
structDeclaratorList(_t);
_t = _retTree;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
_retTree = _t;
}
public final void specifierQualifierList(AST _t) throws RecognitionException {
TNode specifierQualifierList_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
{
int _cnt1828=0;
_loop1828:
do {
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
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;
}
case LITERAL_volatile:
case LITERAL_const:
{
typeQualifier(_t);
_t = _retTree;
break;
}
default:
{
if ( _cnt1828>=1 ) { break _loop1828; } else {throw new NoViableAltException(_t);}
}
}
_cnt1828++;
} 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 structDeclaratorList(AST _t) throws RecognitionException {
TNode structDeclaratorList_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
{
int _cnt1831=0;
_loop1831:
do {
if (_t==null) _t=ASTNULL;
if ((_t.getType()==NStructDeclarator)) {
structDeclarator(_t);
_t = _retTree;
}
else {
if ( _cnt1831>=1 ) { break _loop1831; } else {throw new NoViableAltException(_t);}
}
_cnt1831++;
} 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 structDeclarator(AST _t) throws RecognitionException {
TNode structDeclarator_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
try { // for error handling
AST __t1833 = _t;
TNode tmp55_AST_in = (TNode)_t;
match(_t,NStructDeclarator);
_t = _t.getFirstChild();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NDeclarator:
{
declarator(_t);
_t = _retTree;
break;
}
case 3:
case COLON:
case NAsmAttribute:
case LITERAL___attribute:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case COLON:
{
TNode tmp56_AST_in = (TNode)_t;
match(_t,COLON);
_t = _t.getNextSibling();
expr(_t);
_t = _retTree;
break;
}
case 3:
case NAsmAttribute:
case LITERAL___attribute:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
{
_loop1837:
do {
if (_t==null) _t=ASTNULL;
if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) {
attributeDecl(_t);
_t = _retTree;
}
else {
break _loop1837;
}
} while (true);
}
_t = __t1833;
_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 declarator(AST _t) throws RecognitionException {
TNode declarator_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
TNode id = null;
try { // for error handling
AST __t1883 = _t;
TNode tmp57_AST_in = (TNode)_t;
match(_t,NDeclarator);
_t = _t.getFirstChild();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NPointerGroup:
{
pointerGroup(_t);
_t = _retTree;
break;
}
case ID:
case LPAREN:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case ID:
{
id = (TNode)_t;
match(_t,ID);
_t = _t.getNextSibling();
break;
}
case LPAREN:
{
TNode tmp58_AST_in = (TNode)_t;
match(_t,LPAREN);
_t = _t.getNextSibling();
declarator(_t);
_t = _retTree;
TNode tmp59_AST_in = (TNode)_t;
match(_t,RPAREN);
_t = _t.getNextSibling();
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
{
_loop1891:
do {
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NParameterTypeList:
{
AST __t1887 = _t;
TNode tmp60_AST_in = (TNode)_t;
match(_t,NParameterTypeList);
_t = _t.getFirstChild();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NParameterDeclaration:
{
parameterTypeList(_t);
_t = _retTree;
break;
}
case ID:
case RPAREN:
{
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case ID:
{
idList(_t);
_t = _retTree;
break;
}
case RPAREN:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
TNode tmp61_AST_in = (TNode)_t;
match(_t,RPAREN);
_t = _t.getNextSibling();
_t = __t1887;
_t = _t.getNextSibling();
break;
}
case LBRACKET:
{
TNode tmp62_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:
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?