Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
[JAVACC-228] Wrong line ending in ParserTokenManager Created: 27/Jul/09 22/Sep/09 Status: Project: Component/s: Affects Version/s: Fix Version/s: Open javacc parser generator 4.2 Type: Reporter: Resolution: Labels: Remaining Estimate: Time Spent: Original Estimate: Environment: Bug janosch Unresolved None Not Specified Issuezilla Id: 228 milestone 1 Priority: Assignee: Votes: Major paulcager 0 Not Specified Not Specified Operating System: All Platform: All Description javacc now automatically adds a @SuppressWarnings("all") annotation to the classes it generates, but sadly, it does not respect the OS default line ending style (as it does everywhere else) and simply uses \n, which leads to uncommitable classes (SVN checks for consistent line endings). In the end, i have to fix the line breaks by hand, which undermines the hashcodes of course. Comments Comment by paulcager [ 09/Sep/09 ] Could you just clarify which file you mean, please? If I remember coirrectly we no longer produce that annotation. Comment by janosch [ 22/Sep/09 ] Updated: you are right,@SuppressWarnings annotations are not generated anymore. Still some line-endings are wrong, the following is an excerpt of my generated ParserTokenManager, i marked line-endings by <CR> and <LF>, note the line of the first method declaration and the line with the switch statement: /* Generated By:JavaCC: Do not edit this line. ParserTokenManager.java */<CR><LF> package cion.utils.cdml.parser;<CR><LF> import cion.utils.cdml.ast.*;<CR><LF> import java.util.Vector;<CR><LF> import java.io.File;<CR><LF> <CR><LF> /** Token Manager. */<CR><LF> public class ParserTokenManager implements ParserConstants<CR><LF> {<CR><LF> <CR><LF> /** Debug output. */<CR><LF> public java.io.PrintStream debugStream = System.out;<CR><LF> /** Set debug output. */<CR><LF> public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } <CR><LF> private final int jjStopStringLiteralDfa_0(int pos, long active0)<LF> {<CR><LF> switch (pos)<LF> {<CR><LF> case 0:<CR><LF> if ((active0 & 0x400000L) != 0L)<CR><LF> return 14;<CR><LF> if ((active0 & 0x7f00000000L) != 0L)<CR><LF> {<CR><LF> Comment by paulcager [ 22/Sep/09 ] Thanks for the update - I'll fix it for the next release. Comment by paulcager [ 22/Sep/09 ] There are 3 embedded '\n's in RStringLiteral.java that need to be changed: ostr.println("long active" + i + ")\n{"); ostr.println(" switch (pos)\n {"); ostr.println("long active" + i + ")\n{"); It looks like the following files have the same problem: src/org/javacc/jjdoc/BNFGenerator.java src/org/javacc/jjdoc/HTMLGenerator.java src/org/javacc/jjdoc/JJDoc.java src/org/javacc/jjdoc/TextGenerator.java src/org/javacc/jjtree/JJTree.jjt src/org/javacc/jjtree/JJTreeNode.java src/org/javacc/jjtree/TokenUtils.java src/org/javacc/parser/Expansion.java src/org/javacc/parser/JavaCC.jj src/org/javacc/parser/JavaCCGlobals.java src/org/javacc/parser/JavaCCParserInternals.java src/org/javacc/parser/LexGen.java src/org/javacc/parser/NfaState.java src/org/javacc/parser/NormalProduction.java src/org/javacc/parser/ParseEngine.java src/org/javacc/parser/RStringLiteral.java src/org/javacc/parser/test/NfaStateTest.java Generated at Thu May 11 08:56:50 UTC 2017 using JIRA 6.2.3#6260sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.