nescobjecttreebuilder.java
来自「plugin for eclipse」· Java 代码 · 共 2,529 行 · 第 1/5 页
JAVA
2,529 行
match(_t,LITERAL_const);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
tqObj.setDefNode(a);
}
break;
}
case LITERAL_volatile:
{
b = (TNode)_t;
match(_t,LITERAL_volatile);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
tqObj.setDefNode(b);
}
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;
return tqObj;
}
public final TypeSpecifier typeSpecifier(AST _t) throws RecognitionException {
TypeSpecifier tsObj;
TNode typeSpecifier_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
TNode a = null;
TNode b = null;
TNode c = null;
TNode d = null;
TNode e = null;
TNode f = null;
TNode g = null;
TNode h = null;
TNode i = null;
TNode j = null;
tsObj = new TypeSpecifier(ctx);
Attribute attrObj = null;
try { // for error handling
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LITERAL_void:
{
a = (TNode)_t;
match(_t,LITERAL_void);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
tsObj.setDefNode(a);
tsObj.setSpecifierNameNode(a);
}
break;
}
case LITERAL_char:
{
b = (TNode)_t;
match(_t,LITERAL_char);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
tsObj.setDefNode(b);
tsObj.setSpecifierNameNode(b);
}
break;
}
case LITERAL_short:
{
c = (TNode)_t;
match(_t,LITERAL_short);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
tsObj.setDefNode(c);
tsObj.setSpecifierNameNode(c);
}
break;
}
case LITERAL_int:
{
d = (TNode)_t;
match(_t,LITERAL_int);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
tsObj.setDefNode(d);
tsObj.setSpecifierNameNode(d);
}
break;
}
case LITERAL_long:
{
e = (TNode)_t;
match(_t,LITERAL_long);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
tsObj.setDefNode(e);
tsObj.setSpecifierNameNode(e);
}
break;
}
case LITERAL_float:
{
f = (TNode)_t;
match(_t,LITERAL_float);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
tsObj.setDefNode(f);
tsObj.setSpecifierNameNode(f);
}
break;
}
case LITERAL_double:
{
g = (TNode)_t;
match(_t,LITERAL_double);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
tsObj.setDefNode(g);
tsObj.setSpecifierNameNode(g);
}
break;
}
case LITERAL_signed:
{
h = (TNode)_t;
match(_t,LITERAL_signed);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
tsObj.setDefNode(h);
tsObj.setSpecifierNameNode(h);
}
break;
}
case LITERAL_unsigned:
{
i = (TNode)_t;
match(_t,LITERAL_unsigned);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
tsObj.setDefNode(i);
tsObj.setSpecifierNameNode(i);
}
break;
}
case LITERAL___complex:
{
j = (TNode)_t;
match(_t,LITERAL___complex);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
tsObj.setDefNode(j);
tsObj.setSpecifierNameNode(j);
}
break;
}
case LITERAL_struct:
case LITERAL_union:
{
tsObj=structOrUnionSpecifier(_t);
_t = _retTree;
{
_loop771:
do {
if (_t==null) _t=ASTNULL;
if ((_t.getType()==NAsmAttribute||_t.getType()==LITERAL___attribute)) {
attrObj=attributeDecl(_t);
_t = _retTree;
if ( inputState.guessing==0 ) {
((StructOrUnionSpecifier)tsObj).addAttribute(attrObj);
}
}
else {
break _loop771;
}
} while (true);
}
break;
}
case LITERAL_enum:
{
tsObj=enumSpecifier(_t);
_t = _retTree;
break;
}
case NTypedefName:
{
tsObj=typedefName(_t);
_t = _retTree;
break;
}
case LITERAL_typeof:
{
AST __t772 = _t;
TNode tmp2_AST_in = (TNode)_t;
match(_t,LITERAL_typeof);
_t = _t.getFirstChild();
TNode tmp3_AST_in = (TNode)_t;
match(_t,LPAREN);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
// FIXME: implement this
}
{
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);
}
}
}
TNode tmp4_AST_in = (TNode)_t;
match(_t,RPAREN);
_t = _t.getNextSibling();
_t = __t772;
_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;
return tsObj;
}
public final Declarator interfaceMemberFunctionDeclarator(AST _t) throws RecognitionException {
Declarator declObj;
TNode interfaceMemberFunctionDeclarator_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
TNode d = null;
TNode id1 = null;
TNode n = null;
TNode r = null;
declObj = null;
PointerGroup pgObj = null;
Declarator childDeclObj = null;
ParameterTypeList ptlObj = null;
ArrayConstructor acObj = null;
try { // for error handling
AST __t858 = _t;
d = _t==ASTNULL ? null :(TNode)_t;
match(_t,NDeclarator);
_t = _t.getFirstChild();
if ( inputState.guessing==0 ) {
declObj = new Declarator();
declObj.setDefNode(d);
}
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NPointerGroup:
{
pgObj=pointerGroup(_t);
_t = _retTree;
if ( inputState.guessing==0 ) {
declObj.setPointerGroup(pgObj);
}
break;
}
case ID:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
id1 = (TNode)_t;
match(_t,ID);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
declObj.setNameNode(id1);
}
AST __t860 = _t;
n = _t==ASTNULL ? null :(TNode)_t;
match(_t,NParameterTypeList);
_t = _t.getFirstChild();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NParameterDeclaration:
{
ptlObj=parameterTypeList(_t);
_t = _retTree;
if ( inputState.guessing==0 ) {
declObj.addParameterTypeList(ptlObj);
}
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);
}
}
}
if ( inputState.guessing==0 ) {
// add an empty one so we can figure out it's a function decl
declObj.addParameterTypeList(new ParameterTypeList());
}
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
r = (TNode)_t;
match(_t,RPAREN);
_t = _t.getNextSibling();
_t = __t860;
_t = _t.getNextSibling();
_t = __t858;
_t = _t.getNextSibling();
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
_retTree = _t;
return declObj;
}
public final Configuration configuration(AST _t,
NesCConfigurationFile configFileObj
) throws RecognitionException {
Configuration configObj;
TNode configuration_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
TNode m = null;
TNode i = null;
configObj = null;
List portList = null;
try { // for error handling
AST __t688 = _t;
m = _t==ASTNULL ? null :(TNode)_t;
match(_t,NConfiguration);
_t = _t.getFirstChild();
if ( inputState.guessing==0 ) {
configObj = new Configuration();
configObj.setDefNode(m);
configFileObj.setConfiguration(configObj);
}
i = (TNode)_t;
match(_t,ID);
_t = _t.getNextSibling();
if ( inputState.guessing==0 ) {
configObj.setNameNode(i);
}
portList=interfaceDescription(_t);
_t = _retTree;
if ( inputState.guessing==0 ) {
configObj.addPortList(portList);
}
configurationImplementation(_t,configObj);
_t = _retTree;
_t = __t688;
_t = _t.getNextSibling();
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?