📄 nesctreeparser.java
字号:
AST __t3463 = _t;
TNode tmp4_AST = null;
TNode tmp4_AST_in = null;
tmp4_AST = (TNode)astFactory.create((TNode)_t);
tmp4_AST_in = (TNode)_t;
astFactory.addASTChild(currentAST, tmp4_AST);
ASTPair __currentAST3463 = currentAST.copy();
currentAST.root = currentAST.child;
currentAST.child = null;
match(_t,NIncludeFileName);
_t = _t.getFirstChild();
i = (TNode)_t;
TNode i_AST_in = null;
i_AST = (TNode)astFactory.create(i);
astFactory.addASTChild(currentAST, i_AST);
match(_t,ID);
_t = _t.getNextSibling();
currentAST = __currentAST3463;
_t = __t3463;
_t = _t.getNextSibling();
includeFileName_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
returnAST = includeFileName_AST;
_retTree = _t;
}
public final void declarationList(AST _t) throws RecognitionException {
TNode declarationList_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode declarationList_AST = null;
try { // for error handling
{
int _cnt3633=0;
_loop3633:
do {
if (_t==null) _t=ASTNULL;
if ((_t.getType()==LITERAL___label__)) {
localLabelDecl(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
}
else if ((_t.getType()==NDeclaration)) {
declaration(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
}
else {
if ( _cnt3633>=1 ) { break _loop3633; } else {throw new NoViableAltException(_t);}
}
_cnt3633++;
} while (true);
}
declarationList_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
returnAST = declarationList_AST;
_retTree = _t;
}
public final void module(AST _t) throws RecognitionException {
TNode module_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode module_AST = null;
TNode m = null;
TNode m_AST = null;
TNode i = null;
TNode i_AST = null;
try { // for error handling
AST __t3471 = _t;
m = _t==ASTNULL ? null :(TNode)_t;
TNode m_AST_in = null;
m_AST = (TNode)astFactory.create(m);
astFactory.addASTChild(currentAST, m_AST);
ASTPair __currentAST3471 = currentAST.copy();
currentAST.root = currentAST.child;
currentAST.child = null;
match(_t,NModule);
_t = _t.getFirstChild();
i = (TNode)_t;
TNode i_AST_in = null;
i_AST = (TNode)astFactory.create(i);
astFactory.addASTChild(currentAST, i_AST);
match(_t,ID);
_t = _t.getNextSibling();
interfaceDescription(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
moduleImplementation(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
currentAST = __currentAST3471;
_t = __t3471;
_t = _t.getNextSibling();
module_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
returnAST = module_AST;
_retTree = _t;
}
public final void interfaceDescription(AST _t) throws RecognitionException {
TNode interfaceDescription_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode interfaceDescription_AST = null;
TNode lc = null;
TNode lc_AST = null;
TNode rc = null;
TNode rc_AST = null;
try { // for error handling
AST __t3473 = _t;
lc = _t==ASTNULL ? null :(TNode)_t;
TNode lc_AST_in = null;
lc_AST = (TNode)astFactory.create(lc);
astFactory.addASTChild(currentAST, lc_AST);
ASTPair __currentAST3473 = currentAST.copy();
currentAST.root = currentAST.child;
currentAST.child = null;
match(_t,NInterfaceDescription);
_t = _t.getFirstChild();
{
_loop3475:
do {
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NUses:
{
uses(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
break;
}
case NProvides:
{
provides(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
break;
}
default:
{
break _loop3475;
}
}
} while (true);
}
rc = (TNode)_t;
TNode rc_AST_in = null;
rc_AST = (TNode)astFactory.create(rc);
astFactory.addASTChild(currentAST, rc_AST);
match(_t,RCURLY);
_t = _t.getNextSibling();
currentAST = __currentAST3473;
_t = __t3473;
_t = _t.getNextSibling();
interfaceDescription_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
returnAST = interfaceDescription_AST;
_retTree = _t;
}
public final void moduleImplementation(AST _t) throws RecognitionException {
TNode moduleImplementation_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode moduleImplementation_AST = null;
TNode i = null;
TNode i_AST = null;
TNode lc = null;
TNode lc_AST = null;
TNode rc = null;
TNode rc_AST = null;
try { // for error handling
AST __t3491 = _t;
i = _t==ASTNULL ? null :(TNode)_t;
TNode i_AST_in = null;
i_AST = (TNode)astFactory.create(i);
astFactory.addASTChild(currentAST, i_AST);
ASTPair __currentAST3491 = currentAST.copy();
currentAST.root = currentAST.child;
currentAST.child = null;
match(_t,NImplementation);
_t = _t.getFirstChild();
lc = (TNode)_t;
TNode lc_AST_in = null;
lc_AST = (TNode)astFactory.create(lc);
astFactory.addASTChild(currentAST, lc_AST);
match(_t,LCURLY);
_t = _t.getNextSibling();
externalList(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
rc = (TNode)_t;
TNode rc_AST_in = null;
rc_AST = (TNode)astFactory.create(rc);
astFactory.addASTChild(currentAST, rc_AST);
match(_t,RCURLY);
_t = _t.getNextSibling();
currentAST = __currentAST3491;
_t = __t3491;
_t = _t.getNextSibling();
moduleImplementation_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
returnAST = moduleImplementation_AST;
_retTree = _t;
}
public final void uses(AST _t) throws RecognitionException {
TNode uses_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode uses_AST = null;
TNode u = null;
TNode u_AST = null;
try { // for error handling
AST __t3477 = _t;
u = _t==ASTNULL ? null :(TNode)_t;
TNode u_AST_in = null;
u_AST = (TNode)astFactory.create(u);
astFactory.addASTChild(currentAST, u_AST);
ASTPair __currentAST3477 = currentAST.copy();
currentAST.root = currentAST.child;
currentAST.child = null;
match(_t,NUses);
_t = _t.getFirstChild();
interfaceDescriptionItemList(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
currentAST = __currentAST3477;
_t = __t3477;
_t = _t.getNextSibling();
uses_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
returnAST = uses_AST;
_retTree = _t;
}
public final void provides(AST _t) throws RecognitionException {
TNode provides_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode provides_AST = null;
TNode p = null;
TNode p_AST = null;
try { // for error handling
AST __t3479 = _t;
p = _t==ASTNULL ? null :(TNode)_t;
TNode p_AST_in = null;
p_AST = (TNode)astFactory.create(p);
astFactory.addASTChild(currentAST, p_AST);
ASTPair __currentAST3479 = currentAST.copy();
currentAST.root = currentAST.child;
currentAST.child = null;
match(_t,NProvides);
_t = _t.getFirstChild();
interfaceDescriptionItemList(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
currentAST = __currentAST3479;
_t = __t3479;
_t = _t.getNextSibling();
provides_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
if (_t!=null) {_t = _t.getNextSibling();}
} else {
throw ex;
}
}
returnAST = provides_AST;
_retTree = _t;
}
public final void interfaceDescriptionItemList(AST _t) throws RecognitionException {
TNode interfaceDescriptionItemList_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode interfaceDescriptionItemList_AST = null;
TNode lc = null;
TNode lc_AST = null;
TNode rc = null;
TNode rc_AST = null;
try { // for error handling
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NDeclaration:
case LITERAL_interface:
{
interfaceDescriptionItem(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
interfaceDescriptionItemList_AST = (TNode)currentAST.root;
break;
}
case LCURLY:
{
{
lc = (TNode)_t;
TNode lc_AST_in = null;
lc_AST = (TNode)astFactory.create(lc);
astFactory.addASTChild(currentAST, lc_AST);
match(_t,LCURLY);
_t = _t.getNextSibling();
{
int _cnt3483=0;
_loop3483:
do {
if (_t==null) _t=ASTNULL;
if ((_t.getType()==NDeclaration||_t.getType()==LITERAL_interface)) {
interfaceDescriptionItem(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
}
else {
if ( _cnt3483>=1 ) { break _loop3483; } else {throw new NoViableAltException(_t);}
}
_cnt3483++;
} while (true);
}
rc = (TNode)_t;
TNode rc_AST_in = null;
rc_AST = (TNode)astFactory.create(rc);
astFactory.addASTChild(currentAST, rc_AST);
match(_t,RCURLY);
_t = _t.getNextSibling();
}
interfaceDescriptionItemList_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 = interfaceDescriptionItemList_AST;
_retTree = _t;
}
public final void interfaceDescriptionItem(AST _t) throws RecognitionException {
TNode interfaceDescriptionItem_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode interfaceDescriptionItem_AST = null;
TNode i = null;
TNode i_AST = null;
try { // for error handling
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NDeclaration:
{
declaration(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
interfaceDescriptionItem_AST = (TNode)currentAST.root;
break;
}
case LITERAL_interface:
{
i = (TNode)_t;
TNode i_AST_in = null;
i_AST = (TNode)astFactory.create(i);
astFactory.addASTChild(currentAST, i_AST);
match(_t,LITERAL_interface);
_t = _t.getNextSibling();
interfaceIdentifier(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case LBRACKET:
{
interfaceParameters(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
break;
}
case 3:
case RCURLY:
case NDeclaration:
case LITERAL_interface:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
interfaceDescriptionItem_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 = interfaceDescriptionItem_AST;
_retTree = _t;
}
public final void declaration(AST _t) throws RecognitionException {
TNode declaration_AST_in = (_t == ASTNULL) ? null : (TNode)_t;
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode declaration_AST = null;
try { // for error handling
AST __t3505 = _t;
TNode tmp5_AST = null;
TNode tmp5_AST_in = null;
tmp5_AST = (TNode)astFactory.create((TNode)_t);
tmp5_AST_in = (TNode)_t;
astFactory.addASTChild(currentAST, tmp5_AST);
ASTPair __currentAST3505 = currentAST.copy();
currentAST.root = currentAST.child;
currentAST.child = null;
match(_t,NDeclaration);
_t = _t.getFirstChild();
declSpecifiers(_t);
_t = _retTree;
astFactory.addASTChild(currentAST, returnAST);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -