java - Null TokenId error while processing an input text -
i working on netbeans module parse html
markups following tutorial.
for keyword html
, wrote following javacc file.
options { java_unicode_escape = true; error_reporting = false; static = false; common_token_action = false; token_factory = "token"; jdk_version = "1.8"; build_parser = false; } parser_begin(htmlparser) package org.html.jcclexer; import java.io.*; /** * grammar parse java version 1.5 * @author sreenivasa viswanadha - simplified , enhanced 1.5 */ public class htmlparser {} parser_end(htmlparser) /* white space */ token : { < whitespace: " " | "\t" | "\n" | "\r" | "\f"> } token : { < html : "html" > }
it colors html
word gives error:
java.lang.illegalargumentexception: token id must not null. fix lexer org.html.lexer.htmlexer@1e6bbd25
test.html contains following word only:
html
i not sure it's error due .jj
file or else.
Comments
Post a Comment