gnucemitter.java
来自「plugin for eclipse」· Java 代码 · 共 2,964 行 · 第 1/5 页
JAVA
2,964 行
case LITERAL_struct:
{
structSpecifier(_t);
_t = _retTree;
{
_loop2582:
do {
if (_t==null) _t=ASTNULL;
if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) {
attributeDecl(_t);
_t = _retTree;
}
else {
break _loop2582;
}
} while (true);
}
break;
}
case LITERAL_union:
{
unionSpecifier(_t);
_t = _retTree;
{
_loop2584:
do {
if (_t==null) _t=ASTNULL;
if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) {
attributeDecl(_t);
_t = _retTree;
}
else {
break _loop2584;
}
} while (true);
}
break;
}
case LITERAL_enum:
{
enumSpecifier(_t);
_t = _retTree;
break;
}
case NTypedefName:
{
typedefName(_t);
_t = _retTree;
break;
}
case LITERAL_typeof:
{
AST __t2585 = _t;
n = _t==ASTNULL ? null :(TNode)_t;
match(_t,LITERAL_typeof);
_t = _t.getFirstChild();
lp = (TNode)_t;
match(_t,LPAREN);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
print( n ); print( lp );
}
{
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:
{
typeName(_t);
_t = _retTree;
break;
}
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;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
rp = (TNode)_t;
match(_t,RPAREN);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
print( rp );
}
_t = __t2585;
_t = _t.getNextSibling();
break;
}
case LITERAL___complex:
{
p = (TNode)_t;
match(_t,LITERAL___complex);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
print( p );
}
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 functionStorageClassSpecifier(AST _t) throws RecognitionException {
TNode functionStorageClassSpecifier_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
TNode a = null;
TNode b = null;
TNode c = null;
try { // for error handling
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LITERAL_extern:
{
a = (TNode)_t;
match(_t,LITERAL_extern);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
print( a );
}
break;
}
case LITERAL_static:
{
b = (TNode)_t;
match(_t,LITERAL_static);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
print( b );
}
break;
}
case LITERAL_inline:
{
c = (TNode)_t;
match(_t,LITERAL_inline);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
print( c );
}
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 structSpecifier(AST _t) throws RecognitionException {
TNode structSpecifier_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
TNode a = null;
try { // for error handling
AST __t2592 = _t;
a = _t==ASTNULL ? null :(TNode)_t;
match(_t,LITERAL_struct);
_t = _t.getFirstChild();
if ( inputState.guessing==0 ) {
print( a );
}
structOrUnionBody(_t);
_t = _retTree;
_t = __t2592;
_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 attributeDecl(AST _t) throws RecognitionException {
TNode attributeDecl_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
TNode a = null;
TNode b = null;
TNode n = null;
TNode lp = null;
TNode rp = null;
try { // for error handling
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LITERAL___attribute:
{
AST __t2627 = _t;
a = _t==ASTNULL ? null :(TNode)_t;
match(_t,LITERAL___attribute);
_t = _t.getFirstChild();
if ( inputState.guessing==0 ) {
print( a );
}
{
_loop2629:
do {
if (_t==null) _t=ASTNULL;
if (((_t.getType() >= LITERAL_typedef && _t.getType() <= LITERAL___imag))) {
b = (TNode)_t;
if ( _t==null ) throw new MismatchedTokenException();
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
print( b );
}
}
else {
break _loop2629;
}
} while (true);
}
_t = __t2627;
_t = _t.getNextSibling();
break;
}
case NAsmAttribute:
{
AST __t2630 = _t;
n = _t==ASTNULL ? null :(TNode)_t;
match(_t,NAsmAttribute);
_t = _t.getFirstChild();
if ( inputState.guessing==0 ) {
print( n );
}
lp = (TNode)_t;
match(_t,LPAREN);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
print( lp );
}
expr(_t);
_t = _retTree;
if ( inputState.guessing==0 ) {
print( ")" );
}
rp = (TNode)_t;
match(_t,RPAREN);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
print( rp );
}
_t = __t2630;
_t = _t.getNextSibling();
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 unionSpecifier(AST _t) throws RecognitionException {
TNode unionSpecifier_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
TNode a = null;
try { // for error handling
AST __t2594 = _t;
a = _t==ASTNULL ? null :(TNode)_t;
match(_t,LITERAL_union);
_t = _t.getFirstChild();
if ( inputState.guessing==0 ) {
print( a );
}
structOrUnionBody(_t);
_t = _retTree;
_t = __t2594;
_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 enumSpecifier(AST _t) throws RecognitionException {
TNode enumSpecifier_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
TNode a = null;
TNode i = null;
TNode lc = null;
TNode rc = null;
try { // for error handling
AST __t2618 = _t;
a = _t==ASTNULL ? null :(TNode)_t;
match(_t,LITERAL_enum);
_t = _t.getFirstChild();
if ( inputState.guessing==0 ) {
print( a );
}
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case ID:
{
i = (TNode)_t;
match(_t,ID);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
print( i );
}
break;
}
case 3:
case LCURLY:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LCURLY:
{
lc = (TNode)_t;
match(_t,LCURLY);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
print( lc ); tabs++;
}
enumList(_t);
_t = _retTree;
rc = (TNode)_t;
match(_t,RCURLY);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
tabs--; print( rc );
}
break;
}
case 3:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
_t = __t2618;
_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;
TNode i = null;
try { // for error handling
AST __t2590 = _t;
TNode tmp4_AST_in = (TNode)_t;
match(_t,NTypedefName);
_t = _t.getFirstChild();
i = (TNode)_t;
match(_t,ID);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
print( i );
}
_t = __t2590;
_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;
TNode i1 = null;
TNode lc1 = null;
TNode rc1 = null;
TNode lc2 = null;
TNode rc2 = null;
TNode i2 = null;
try { // for error handling
{
boolean synPredMatched2598 = false;
if (((_t.getType()==ID))) {
AST __t2598 = _t;
synPredMatched2598 = true;
inputState.guessing++;
try {
{
TNode tmp5_AST_in = (TNode)_t;
match(_t,ID);
_t = _t.getNextSibling();
TNode tmp6_AST_in = (TNode)_t;
match(_t,LCURLY);
_t = _t.getNextSibling();
}
}
catch (RecognitionException pe) {
synPredMatched2598 = false;
}
_t = __t2598;
inputState.guessing--;
}
if ( synPredMatched2598 ) {
i1 = (TNode)_t;
match(_t,ID);
_t = _t.getNextSibling();
lc1 = (TNode)_t;
match(_t,LCURLY);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
print( i1 ); print ( "{" ); tabs++;
}
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LITERAL_volatile:
case LITERAL_struct:
case LITERAL_union:
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?