Problem with Language API JFlex adapter

I'm trying to create language based on JFlex parser using IDEA skeleton,
and using Javascript Flex file as reference. However, the generated
file has 2 errors, both dealing with trying to call zzBufferL[..], when
zzBufferL is a CharSequence.

What's wrong? I changed it to zzBufferL.charAt() for now, but why did
this happen? Did I do something wrong?

Thanks,
-Keith

4 comments
Comment actions Permalink

Keith Lea wrote:

I'm trying to create language based on JFlex parser using IDEA skeleton,
and using Javascript Flex file as reference. However, the generated
file has 2 errors, both dealing with trying to call zzBufferL[..], when
zzBufferL is a CharSequence.

What's wrong? I changed it to zzBufferL.charAt() for now, but why did
this happen? Did I do something wrong?


There's nothing wrong, it's just that the type of zzBufferL cannot be changed by the
skeleton file. The IDEA skeleton wants to use a CharSequence instead of a char[] for
lexing, so this has either to be manually fixed like you did, or you can use the JFlex
that comes with the idea-dev package: It has a command line option "-charat" that uses
zzBufferL.charAt() automatically.

Sascha

0
Comment actions Permalink

Are you sure that this issue don't fixed in IDEA development package shipped JFlex tool version?

0
Comment actions Permalink

I feel sure because I used that to generate the problematic lexer class.

0
Comment actions Permalink

Dmitry Kashin wrote:

Are you sure that this issue don't fixed in IDEA development package shipped JFlex tool version?


As I said, it is fixed by a newly introduced command line option. JFlex' default behavior
is unchanged.

Sascha

0

Please sign in to leave a comment.