Lexical error at line 0, column 0
NickName:ShaggyInjun Ask DateTime:2013-05-26T08:46:39

Lexical error at line 0, column 0

In the grammar below, I am trying configure any line that starts with ' as a single line comment and anything betweeen /' Multiline Comment '/. The single line comment works ok. But for some reason as soon as I press / or ' or ';' or < or '>' I get the error below. I don't have above characters configured. Shouldn't they be considered default and skip parsing ?

Error

Lexical error at line 0, column 0.  Encountered: "\"" (34), after : ""
Lexical error at line 0, column 0.  Encountered: ">" (62), after : ""
Lexical error at line 0, column 0.  Encountered: "\n" (10), after : "-"

I have only included part of the code below for conciseness. For full Lexer definition please visit the link

TOKEN :
{
  < WHITESPACE:
  " "
| "\t"
| "\n"
| "\r"
| "\f">
}

/* COMMENTS */

MORE :
{
  <"/'"> { input_stream.backup(1); } : IN_MULTI_LINE_COMMENT
}

<IN_MULTI_LINE_COMMENT>
TOKEN :
{
  <MULTI_LINE_COMMENT: "'/" > : DEFAULT
}

<IN_MULTI_LINE_COMMENT>
MORE :
{
  < ~[] >
}

TOKEN :
{
  <SINGLE_LINE_COMMENT: "'" (~["\n", "\r"])* ("\n" | "\r" | "\r\n")?>
}

Copyright Notice:Content Author:「ShaggyInjun」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/16755230/lexical-error-at-line-0-column-0

More about “Lexical error at line 0, column 0” related questions

Lexical error at line 0, column 0

In the grammar below, I am trying configure any line that starts with ' as a single line comment and anything betweeen /' Multiline Comment '/. The single line comment works ok. But for some reason...

Show Detail

Lexical error: Encountered: "" (0), after : ""

I needed to start dealing with foreign characters, and in doing so, I think I royally screwed up a file's encoding. The error I'm getting is: Lexical error at line 1, column 8. Encountered: "" (...

Show Detail

Lexical error running PHP sample project

I'm new to netbeans and trying to run PHP todolist sample project. One of the first things to do is to run mysql.sql file to create table named todo. Here is a query : CREATE TABLE todo ( `id` INT

Show Detail

Lexical error running sql in netbeans 8.02

I new to java DB programming.I am trying out create tables in GlassFish Server 4.1 using sql statements but whenever I run the sql using the run sql tool, it gives me the following errors Error co...

Show Detail

Lexical error vs syntax error in C

Consider line number 3 of the following C-program. int main() { /*Line 1 */ int I, N; /*Line 2 */ fro (I=0, I&lt;N, I++); /*Line 3 */ } Identify the compiler’s response

Show Detail

lexical error in python

I am trying to use create a recorder object with the python API of PJSUA. I must admit I am stumped. I took the call.py in the example python tutorials: http://trac.pjsip.org/repos/browser/pjproject/

Show Detail

How to fix velocity ParseErrorException lexical error

Hi i am totally new to apache velocity and i am having velocity.exception.ParseErrorException: Lexical error issue in my code, Can anybody help me in how to solve it? Here is the code #set ($file_n...

Show Detail

Getting an error at line 0, column 0: bad conversion

I don't know why I am getting this error : terminate called after throwing an instance of 'YAML::TypedBadConversion&lt;double&gt;' what(): yaml-cpp: error at line 0, column 0: bad conversion Abor...

Show Detail

JMeter (Beanshell sampler) Token Parsing Error: Lexical error at line 2, column 15. Encountered: "?"

I'm passing XML from a variable into a string: def request = '${variable}' When I run my beanshell script, the response shows the following (note; line 1 is a comment): Token Parsing Error: Lexi...

Show Detail

CSS3 Parse Error Lexical error

I keep getting this error and am not sure why it pops up when I validate it. Can anyone explain this to me and how to fix it? The error is this: 246 #copyright Parse Error Lexical error at line ...

Show Detail