nescparser.java
来自「plugin for eclipse」· Java 代码 · 共 2,369 行 · 第 1/5 页
JAVA
2,369 行
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
recover(ex,_tokenSet_9);
} else {
throw ex;
}
}
returnAST = declarationList_AST;
}
public final void configuration() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode configuration_AST = null;
Token c = null;
TNode c_AST = null;
try { // for error handling
TNode tmp7_AST = null;
tmp7_AST = (TNode)astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, tmp7_AST);
match(LITERAL_configuration);
c = LT(1);
c_AST = (TNode)astFactory.create(c);
astFactory.addASTChild(currentAST, c_AST);
match(ID);
interfaceDescription();
astFactory.addASTChild(currentAST, returnAST);
configurationImplementation();
astFactory.addASTChild(currentAST, returnAST);
if ( inputState.guessing==0 ) {
configuration_AST = (TNode)currentAST.root;
configuration_AST.setType(NConfiguration);
}
configuration_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
recover(ex,_tokenSet_1);
} else {
throw ex;
}
}
returnAST = configuration_AST;
}
public final void module() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode module_AST = null;
Token m = null;
TNode m_AST = null;
try { // for error handling
TNode tmp8_AST = null;
tmp8_AST = (TNode)astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, tmp8_AST);
match(LITERAL_module);
m = LT(1);
m_AST = (TNode)astFactory.create(m);
astFactory.addASTChild(currentAST, m_AST);
match(ID);
interfaceDescription();
astFactory.addASTChild(currentAST, returnAST);
moduleImplementation();
astFactory.addASTChild(currentAST, returnAST);
if ( inputState.guessing==0 ) {
module_AST = (TNode)currentAST.root;
module_AST.setType(NModule);
}
module_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
recover(ex,_tokenSet_1);
} else {
throw ex;
}
}
returnAST = module_AST;
}
public final void interfaceDescription() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode interfaceDescription_AST = null;
try { // for error handling
TNode tmp9_AST = null;
tmp9_AST = (TNode)astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, tmp9_AST);
match(LCURLY);
{
_loop2876:
do {
switch ( LA(1)) {
case LITERAL_uses:
{
uses();
astFactory.addASTChild(currentAST, returnAST);
break;
}
case LITERAL_provides:
{
provides();
astFactory.addASTChild(currentAST, returnAST);
break;
}
default:
{
break _loop2876;
}
}
} while (true);
}
TNode tmp10_AST = null;
tmp10_AST = (TNode)astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp10_AST);
match(RCURLY);
if ( inputState.guessing==0 ) {
interfaceDescription_AST = (TNode)currentAST.root;
interfaceDescription_AST.setType(NInterfaceDescription);
}
interfaceDescription_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
recover(ex,_tokenSet_10);
} else {
throw ex;
}
}
returnAST = interfaceDescription_AST;
}
public final void moduleImplementation() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode moduleImplementation_AST = null;
try { // for error handling
TNode tmp11_AST = null;
tmp11_AST = (TNode)astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, tmp11_AST);
match(LITERAL_implementation);
TNode tmp12_AST = null;
tmp12_AST = (TNode)astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp12_AST);
match(LCURLY);
externalList();
astFactory.addASTChild(currentAST, returnAST);
TNode tmp13_AST = null;
tmp13_AST = (TNode)astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp13_AST);
match(RCURLY);
if ( inputState.guessing==0 ) {
moduleImplementation_AST = (TNode)currentAST.root;
moduleImplementation_AST.setType(NImplementation);
}
moduleImplementation_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
recover(ex,_tokenSet_1);
} else {
throw ex;
}
}
returnAST = moduleImplementation_AST;
}
public final void configurationImplementation() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode configurationImplementation_AST = null;
try { // for error handling
TNode tmp14_AST = null;
tmp14_AST = (TNode)astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, tmp14_AST);
match(LITERAL_implementation);
TNode tmp15_AST = null;
tmp15_AST = (TNode)astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp15_AST);
match(LCURLY);
{
_loop2892:
do {
if ((LA(1)==LITERAL_components)) {
componentList();
astFactory.addASTChild(currentAST, returnAST);
}
else {
break _loop2892;
}
} while (true);
}
connectionList();
astFactory.addASTChild(currentAST, returnAST);
TNode tmp16_AST = null;
tmp16_AST = (TNode)astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp16_AST);
match(RCURLY);
if ( inputState.guessing==0 ) {
configurationImplementation_AST = (TNode)currentAST.root;
configurationImplementation_AST.setType(NImplementation);
}
configurationImplementation_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
recover(ex,_tokenSet_1);
} else {
throw ex;
}
}
returnAST = configurationImplementation_AST;
}
public final void uses() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode uses_AST = null;
try { // for error handling
TNode tmp17_AST = null;
tmp17_AST = (TNode)astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, tmp17_AST);
match(LITERAL_uses);
interfaceDescriptionItemList();
astFactory.addASTChild(currentAST, returnAST);
if ( inputState.guessing==0 ) {
uses_AST = (TNode)currentAST.root;
uses_AST.setType(NUses);
}
uses_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
recover(ex,_tokenSet_11);
} else {
throw ex;
}
}
returnAST = uses_AST;
}
public final void provides() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode provides_AST = null;
try { // for error handling
TNode tmp18_AST = null;
tmp18_AST = (TNode)astFactory.create(LT(1));
astFactory.makeASTRoot(currentAST, tmp18_AST);
match(LITERAL_provides);
interfaceDescriptionItemList();
astFactory.addASTChild(currentAST, returnAST);
if ( inputState.guessing==0 ) {
provides_AST = (TNode)currentAST.root;
provides_AST.setType(NProvides);
}
provides_AST = (TNode)currentAST.root;
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
recover(ex,_tokenSet_11);
} else {
throw ex;
}
}
returnAST = provides_AST;
}
public final void interfaceDescriptionItemList() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode interfaceDescriptionItemList_AST = null;
try { // for error handling
switch ( LA(1)) {
case LITERAL_typedef:
case LITERAL_volatile:
case LITERAL_struct:
case LITERAL_union:
case LITERAL_enum:
case LITERAL_auto:
case LITERAL_register:
case LITERAL_extern:
case LITERAL_static:
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 ID:
case LITERAL_default:
case LITERAL_inline:
case LITERAL_typeof:
case LITERAL___complex:
case LITERAL_interface:
case LITERAL_norace:
case LITERAL_async:
case LITERAL_command:
case LITERAL_event:
case LITERAL_task:
{
interfaceDescriptionItem();
astFactory.addASTChild(currentAST, returnAST);
interfaceDescriptionItemList_AST = (TNode)currentAST.root;
break;
}
case LCURLY:
{
TNode tmp19_AST = null;
tmp19_AST = (TNode)astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp19_AST);
match(LCURLY);
{
int _cnt2881=0;
_loop2881:
do {
if ((_tokenSet_12.member(LA(1)))) {
interfaceDescriptionItem();
astFactory.addASTChild(currentAST, returnAST);
}
else {
if ( _cnt2881>=1 ) { break _loop2881; } else {throw new NoViableAltException(LT(1), getFilename());}
}
_cnt2881++;
} while (true);
}
TNode tmp20_AST = null;
tmp20_AST = (TNode)astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp20_AST);
match(RCURLY);
interfaceDescriptionItemList_AST = (TNode)currentAST.root;
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
reportError(ex);
recover(ex,_tokenSet_11);
} else {
throw ex;
}
}
returnAST = interfaceDescriptionItemList_AST;
}
public final void interfaceDescriptionItem() throws RecognitionException, TokenStreamException {
returnAST = null;
ASTPair currentAST = new ASTPair();
TNode interfaceDescriptionItem_AST = null;
try { // for error handling
switch ( LA(1)) {
case LITERAL_typedef:
case LITERAL_volatile:
case LITERAL_struct:
case LITERAL_union:
case LITERAL_enum:
case LITERAL_auto:
case LITERAL_register:
case LITERAL_extern:
case LITERAL_static:
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 ID:
case LITERAL_default:
case LITERAL_inline:
case LITERAL_typeof:
case LITERAL___complex:
case LITERAL_norace:
case LITERAL_async:
case LITERAL_command:
case LITERAL_event:
case LITERAL_task:
{
declaration();
astFactory.addASTChild(currentAST, returnAST);
interfaceDescriptionItem_AST = (TNode)currentAST.root;
break;
}
case LITERAL_interface:
{
TNode tmp21_AST = null;
tmp21_AST = (TNode)astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp21_AST);
match(LITERAL_interface);
interfaceIdentifier();
astFactory.addASTChild(currentAST, returnAST);
{
switch ( LA(1)) {
case LBRACKET:
{
interfaceParameters();
astFactory.addASTChild(currentAST, returnAST);
break;
}
case SEMI:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
{
int _cnt2885=0;
_loop2885:
do {
if ((LA(1)==SEMI)) {
match(SEMI);
}
else {
if ( _cnt2885>=1 ) { break _loop2885; } else {throw new NoViableAltException(LT(1), getFilename());}
}
_cnt2885++;
} while (true);
}
interfaceDescriptionItem_AST = (TNode)currentAST.root;
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
catch (RecognitionException ex) {
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?