You are not logged in.

jbExplorer

Trainee

  • "jbExplorer" started this thread

Posts: 111

Date of registration: Mar 18th 2013

  • Send private message

1

Tuesday, September 10th 2013, 11:39pm

Class not found error

I'm getting a confusing error, when running an Antlr 4 project.

When compiling this code

ptTree = psParser.init()



Jabaco stops at the closing parentheses, and complains "Class not found!"

But the init method, as well as the psParser object, all exist. The init method shows up, in the Jabaco Intellisense picklist, after you type "psParser."


Here's the source of the Test Button Click method:



Import org#antlr#v4#runtime.*
Import org#antlr#v4#runtime#tree.*
Import java#io#InputStream
Import java#io#FileInputStream


Public Sub btnTest1_Click()
Dim aisInput As ANTLRInputStream
Dim lxLexer As ArrayInitLexer
Dim ctsTokens As CommonTokenStream
Dim psParser As ArrayInitParser

Dim ptTree As ParseTree
Dim isInput As java#io#InputStream
Dim inInput As java#io#FileInputStream
Dim sInputFile As String


sInputFile = "Test01.exp"
'// isInput = System.in
inInput = New FileInputStream( sInputFile )

Stop
' // create a CharStream that reads from standard input
aisInput = New ANTLRInputStream(isInput)

' // create a lexer that feeds Off of input CharStream
lxLexer = New ArrayInitLexer( aisInput )

' // create a buffer of tokens pulled from the lexer
ctsTokens = New CommonTokenStream( lxLexer )

' // create a parser that feeds Off the tokens buffer
psParser = New ArrayInitParser(ctsTokens)

'// The error occurs here:
ptTree = psParser.init()


...
...
...


End Sub

jbExplorer

Trainee

  • "jbExplorer" started this thread

Posts: 111

Date of registration: Mar 18th 2013

  • Send private message

2

Wednesday, September 11th 2013, 7:44pm

RE: Class not found error

Post removed by author, because of a misinterpretation of root cause.

This post has been edited 2 times, last edit by "jbExplorer" (Sep 16th 2013, 1:43pm)


jbExplorer

Trainee

  • "jbExplorer" started this thread

Posts: 111

Date of registration: Mar 18th 2013

  • Send private message

3

Wednesday, September 11th 2013, 8:07pm

This is the init code, which compiles and executes fine, in Intellij:


public final InitContext init() throws RecognitionException {
InitContext _localctx = new InitContext(_ctx, getState());
enterRule(_localctx, 0, RULE_init);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(4); match(1);
setState(5); value();
setState(10);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==2) {
{
{
setState(6); match(2);
setState(7); value();
}
}
setState(12);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(13); match(3);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}


I just noticed that several other methods, which were declared public final, also present Jabaco with a problem.

This post has been edited 1 times, last edit by "jbExplorer" (Sep 11th 2013, 9:12pm)


jbExplorer

Trainee

  • "jbExplorer" started this thread

Posts: 111

Date of registration: Mar 18th 2013

  • Send private message

4

Wednesday, September 11th 2013, 9:07pm

Post removed by author, because of a misinterpretation of root cause.

This post has been edited 1 times, last edit by "jbExplorer" (Sep 16th 2013, 1:43pm)


Rate this thread
WoltLab Burning Board