diff --git a/.gitignore b/.gitignore index 701cba0..f820e73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,35 @@ -**/vs2017/ +# Structure classes/ target/ -# Eclipse file +bin/ + +# Maven +**/interpolated-*.* + +# IDEs & plugins .classpath .project .settings/ -bin/ +.idea +.gradle +.groovy +.checkstyle +*.iml -local-repo/ +# it local repositories +it/local-repo/ -# Compiled class file +# Compiled classes *.class -# Log file -*.log - -# BlueJ files -*.ctxt +# Logs +**/*.log -# Mobile Tools for Java (J2ME) -.mtj.tmp/ +# Results +**/*.out +**/*.err -# Package Files # +# Packaging *.jar *.war *.nar @@ -30,9 +38,10 @@ local-repo/ *.tar.gz *.rar -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +# jvm crash logs hs_err_pid* +# MS objects *.suo *.exe *.ilk diff --git a/bugs/bug001/pom.xml b/bugs/bug001/pom.xml index 8419770..1c91014 100644 --- a/bugs/bug001/pom.xml +++ b/bugs/bug001/pom.xml @@ -48,7 +48,35 @@ THE POSSIBILITY OF SUCH DAMAGE. + + org.apache.maven.plugins + maven-clean-plugin + + + clear-res + test + + clean + + + true + + + test + + *.out, *.err + + + + + + + + + + + + + org.codehaus.mojo + exec-maven-plugin + + + exec-1 + test + + exec + + + ${project.basedir}/target/nar/${project.artifactId}-${project.version}-${nar.aol}-executable/bin/${nar.aol}/${project.artifactId}.exe + + ${project.basedir}/test/clc1.in + ${project.basedir}/test/clc1.out + ${project.basedir}/test/clc1.err + + + + + exec-2 + test + + exec + + + ${project.basedir}/target/nar/${project.artifactId}-${project.version}-${nar.aol}-executable/bin/${nar.aol}/${project.artifactId}.exe + + ${project.basedir}/test/clc2.in + ${project.basedir}/test/clc2.out + ${project.basedir}/test/clc2.err + + + + + org.apache.maven.plugins maven-antrun-plugin - compare-out + check-res-1 + test + + run + + + false + + + + + + + + + + + + + + + + + + + + + + + + check-res-2 test run - true + false - - + + - - - - + + + + + + + + + + + + + - + diff --git a/bugs/bug001/src/main/cpp/Main.cpp b/bugs/bug001/src/main/cpp/Main.cpp index 8871664..5473047 100644 --- a/bugs/bug001/src/main/cpp/Main.cpp +++ b/bugs/bug001/src/main/cpp/Main.cpp @@ -10,10 +10,10 @@ #if !defined(JJ8) && !defined(JJ7) #define JJ8 #endif -#if defined(JJ8) +#if defined(JJ8) #include "DefaultCharStream.h" #define CHARSTREAM DefaultCharStream -#elif defined(JJ7) +#elif defined(JJ7) #include "CharStream.h" #define CHARSTREAM CharStream #endif @@ -21,125 +21,88 @@ using namespace std; -JJString ReadFileFully() { - JJString code; - code = -#if 1 -//"-- 32-bit.\n" -//"-- 32- -bit.\n" -//"-- 32- -bit-\n" -//"-- ddd -- Mod\n" -//"-- no-de --\n" -" M DEFINITIONS ::=\n" -"BEGIN\n" -"IMPORTS -- n-o --;\n" -"END\n" -; -#endif - - return code; -} -static void usage(int argc, char**argv) { - cerr << "ComplexLineComment" << " [ in [ out [ err ] ] ]" << endl; -} -int main(int argc, char**argv) { - istream* input = &cin; - ostream* output = &cout; - ostream* error = &cerr; - ifstream ifs; - ofstream ofs; - ofstream efs; - StreamReader* sr = nullptr; - CharStream * cs = nullptr; - - try { - if (argc > 1) { - switch(argc) { - case 4: efs.open(argv[3]); - case 3: ofs.open(argv[2]); - case 2: ifs.open(argv[1], ifstream::binary); - } - if (ifs.is_open()) { - input = &ifs; - sr = new StreamReader(ifs); - cs = new CHARSTREAM(sr); - } - else { - cerr << "cannot open in file" << endl; - return 8; - } - if (ofs.is_open()) { - output = &ofs; - } - if (efs.is_open()) { - error = &efs; - } - } else - if (argc == 1) { - JJString s = ReadFileFully(); - *output << s << endl; - cs = new CHARSTREAM(s.c_str(), s.size() - 1, 1, 1); - } - else { - usage(argc, argv); - return 0; - } - ComplexLineCommentTokenManager *scanner = new ComplexLineCommentTokenManager(cs); - scanner->disable_tracing(); - ComplexLineComment parser(scanner); +#define MYPARSER ComplexLineComment +#define MYTM ComplexLineCommentTokenManager +#define MYENTRY Input - parser.Input(); - *output << "Parser Version 0.1: file parsed successfully." << endl; - } catch (const ParseException& e) { - clog << e.expectedTokenSequences << endl; - } - catch (...) { +int main(int argc, char **argv) { - } - if (ifs.is_open()) ifs.close(); - if (ofs.is_open()) ofs.close(); - if (efs.is_open()) efs.close(); - if (cs) delete cs; - if (sr) delete sr; + if (argc != 4) { + cerr << "Error: invalid number of arguments (" << (argc - 1) << ")" << endl; + cerr << "Usage: MYPARSER [ inputfile [ outputfile [ errorfile ] ] ]" << endl; + return 4; + } - return 0; -} -#if 0 -package clc; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.PrintStream; + // see https://stackoverflow.com/questions/10150468/how-to-redirect-cin-and-cout-to-files + ifstream ifs; + ofstream ofs; + ofstream efs; + streambuf *cinbuf; + streambuf *coutbuf; + streambuf *cerrbuf; -public class ComplexLineComment { + StreamReader *sr = nullptr; + CharStream *cs = nullptr; - public static void main(String args[]) throws FileNotFoundException { - InputStream input = System.in; - PrintStream output = System.out; - PrintStream error = System.err; - InputStream prevInput = null; - PrintStream prevOutput = null; - PrintStream prevError = null; - if (args.length == 3) { - prevInput = input; input = new FileInputStream(args[0]); - prevOutput = output; output = new PrintStream(args[1]); - prevError = error; error = new PrintStream(args[2]); - System.setIn(input); - System.setOut(output); - System.setErr(error); + try { + // open files and redirect standard streams to them + switch (argc) { + case 4: + efs.open(argv[3]); + case 3: + ofs.open(argv[2]); + case 2: + ifs.open(argv[1], ifstream::binary); + } + if (ifs.is_open()) { + sr = new StreamReader(ifs); + cs = new CHARSTREAM(sr); + cinbuf = cin.rdbuf(); + cin.rdbuf(ifs.rdbuf()); + } else { + cerr << "Cannot open input file" << endl; + return 8; + } + if (ofs.is_open()) { + coutbuf = cout.rdbuf(); + cout.rdbuf(ofs.rdbuf()); + } else { + cerr << "Cannot open output file" << endl; + return 8; } - try { - ComplexLineComment parser = new ComplexLineComment(System.in); - parser.Input(); - } catch (Exception e) { - error.println(e.getMessage()); - } finally { - if (prevInput != null) System.setIn(prevInput); - if (prevOutput != null) System.setOut(prevOutput); - if (prevError != null) System.setErr(prevError); + if (efs.is_open()) { + cerrbuf = cerr.rdbuf(); + cerr.rdbuf(efs.rdbuf()); } + + // parse + MYPARSER parser(new MYTM(cs)); +// MYTM *scanner = new MYTM(cs); +// scanner->disable_tracing(); +// MYPARSER parser(scanner); + parser.MYENTRY(); + cerr << "Input file parsed successfully" << endl; + } catch (const ParseException &e) { + cerr << "Error parsing input file:" << endl; + clog << e.expectedTokenSequences << endl; + } catch (...) { } -} +// restore standard streams + cin.rdbuf(cinbuf); + cout.rdbuf(coutbuf); + cerr.rdbuf(cerrbuf); +// close files & others + if (ifs.is_open()) + ifs.close(); + if (ofs.is_open()) + ofs.close(); + if (efs.is_open()) + efs.close(); + if (cs) + delete cs; + if (sr) + delete sr; -#endif \ No newline at end of file + return 0; +} diff --git a/bugs/bug001/src/main/cpp/StreamReader.cpp b/bugs/bug001/src/main/cpp/StreamReader.cpp index d93f0b1..07b06ec 100644 --- a/bugs/bug001/src/main/cpp/StreamReader.cpp +++ b/bugs/bug001/src/main/cpp/StreamReader.cpp @@ -1,29 +1,34 @@ #include #include "JavaCC.h" -class StreamReader : public ReaderStream { +using namespace std; + +class StreamReader: public ReaderStream { + public: - StreamReader(std::istream& is); - virtual ~StreamReader(); + StreamReader(istream &is); + virtual ~StreamReader(); - virtual size_t read(JJChar* buffer, int offset, size_t len); - virtual bool endOfInput(); + virtual size_t read(JJChar *buffer, int offset, size_t len); + virtual bool endOfInput(); private: - std::istream& is; -}; + istream &is; -using namespace std; -StreamReader::StreamReader(std::istream& is) : is(is) { +}; +StreamReader::StreamReader(istream &is) : + is(is) { } -StreamReader::~StreamReader() { +StreamReader::~StreamReader() { } -size_t StreamReader::read(JJChar * buffer, int offset, size_t len) { - is.read(buffer + offset, len); - return is.gcount(); + +size_t StreamReader::read(JJChar *buffer, int offset, size_t len) { + is.read(buffer + offset, len); + return is.gcount(); } + bool StreamReader::endOfInput() { - return is.eof(); -} \ No newline at end of file + return is.eof(); +} diff --git a/bugs/bug001/src/main/cpp/StreamReader.h b/bugs/bug001/src/main/cpp/StreamReader.h index 337f0ef..0eca58a 100644 --- a/bugs/bug001/src/main/cpp/StreamReader.h +++ b/bugs/bug001/src/main/cpp/StreamReader.h @@ -4,16 +4,20 @@ #include #include "JavaCC.h" -class StreamReader : public ReaderStream { +using namespace std; + +class StreamReader: public ReaderStream { + public: - StreamReader(std::istream& is); - virtual ~StreamReader(); + StreamReader(istream &is); + virtual ~StreamReader(); - virtual size_t read(JJChar* buffer, int offset, size_t len); - virtual bool endOfInput(); + virtual size_t read(JJChar *buffer, int offset, size_t len); + virtual bool endOfInput(); private: - std::istream& is; + istream &is; + }; -#endif \ No newline at end of file +#endif diff --git a/bugs/bug001/src/main/javacc/ComplexLineComment.jj b/bugs/bug001/src/main/javacc/ComplexLineComment.jj index 8641aff..83d782c 100644 --- a/bugs/bug001/src/main/javacc/ComplexLineComment.jj +++ b/bugs/bug001/src/main/javacc/ComplexLineComment.jj @@ -1,25 +1,62 @@ +options { + DEBUG_TOKEN_MANAGER=true; + TOKEN_MANAGER_INCLUDE="MyTM.h"; +} + PARSER_BEGIN(ComplexLineComment) PARSER_END(ComplexLineComment) -SKIP : { " " | "\t" | "\n" | "\r" } +TOKEN_MGR_DECLS : { + + int myfield; + + void mymethod() { + std::cout << "coucou from tm" << std::endl; + return; + }; + +} + + +SKIP : { " " | "\t" | "\n" | "\r" } -TOKEN: -{ <#NA : ~["-","\r","\n"] > -| <#EOL : ("\n"|"\r"|"\r\n") > +TOKEN : +{ + <#NA : ~[ "-", "\r", "\n" ] > +| <#EOL : ( "\n" | "\r" | "\r\n" ) > } -SPECIAL_TOKEN : {"--":LineComment} -SPECIAL_TOKEN :{<(|"-")*(|"-"|"-""-")?>:DEFAULT} +SPECIAL_TOKEN : +{ + "--" : LineComment +} +< LineComment > +SPECIAL_TOKEN : +{ + < ( + < NA > + | "-" < NA > + )* + ( + < EOL > + | "-" < EOL > + | "-" "-" + )? > : DEFAULT +} TOKEN : { - < Id: ["a"-"z","A"-"Z"] ( ["a"-"z","A"-"Z","0"-"9", "-"] )* > { std::cout << matchedToken->toString() << std::endl; } + < Id : [ "a"-"z", "A"-"Z" ] ( [ "a"-"z", "A"-"Z", "0"-"9", "-" ] )* > + { std::cout << matchedToken->toString() << std::endl; } } void Input() : {} { - ( )+ + ( )* + // { std::cout << "Finished ID+" << std::endl; std::cerr << System.err.println("Finished ID+" << std::endl; } + + // { std::cout << "EOF found" << std::endl; std::cerr << System.err.println("EOF found" << std::endl; } } diff --git a/bugs/bug001/test/clc1.err b/bugs/bug001/test/clc1.err deleted file mode 100644 index e69de29..0000000 diff --git a/bugs/bug001/test/clc1.exp_err b/bugs/bug001/test/clc1.exp_err new file mode 100644 index 0000000..6f552bd --- /dev/null +++ b/bugs/bug001/test/clc1.exp_err @@ -0,0 +1 @@ +Input file parsed successfully diff --git a/bugs/bug001/test/clc1.exp_out b/bugs/bug001/test/clc1.exp_out new file mode 100644 index 0000000..47d6604 --- /dev/null +++ b/bugs/bug001/test/clc1.exp_out @@ -0,0 +1,573 @@ + + Current character: 'a' at 1:1 +No string literal start with char: 'a' +Starting NFA with start state: 0 + Current character: 'a' +Looking to move from state: 0 for: +state=0 vectorindex=1 bitpattern=8589934592 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 0 characters. + Current character: 'a' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=8589934592 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 1 characters. + Current character: ' ' +Looking to move from state: 1 for: +state=1 vectorindex=0 bitpattern=512 jjChars[state][vectorIndex]=287984085547089920 +Done with NFA at pos: 2 +aa +Returning token: 'aa' + + Current character: ' ' at 1:8 +Looking for string literal match of kind:2 token image: '\t' + Current character: ' ' + Currently matched the first: 1 chars as kind: 2,with image: \t +No NFA state at pos: 2 +Found a SKIP match. + + Current character: '-' at 1:9 +Looking for string literal match of kind:7 token image: '--' + Current character: '-' + Current character: '-' + Currently matched the first: 2 chars as kind: 7,with image: -- +No NFA state at pos: 3 +Found a SKIP match. + + Current character: ' ' at 1:11 +No string literal start with char: ' ' +Starting NFA with start state: 9 + Current character: ' ' +Looking to move from state: 6 for: +state=6 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=35184372088832 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=9216 +Looking to move from state: 4 for: +state=4 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=8192 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=18446708889337453567 +Found a match of kind:8; kind: using the first: 0 characters. +Looking to move from state: 9 for: +state=9 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=0 + Current character: 'I' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=512 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=512 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=512 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=512 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 1 characters. + Current character: 'n' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=70368744177664 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=70368744177664 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=70368744177664 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=70368744177664 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 2 characters. + Current character: 't' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 3 characters. + Current character: '6' +Looking to move from state: 6 for: +state=6 vectorindex=0 bitpattern=18014398509481984 jjChars[state][vectorIndex]=35184372088832 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=18014398509481984 jjChars[state][vectorIndex]=9216 +Looking to move from state: 4 for: +state=4 vectorindex=0 bitpattern=18014398509481984 jjChars[state][vectorIndex]=8192 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=18014398509481984 jjChars[state][vectorIndex]=18446708889337453567 +Found a match of kind:8; kind: using the first: 4 characters. + Current character: ' ' +Looking to move from state: 6 for: +state=6 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=35184372088832 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=9216 +Looking to move from state: 4 for: +state=4 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=8192 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=18446708889337453567 +Found a match of kind:8; kind: using the first: 5 characters. + Current character: '-' +Looking to move from state: 6 for: +state=6 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=35184372088832 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=9216 +Looking to move from state: 4 for: +state=4 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=8192 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=18446708889337453567 + Current character: '-' +Looking to move from state: 8 for: +state=8 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=35184372088832 +Found a match of kind:8; kind: using the first: 7 characters. +Looking to move from state: 7 for: +state=7 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=8192 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=9216 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=18446708889337453567 +Done with NFA at pos: 7 +Found a SKIP match. + + Current character: ' ' at 1:19 +Looking for string literal match of kind:1 token image: ' ' + Current character: ' ' + Currently matched the first: 1 chars as kind: 1,with image: +No NFA state at pos: 2 +Found a SKIP match. + + Current character: '-' at 1:20 +Looking for string literal match of kind:7 token image: '--' + Current character: '-' + Current character: '-' + Currently matched the first: 2 chars as kind: 7,with image: -- +No NFA state at pos: 3 +Found a SKIP match. + + Current character: ' ' at 1:22 +No string literal start with char: ' ' +Starting NFA with start state: 9 + Current character: ' ' +Looking to move from state: 6 for: +state=6 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=35184372088832 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=9216 +Looking to move from state: 4 for: +state=4 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=8192 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=18446708889337453567 +Found a match of kind:8; kind: using the first: 0 characters. +Looking to move from state: 9 for: +state=9 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=0 + Current character: 'N' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=16384 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=16384 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=16384 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=16384 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 1 characters. + Current character: 'o' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 2 characters. + Current character: 't' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 3 characters. + Current character: ' ' +Looking to move from state: 6 for: +state=6 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=35184372088832 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=9216 +Looking to move from state: 4 for: +state=4 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=8192 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=18446708889337453567 +Found a match of kind:8; kind: using the first: 4 characters. + Current character: 'y' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=144115188075855872 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=144115188075855872 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=144115188075855872 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=144115188075855872 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 5 characters. + Current character: 'e' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=137438953472 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=137438953472 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=137438953472 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=137438953472 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 6 characters. + Current character: 't' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 7 characters. + Current character: ' ' +Looking to move from state: 6 for: +state=6 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=35184372088832 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=9216 +Looking to move from state: 4 for: +state=4 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=8192 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=18446708889337453567 +Found a match of kind:8; kind: using the first: 8 characters. + Current character: 's' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=2251799813685248 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=2251799813685248 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=2251799813685248 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=2251799813685248 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 9 characters. + Current character: 'u' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=9007199254740992 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=9007199254740992 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=9007199254740992 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=9007199254740992 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 10 characters. + Current character: 'p' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=281474976710656 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=281474976710656 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=281474976710656 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=281474976710656 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 11 characters. + Current character: 'p' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=281474976710656 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=281474976710656 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=281474976710656 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=281474976710656 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 12 characters. + Current character: 'o' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 13 characters. + Current character: 'r' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=1125899906842624 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=1125899906842624 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=1125899906842624 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=1125899906842624 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 14 characters. + Current character: 't' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 15 characters. + Current character: 'e' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=137438953472 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=137438953472 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=137438953472 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=137438953472 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 16 characters. + Current character: 'd' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=68719476736 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=68719476736 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=68719476736 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=68719476736 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 17 characters. + Current character: ' ' +Looking to move from state: 6 for: +state=6 vectorindex=0 bitpattern=8192 jjChars[state][vectorIndex]=35184372088832 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=8192 jjChars[state][vectorIndex]=9216 +Found a match of kind:8; kind: using the first: 18 characters. +Looking to move from state: 4 for: +state=4 vectorindex=0 bitpattern=8192 jjChars[state][vectorIndex]=8192 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=8192 jjChars[state][vectorIndex]=18446708889337453567 + Current character: ' +' +Looking to move from state: 3 for: +state=3 vectorindex=0 bitpattern=1024 jjChars[state][vectorIndex]=1024 +Found a match of kind:8; kind: using the first: 19 characters. +Done with NFA at pos: 19 +Found a SKIP match. + + Current character: 't' at 2:1 +No string literal start with char: 't' +Starting NFA with start state: 0 + Current character: 't' +Looking to move from state: 0 for: +state=0 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 0 characters. + Current character: 'e' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=137438953472 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 1 characters. + Current character: 'n' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=70368744177664 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 2 characters. + Current character: ' ' +Looking to move from state: 1 for: +state=1 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=287984085547089920 +Done with NFA at pos: 3 +ten +Returning token: 'ten' + + Current character: ' ' at 2:4 +Looking for string literal match of kind:1 token image: ' ' + Current character: ' ' + Currently matched the first: 1 chars as kind: 1,with image: +No NFA state at pos: 2 +Found a SKIP match. + + Current character: 'I' at 2:5 +No string literal start with char: 'I' +Starting NFA with start state: 0 + Current character: 'I' +Looking to move from state: 0 for: +state=0 vectorindex=1 bitpattern=512 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 0 characters. + Current character: 'n' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=70368744177664 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 1 characters. + Current character: 't' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 2 characters. + Current character: '1' +Looking to move from state: 1 for: +state=1 vectorindex=0 bitpattern=562949953421312 jjChars[state][vectorIndex]=287984085547089920 +Found a match of kind:9; kind: using the first: 3 characters. + Current character: ' ' +Looking to move from state: 1 for: +state=1 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=287984085547089920 +Done with NFA at pos: 4 +Int1 +Returning token: 'Int1' + + Current character: ' ' at 2:9 +Looking for string literal match of kind:1 token image: ' ' + Current character: ' ' + Currently matched the first: 1 chars as kind: 1,with image: +No NFA state at pos: 2 +Found a SKIP match. + + Current character: 'o' at 2:10 +No string literal start with char: 'o' +Starting NFA with start state: 0 + Current character: 'o' +Looking to move from state: 0 for: +state=0 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 0 characters. + Current character: 't' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 1 characters. + Current character: 'h' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=1099511627776 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 2 characters. + Current character: 'e' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=137438953472 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 3 characters. + Current character: 'r' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=1125899906842624 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 4 characters. + Current character: '-' +Looking to move from state: 1 for: +state=1 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=287984085547089920 +Found a match of kind:9; kind: using the first: 5 characters. + Current character: 't' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 6 characters. + Current character: 'e' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=137438953472 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 7 characters. + Current character: 'n' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=70368744177664 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 8 characters. + Current character: ' ' +Looking to move from state: 1 for: +state=1 vectorindex=0 bitpattern=8192 jjChars[state][vectorIndex]=287984085547089920 +Done with NFA at pos: 9 +other-ten +Returning token: 'other-ten' + + Current character: ' ' at 2:19 +Looking for string literal match of kind:4 token image: '\r' + Current character: ' ' + Currently matched the first: 1 chars as kind: 4,with image: \r +No NFA state at pos: 2 +Found a SKIP match. + + Current character: ' +' at 2:20 +Looking for string literal match of kind:3 token image: '\n' + Current character: ' +' + Currently matched the first: 1 chars as kind: 3,with image: \n +No NFA state at pos: 2 +Found a SKIP match. + + Current character: 'o' at 3:1 +No string literal start with char: 'o' +Starting NFA with start state: 0 + Current character: 'o' +Looking to move from state: 0 for: +state=0 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 0 characters. + Current character: 't' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 1 characters. + Current character: 'h' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=1099511627776 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 2 characters. + Current character: 'e' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=137438953472 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 3 characters. + Current character: 'r' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=1125899906842624 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 4 characters. + Current character: '-' +Looking to move from state: 1 for: +state=1 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=287984085547089920 +Found a match of kind:9; kind: using the first: 5 characters. + Current character: 't' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 6 characters. + Current character: 'e' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=137438953472 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 7 characters. + Current character: 'n' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=70368744177664 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 8 characters. + Current character: ' ' +Looking to move from state: 1 for: +state=1 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=287984085547089920 +Done with NFA at pos: 9 +other-ten +Returning token: 'other-ten' + + Current character: ' ' at 3:10 +Looking for string literal match of kind:1 token image: ' ' + Current character: ' ' + Currently matched the first: 1 chars as kind: 1,with image: +No NFA state at pos: 2 +Found a SKIP match. + + Current character: 'I' at 3:11 +No string literal start with char: 'I' +Starting NFA with start state: 0 + Current character: 'I' +Looking to move from state: 0 for: +state=0 vectorindex=1 bitpattern=512 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 0 characters. + Current character: 'n' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=70368744177664 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 1 characters. + Current character: 't' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=4503599627370496 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 2 characters. + Current character: '2' +Looking to move from state: 1 for: +state=1 vectorindex=0 bitpattern=1125899906842624 jjChars[state][vectorIndex]=287984085547089920 +Found a match of kind:9; kind: using the first: 3 characters. + Current character: ' ' +Looking to move from state: 1 for: +state=1 vectorindex=0 bitpattern=8192 jjChars[state][vectorIndex]=287984085547089920 +Done with NFA at pos: 4 +Int2 +Returning token: 'Int2' + + Current character: ' ' at 3:15 +Looking for string literal match of kind:4 token image: '\r' + Current character: ' ' + Currently matched the first: 1 chars as kind: 4,with image: \r +No NFA state at pos: 2 +Found a SKIP match. + + Current character: ' +' at 3:16 +Looking for string literal match of kind:3 token image: '\n' + Current character: ' +' + Currently matched the first: 1 chars as kind: 3,with image: \n +No NFA state at pos: 2 +Found a SKIP match. + + Current character: ' ' at 4:1 +Looking for string literal match of kind:4 token image: '\r' + Current character: ' ' + Currently matched the first: 1 chars as kind: 4,with image: \r +No NFA state at pos: 2 +Found a SKIP match. + + Current character: ' +' at 4:2 +Looking for string literal match of kind:3 token image: '\n' + Current character: ' +' + Currently matched the first: 1 chars as kind: 3,with image: \n +Found a SKIP match. + Reached EOF at 4:2 diff --git a/bugs/bug001/test/clc1.out b/bugs/bug001/test/clc1.out deleted file mode 100644 index a87decc..0000000 --- a/bugs/bug001/test/clc1.out +++ /dev/null @@ -1 +0,0 @@ -Parser Version 0.1: file parsed successfully. diff --git a/bugs/bug001/test/clc1.ref b/bugs/bug001/test/clc1.ref deleted file mode 100644 index 2236ff0..0000000 --- a/bugs/bug001/test/clc1.ref +++ /dev/null @@ -1,6 +0,0 @@ -aa -ten -Int1 -other-ten -other-ten -Int2 diff --git a/bugs/bug001/test/clc2.err b/bugs/bug001/test/clc2.err deleted file mode 100644 index e69de29..0000000 diff --git a/bugs/bug001/test/clc2.exp_err b/bugs/bug001/test/clc2.exp_err new file mode 100644 index 0000000..6f552bd --- /dev/null +++ b/bugs/bug001/test/clc2.exp_err @@ -0,0 +1 @@ +Input file parsed successfully diff --git a/bugs/bug001/test/clc2.exp_out b/bugs/bug001/test/clc2.exp_out new file mode 100644 index 0000000..4131892 --- /dev/null +++ b/bugs/bug001/test/clc2.exp_out @@ -0,0 +1,150 @@ + + Current character: 'a' at 1:1 +No string literal start with char: 'a' +Starting NFA with start state: 0 + Current character: 'a' +Looking to move from state: 0 for: +state=0 vectorindex=1 bitpattern=8589934592 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 0 characters. + Current character: 'a' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=8589934592 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 1 characters. + Current character: ' ' +Looking to move from state: 1 for: +state=1 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=287984085547089920 +Done with NFA at pos: 2 +aa +Returning token: 'aa' + + Current character: ' ' at 1:3 +Looking for string literal match of kind:1 token image: ' ' + Current character: ' ' + Currently matched the first: 1 chars as kind: 1,with image: +No NFA state at pos: 2 +Found a SKIP match. + + Current character: '-' at 1:4 +Looking for string literal match of kind:7 token image: '--' + Current character: '-' + Current character: '-' + Currently matched the first: 2 chars as kind: 7,with image: -- +No NFA state at pos: 3 +Found a SKIP match. + + Current character: ' ' at 1:6 +No string literal start with char: ' ' +Starting NFA with start state: 9 + Current character: ' ' +Looking to move from state: 6 for: +state=6 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=35184372088832 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=9216 +Looking to move from state: 4 for: +state=4 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=8192 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=18446708889337453567 +Found a match of kind:8; kind: using the first: 0 characters. +Looking to move from state: 9 for: +state=9 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=0 + Current character: 'o' +Looking to move from state: 6 for: +state=6 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=0 +Looking to move from state: 4 for: +state=4 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=140737488355328 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 1 characters. + Current character: '-' +Looking to move from state: 6 for: +state=6 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=35184372088832 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=9216 +Looking to move from state: 4 for: +state=4 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=8192 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=18446708889337453567 + Current character: 'i' +Looking to move from state: 8 for: +state=8 vectorindex=1 bitpattern=2199023255552 jjChars[state][vectorIndex]=0 +Looking to move from state: 7 for: +state=7 vectorindex=1 bitpattern=2199023255552 jjChars[state][vectorIndex]=0 +Looking to move from state: 5 for: +state=5 vectorindex=1 bitpattern=2199023255552 jjChars[state][vectorIndex]=0 +Looking to move from state: 2 for: +state=2 vectorindex=1 bitpattern=2199023255552 jjChars[state][vectorIndex]=18446744073709551615 +Found a match of kind:8; kind: using the first: 3 characters. + Current character: ' ' +Looking to move from state: 6 for: +state=6 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=35184372088832 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=9216 +Looking to move from state: 4 for: +state=4 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=8192 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=4294967296 jjChars[state][vectorIndex]=18446708889337453567 +Found a match of kind:8; kind: using the first: 4 characters. + Current character: '-' +Looking to move from state: 6 for: +state=6 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=35184372088832 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=9216 +Looking to move from state: 4 for: +state=4 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=8192 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=18446708889337453567 + Current character: '-' +Looking to move from state: 8 for: +state=8 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=35184372088832 +Found a match of kind:8; kind: using the first: 6 characters. +Looking to move from state: 7 for: +state=7 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=8192 +Looking to move from state: 5 for: +state=5 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=9216 +Looking to move from state: 2 for: +state=2 vectorindex=0 bitpattern=35184372088832 jjChars[state][vectorIndex]=18446708889337453567 +Done with NFA at pos: 6 +Found a SKIP match. + + Current character: ' ' at 1:13 +Looking for string literal match of kind:1 token image: ' ' + Current character: ' ' + Currently matched the first: 1 chars as kind: 1,with image: +No NFA state at pos: 2 +Found a SKIP match. + + Current character: 'b' at 1:14 +No string literal start with char: 'b' +Starting NFA with start state: 0 + Current character: 'b' +Looking to move from state: 0 for: +state=0 vectorindex=1 bitpattern=17179869184 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 0 characters. + Current character: 'b' +Looking to move from state: 1 for: +state=1 vectorindex=1 bitpattern=17179869184 jjChars[state][vectorIndex]=576460743847706622 +Found a match of kind:9; kind: using the first: 1 characters. + Current character: ' ' +Looking to move from state: 1 for: +state=1 vectorindex=0 bitpattern=8192 jjChars[state][vectorIndex]=287984085547089920 +Done with NFA at pos: 2 +bb +Returning token: 'bb' + + Current character: ' ' at 1:16 +Looking for string literal match of kind:4 token image: '\r' + Current character: ' ' + Currently matched the first: 1 chars as kind: 4,with image: \r +No NFA state at pos: 2 +Found a SKIP match. + + Current character: ' +' at 1:17 +Looking for string literal match of kind:3 token image: '\n' + Current character: ' +' + Currently matched the first: 1 chars as kind: 3,with image: \n +Found a SKIP match. + Reached EOF at 1:17 diff --git a/bugs/bug001/test/clc2.out b/bugs/bug001/test/clc2.out deleted file mode 100644 index a87decc..0000000 --- a/bugs/bug001/test/clc2.out +++ /dev/null @@ -1 +0,0 @@ -Parser Version 0.1: file parsed successfully. diff --git a/bugs/bug001/test/clc2.ref b/bugs/bug001/test/clc2.ref deleted file mode 100644 index 6ad4673..0000000 --- a/bugs/bug001/test/clc2.ref +++ /dev/null @@ -1,2 +0,0 @@ -aa -bb diff --git a/bugs/bug002/pom.xml b/bugs/bug002/pom.xml index db3dc4c..3250be5 100644 --- a/bugs/bug002/pom.xml +++ b/bugs/bug002/pom.xml @@ -32,13 +32,13 @@ THE POSSIBILITY OF SUCH DAMAGE. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + org.javacc.generator.cpp bugs 1.1.0-SNAPSHOT - + org.javacc.generator.cpp.bugs bug002 nar @@ -48,7 +48,35 @@ THE POSSIBILITY OF SUCH DAMAGE. + + org.apache.maven.plugins + maven-clean-plugin + + + clear-res + test + + clean + + + true + + + test + + *.out, *.err + + + + + + + + + + + + + org.codehaus.mojo + exec-maven-plugin + + + exec-1 + test + + exec + + + + ${project.basedir}/target/nar/${project.artifactId}-${project.version}-${nar.aol}-executable/bin/${nar.aol}/${project.artifactId}.exe + + ${project.basedir}/test/bug.in + ${project.basedir}/test/bug.out + ${project.basedir}/test/bug.err + + + + + org.apache.maven.plugins maven-antrun-plugin - compare-out + check-res-1 test run - - + + - - - - + + + + + + + + + + + + + - + diff --git a/bugs/bug002/src/main/cpp/Main.cpp b/bugs/bug002/src/main/cpp/Main.cpp index 32aa436..45cd6e1 100644 --- a/bugs/bug002/src/main/cpp/Main.cpp +++ b/bugs/bug002/src/main/cpp/Main.cpp @@ -10,10 +10,10 @@ #if !defined(JJ8) && !defined(JJ7) #define JJ8 #endif -#if defined(JJ8) +#if defined(JJ8) #include "DefaultCharStream.h" #define CHARSTREAM DefaultCharStream -#elif defined(JJ7) +#elif defined(JJ7) #include "CharStream.h" #define CHARSTREAM CharStream #endif @@ -21,78 +21,88 @@ using namespace std; -JJString ReadFileFully() { - JJString code; - code = -"{ c }\n" -; +#define MYPARSER Bug +#define MYTM BugTokenManager +#define MYENTRY EnumerationItem - return code; -} -static void usage(int argc, char**argv) { - cerr << "Parser" << " [ in [ out [ err ] ] ]" << endl; -} -int main(int argc, char**argv) { - istream* input = &cin; - ostream* output = &cout; - ostream* error = &cerr; - ifstream ifs; - ofstream ofs; - ofstream efs; - StreamReader* sr = nullptr; - CharStream * cs = nullptr; +int main(int argc, char **argv) { - try { - if (argc > 1) { - switch(argc) { - case 4: efs.open(argv[3]); - case 3: ofs.open(argv[2]); - case 2: ifs.open(argv[1], ifstream::binary); - } - if (ifs.is_open()) { - input = &ifs; - sr = new StreamReader(ifs); - cs = new CHARSTREAM(sr); - } - else { - cerr << "cannot open in file" << endl; - return 8; - } - if (ofs.is_open()) { - output = &ofs; - } - if (efs.is_open()) { - error = &efs; - } - } else - if (argc == 1) { - JJString s = ReadFileFully(); - *output << s << endl; - cs = new CHARSTREAM(s.c_str(), s.size() - 1, 1, 1); - } - else { - usage(argc, argv); - return 0; - } - TokenManager *scanner = new BugTokenManager(cs); -#if defined(JJ8) - scanner->disable_tracing(); -#endif - Bug parser(scanner); + if (argc != 4) { + cerr << "Error: invalid number of arguments (" << (argc - 1) << ")" << endl; + cerr << "Usage: MYPARSER [ inputfile [ outputfile [ errorfile ] ] ]" << endl; + return 4; + } + + // see https://stackoverflow.com/questions/10150468/how-to-redirect-cin-and-cout-to-files + ifstream ifs; + ofstream ofs; + ofstream efs; + streambuf *cinbuf; + streambuf *coutbuf; + streambuf *cerrbuf; + + StreamReader *sr = nullptr; + CharStream *cs = nullptr; + + try { + // open files and redirect standard streams to them + switch (argc) { + case 4: + efs.open(argv[3]); + case 3: + ofs.open(argv[2]); + case 2: + ifs.open(argv[1], ifstream::binary); + } + if (ifs.is_open()) { + sr = new StreamReader(ifs); + cs = new CHARSTREAM(sr); + cinbuf = cin.rdbuf(); + cin.rdbuf(ifs.rdbuf()); + } else { + cerr << "Cannot open input file" << endl; + return 8; + } + if (ofs.is_open()) { + coutbuf = cout.rdbuf(); + cout.rdbuf(ofs.rdbuf()); + } else { + cerr << "Cannot open output file" << endl; + return 8; + } + if (efs.is_open()) { + cerrbuf = cerr.rdbuf(); + cerr.rdbuf(efs.rdbuf()); + } - parser.EnumerationItem(); - *output << "Parser : file parsed successfully." << endl; - } catch (const ParseException& e) { - clog << e.expectedTokenSequences << endl; - } - catch (...) { + // parse + MYPARSER parser(new MYTM(cs)); +// MYTM *scanner = new MYTM(cs); +// scanner->disable_tracing(); +// MYPARSER parser(scanner); + parser.MYENTRY(); + cerr << "Input file parsed successfully" << endl; + } catch (const ParseException &e) { + cerr << "Error parsing input file:" << endl; + clog << e.expectedTokenSequences << endl; + } catch (...) { + } - } - if (ifs.is_open()) ifs.close(); - if (ofs.is_open()) ofs.close(); - if (efs.is_open()) efs.close(); - if (cs) delete cs; - if (sr) delete sr; +// restore standard streams + cin.rdbuf(cinbuf); + cout.rdbuf(coutbuf); + cerr.rdbuf(cerrbuf); +// close files & others + if (ifs.is_open()) + ifs.close(); + if (ofs.is_open()) + ofs.close(); + if (efs.is_open()) + efs.close(); + if (cs) + delete cs; + if (sr) + delete sr; - return 0; + return 0; } diff --git a/bugs/bug002/src/main/javacc/Bug002.jj b/bugs/bug002/src/main/javacc/Bug002.jj index c1ded17..840a17e 100644 --- a/bugs/bug002/src/main/javacc/Bug002.jj +++ b/bugs/bug002/src/main/javacc/Bug002.jj @@ -1,12 +1,15 @@ -options { -SANITY_CHECK=false; -DEBUG_PARSER=true; -DEBUG_TOKEN_MANAGER=false; -DEBUG_LOOKAHEAD=true; -STATIC=false; -NO_DFA=false; +options +{ + SANITY_CHECK = false; + DEBUG_PARSER = true; + DEBUG_TOKEN_MANAGER = true; + DEBUG_LOOKAHEAD = true; + STATIC = false; + //NO_DFA=false; } + PARSER_BEGIN(Bug) + PARSER_END(Bug) TOKEN_MGR_DECLS : @@ -18,216 +21,274 @@ TOKEN_MGR_DECLS : int linesCommentCount = 0; } +SKIP : +{ + " " +| "\t" +| "\n" +| "\r" +| "\f" +} -SKIP:{" "|"\t"|"\n"|"\r"|"\f"} -SKIP:{"/*"{linesCommentCount=1;}:LinesComment} -SKIP:{"/*"{linesCommentCount+=1;}} -SKIP:{"*/"{linesCommentCount-=1;SwitchTo(linesCommentCount==0?DEFAULT:LinesComment);}} -SKIP:{<~[]>} +//SKIP : +//{ +// "/*" +// { +// linesCommentCount = 1; +// } +// : LinesComment +//} +// +//< LinesComment > SKIP : +//{ +// "/*" +// { +// linesCommentCount += 1; +// } +//} +// +//< LinesComment > SKIP : +//{ +// "*/" +// { +// linesCommentCount -= 1; +// SwitchTo(linesCommentCount == 0 ? DEFAULT : LinesComment); +// } +//} +// +//< LinesComment > SKIP : +//{ +// < ~[] > +//} -TOKEN: -{ <#NA:~["-","\r","\n"]> -| <#EOL:("\n"|"\r"|"\r\n")> -} +//TOKEN : +//{ +// < #NA : ~["-", "\r", "\n"] > +//| < #EOL : ("\n" | "\r" | "\r\n") > +//} -SPECIAL_TOKEN:{"--":LineComment} -SPECIAL_TOKEN:{<(|"-")*(|"-"|"-""-")?>:DEFAULT} +//SPECIAL_TOKEN : +//{ +// "--" : LineComment +//} +// +//< LineComment > SPECIAL_TOKEN : +//{ +// < ( < NA > | "-" < NA > )* ( < EOL > | "-" < EOL > | "-" "-" )? > : DEFAULT +//} -TOKEN: -{ -|"> -| -| -| -| -| -| -| -| -| -| -| -|"> -| -| -| -| -| -| -| -| -| -| -| -| -| +TOKEN : +{ +// < DBLLBRACKET : "[[" > +//| < CTAG : "/>" > +//| < ETAG : " +//| + < LBRACKET : "[" > +| < RBRACKET : "]" > +| < LBRACE : "{" > +| < RBRACE : "}" > +| < LPAREN : "(" > +| < RPAREN : ")" > +//| < CIRCONFLEX : "^" > +//| < VERTICAL : "|" > +//| < COMMA : "," > +//| < LESS : "<" > +//| < GREATER : ">" > +//| < ASSIGN : "::=" > +//| < EXCLAMATION : "!" > +//| < AMPERSAND : "&" > +//| < ASTERISK : "*" > +//| < SLASH : "/" > +//| < HYPHEN : "-" > +//| < COLON : ":" > +//| < SEMICOLON : ";" > +//| < DOT : "." > +//| < DOTDOT : ".." > +//| < DOTDOTDOT : "..." > +//| < ARROBASE : "@" > +//| < ARROBASEDOT : "@." > } -TOKEN: +//TOKEN : +//{ +// < ABSENT : "ABSENT" > +//| < ABSTRACT_SYNTAX : "ABSTRACT-SYNTAX" > +//| < ACCESS : "ACCESS" > +//| < ALL : "ALL" > +//| < ANY : "ANY" > +//| < APPLICATION : "APPLICATION" > +//| < AUTOMATIC : "AUTOMATIC" > +//| < BEGIN : "BEGIN" > +//| < BIT : "BIT" > +//| < BOOLEAN : "BOOLEAN" > +//| < BY : "BY" > +//| < CHARACTER : "CHARACTER" > +//| < CHOICE : "CHOICE" > +//| < CLASS : "CLASS" > +//| < COMPONENT : "COMPONENT" > +//| < CONTAINING : "CONTAINING" > +//| < CONSTRAINED : "CONSTRAINED" > +//| < COMPONENTS : "COMPONENTS" > +//| < DATE : "DATE" > +//| < DATE_TIME : "DATE-TIME" > +//| < DEFAULT_ : "DEFAULT" > +//| < DEFINED : "DEFINED" > +//| < DEFINITIONS : "DEFINITIONS" > +//| < DESCRIPTION : "DESCRIPTION" > +//| < DURATION : "DURATION" > +//| < EMBEDDED : "EMBEDDED" > +//| < ENCODED : "ENCODED" > +//| < END : "END" > +//| < ENUMERATED : "ENUMERATED" > +//| < EXCEPT : "EXCEPT" > +//| < EXPLICIT : "EXPLICIT" > +//| < EXPORTS : "EXPORTS" > +//| < EXTENSIBILITY : "EXTENSIBILITY" > +//| < EXTERNAL : "EXTERNAL" > +//| < FROM : "FROM" > +//| < IDENTIFIER : "IDENTIFIER" > +//| < IMPLICIT : "IMPLICIT" > +//| < IMPLIED : "IMPLIED" > +//| < IMPORTS : "IMPORTS" > +//| < INCLUDES : "INCLUDES" > +//| < INSTANCE : "INSTANCE" > +//| < INSTRUCTIONS : "INSTRUCTIONS" > +//| < INTEGER : "INTEGER" > +//| < INTERSECTION : "INTERSECTION" > +//| < MACRO : "MACRO" > +//| < MAX : "MAX" > +//| < MIN : "MIN" > +//| < MINUS_INFINITY : "MINUS-INFINITY" > +//| < NULLL : "NULL" > +//| < OBJECT_TYPE : "OBJECT-TYPE" > +//| < OBJECT : "OBJECT" > +//| < OID_IRI : "OID-IRI" > +//| < OCTET : "OCTET" > +//| < OF : "OF" > +//| < OPTIONAL : "OPTIONAL" > +//| < PATTERN : "PATTERN" > +//| < PDV : "PDV" > +//| < PLUS_INFINITY : "PLUS-INFINITY" > +//| < PRESENT : "PRESENT" > +//| < PRIVATE : "PRIVATE" > +//| < REAL : "REAL" > +//| < RELATIVE_OID : "RELATIVE-OID" > +//| < RELATIVE_OID_IRI : "RELATIVE-OID-IRI" > +//| < SEQUENCE : "SEQUENCE" > +//| < SET : "SET" > +//| < SETTINGS : "SETTINGS" > +//| < SIZE : "SIZE" > +//| < STATUS : "STATUS" > +//| < STRING : "STRING" > +//| < SYNTAX : "SYNTAX" > +//| < TAGS : "TAGS" > +//| < TIME : "TIME" > +//| < TIME_OF_DAY : "TIME-OF-DAY" > +//| < TYPE_IDENTIFIER : "TYPE-IDENTIFIER" > +//| < UNION : "UNION" > +//| < UNIQUE : "UNIQUE" > +//| < UNIVERSAL : "UNIVERSAL" > +//| < WITH : "WITH" > +//| < BMPString : "BMPString" > +//| < GeneralString : "GeneralString" > +//| < GraphicString : "GraphicString" > +//| < IA5String : "IA5String" > +//| < ISO646String : "ISO646String" > +//| < NumericString : "NumericString" > +//| < PrintableString : "PrintableString" > +//| < TeletexString : "TeletexString" > +//| < T61String : "T61String" > +//| < UniversalString : "UniversalString" > +//| < UTF8String : "UTF8String" > +//| < VideotexString : "VideotexString" > +//| < VisibleString : "VisibleString" > +//| < LOWERTRUE : "true" > +//| < LOWERFALSE : "false" > +//| < UPPERTRUE : "TRUE" > +//| < UPPERFALSE : "FALSE" > +//| < GeneralizedTime : "GeneralizedTime" > +//| < UTCTime : "UTCTime" > +//| < ObjectDescriptor : "ObjectDescriptor" > +//} + +TOKEN : { - -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| + < #UPPER : ["A"-"Z"] > +| < #LOWER : ["a"-"z"] > +| < #DIGIT : ["0"-"9"] > +//| < #QUOTE : "\"" > +//| < #DOUBLEDQUOTE : "\"\"" > +//| < BSTRING : "'" ( ["0"-"1"] )* "'B" > +//| < HSTRING : "'" ( < DIGIT > | ["A"-"F"] | ["a" - "f"] )* "'H" > +//| < CSTRING : < QUOTE > ( ~["\""] | < DOUBLEDQUOTE > )* < QUOTE > > +| < NUMBER : ( "0" | ["1"-"9"] ( < DIGIT > )*) > +//| < FLOAT : < NUMBER > "." < NUMBER > > +//| < #LOWERCASEFIRSTREF : "&" < LOWERCASEFIRST > > +//| < #UPPERCASEFIRSTREF : "&" < UPPERCASEFIRST > > +//| < #UPPERCASEDIGIT : < UPPER > ( "-" ( < UPPER > | < DIGIT > ) | ( < UPPER > | < DIGIT > ) )* > +| < #LOWERCASEFIRST : < LOWER > ( "-" ( < LOWER > | < UPPER > | < DIGIT > ) | ( < LOWER > | < UPPER > | < DIGIT > ) )* > +| < #UPPERCASEFIRST : < UPPER > ( "-" ( < LOWER > | < UPPER > | < DIGIT > ) | ( < LOWER > | < UPPER > | < DIGIT > ) )* > } -TOKEN: +TOKEN : { -<#UPPER:["A"-"Z"]> -|<#LOWER:["a"-"z"]> -|<#DIGIT:["0"-"9"]> -|<#QUOTE:"\""> -|<#DOUBLEDQUOTE:"\"\""> -| -||["A"-"F"]|["a"-"f"])*"'H"> -|(~["\""]|)*> -|)*)> -|"."> -|<#LOWERCASEFIRSTREF:"&"> -|<#UPPERCASEFIRSTREF:"&"> -|<#UPPERCASEDIGIT:("-"(|)|(|))*> -|<#LOWERCASEFIRST:("-"(||)|(||))*> -|<#UPPERCASEFIRST:("-"(||)|(||))*> +// < WOULDBE_OBJECTCLASSREFERENCE : < UPPERCASEDIGIT > > +//| < OBJECTCLASSREFERENCE : < UPPERCASEDIGIT > > +//| < TYPEREFERENCE : < UPPERCASEFIRST > > +//| + < IDENTIFIANT : < LOWERCASEFIRST > > +| < VALUEREFERENCE : < LOWERCASEFIRST > > +//| < MODULEREFERENCE : < UPPERCASEFIRST > > +//| < FIELDREFERENCE : < LOWERCASEFIRSTREF > > +//| < FIELDSETREFERENCE : < UPPERCASEFIRSTREF > > +//| < WORD : < LOWERCASEFIRST > > +//| < OBJECTREFERENCE : < LOWERCASEFIRST > > +//| < OBJECTSETREFERENCE : < TYPEREFERENCE > > +//| < PARAMETERIZEDTYPEREFERENCE : < TYPEREFERENCE > > +//| < PARAMETERIZEDOBJECTCLASSREFERENCE : < UPPERCASEDIGIT > > +//| < PARAMETERIZEDVALUEREFERENCE : < LOWERCASEFIRST > > +//| < PARAMETERIZEDOBJECTREFERENCE : < LOWERCASEFIRST > > +//| < PARAMETERIZEDOBJECTSETREFERENCE : < TYPEREFERENCE > > +//| < PARAMETERIZEDVALUESETTYPEREFERENCE : < UPPERCASEFIRST > > +//| < FIXEDTYPEVALUEFIELDREFERENCE : < LOWERCASEFIRSTREF > > +//| < VARIABLETYPEVALUEFIELDREFERENCE : < LOWERCASEFIRSTREF > > +//| < OBJECTFIELDREFERENCE : < LOWERCASEFIRSTREF > > +//| < TYPEFIELDREFERENCE : < UPPERCASEFIRSTREF > > +//| < OBJECTSETFIELDREFERENCE : < UPPERCASEFIRSTREF > > +//| < FIXEDTYPEVALUESETFIELDREFERENCE : < UPPERCASEFIRSTREF > > +//| < VARIABLETYPEVALUESETFIELDREFERENCE : < UPPERCASEFIRSTREF > > } -TOKEN:{ -> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> -|> +void EnumerationItem() : +{} +{ + < LBRACE > + ( + LOOKAHEAD(2) + NamedNumber() + | identifier() + ) + < RBRACE > } +void NamedNumber() : +{} +{ + ( + identifier() + | valuereference() + ) + < LPAREN > < NUMBER > < RPAREN > +} -void EnumerationItem() : { } -{ - - ( LOOKAHEAD(2) - NamedNumber() - | identifier() - ) - +void identifier() :{ } -void NamedNumber() : -{ } { - ( identifier() | valuereference() ) - - + < IDENTIFIANT > } -void identifier() : {} { } -void valuereference() : {} { } +void valuereference() : +{} +{ + < VALUEREFERENCE > +} diff --git a/bugs/bug002/test/bug.err b/bugs/bug002/test/bug.err deleted file mode 100644 index e69de29..0000000 diff --git a/bugs/bug002/test/bug.exp_err b/bugs/bug002/test/bug.exp_err new file mode 100644 index 0000000..6f552bd --- /dev/null +++ b/bugs/bug002/test/bug.exp_err @@ -0,0 +1 @@ +Input file parsed successfully diff --git a/bugs/bug002/test/bug.exp_out b/bugs/bug002/test/bug.exp_out new file mode 100644 index 0000000..2a43c71 Binary files /dev/null and b/bugs/bug002/test/bug.exp_out differ diff --git a/bugs/bug002/test/bug.out b/bugs/bug002/test/bug.out deleted file mode 100644 index 664c82e..0000000 --- a/bugs/bug002/test/bug.out +++ /dev/null @@ -1 +0,0 @@ -Parser : file parsed successfully. diff --git a/bugs/bug002/test/bug.ref b/bugs/bug002/test/bug.ref deleted file mode 100644 index 664c82e..0000000 --- a/bugs/bug002/test/bug.ref +++ /dev/null @@ -1 +0,0 @@ -Parser : file parsed successfully. diff --git a/bugs/invoker.properties b/bugs/invoker.properties index b32479b..92aeff8 100644 --- a/bugs/invoker.properties +++ b/bugs/invoker.properties @@ -1,5 +1,5 @@ # A comma or space separated list of goals/phases to execute, may # specify an empty list to execute the default goal of the IT project. # Environment variables used by maven plugins can be added here -invoker.goals = clean install +invoker.goals = clean verify #invoker.debug = true \ No newline at end of file diff --git a/it/pom.xml b/it/pom.xml index 05ad261..aedb2be 100644 --- a/it/pom.xml +++ b/it/pom.xml @@ -146,7 +146,8 @@ THE POSSIBILITY OF SUCH DAMAGE. executable - true + + diff --git a/pom.xml b/pom.xml index 3d0b499..2f02c04 100644 --- a/pom.xml +++ b/pom.xml @@ -105,7 +105,7 @@ THE POSSIBILITY OF SUCH DAMAGE. true false - it/local-repo + ${project.basedir}/it/local-repo diff --git a/src/main/resources/templates/cpp/TableDrivenTokenManager.cc.template b/src/main/resources/templates/cpp/TableDrivenTokenManager.cc.template index c5a5f58..092f3a0 100644 --- a/src/main/resources/templates/cpp/TableDrivenTokenManager.cc.template +++ b/src/main/resources/templates/cpp/TableDrivenTokenManager.cc.template @@ -278,7 +278,7 @@ int ${parserName}TokenManager::jjMoveNfa(int startState, int curPos) { ++curPos; } while (cnt > 0); - throw "Interal error. Please submit a bug at:https://github.com/javacc/javacc/issues"; + throw "Internal error. Please submit a bug at:https://github.com/javacc/javacc/issues"; // return curPos; }