c++ generated parser doesn't support international characters
See original GitHub issueProblem is with some international characters.
How to reproduce the problem? Download latest javacc source (master eb4455b) build javacc with ant
Build C++ JavaGrammar example
cd examples/JavaGrammars/cpp
make
Parse java file from HelloWorld.zip
./javaparser HelloWorld.java
Got several errors reported
error: 10
Expecting ; at: 7:35 but got (
Expecting } at: 7:35 but got (
Expecting } at: 7:35 but got (
Expecting EOF at: 7:35 but got (
Problem is with definition of JAVACC_CHAR_TYPE as char which is in C/C++ signed and comparision JAVACC_CHAR_TYPE in JavaParserTokenManager.cc else if (curChar < 128)
which is always true.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
C# Help reading foreign characters using StreamReader
The code below doesn't work, when the file values are read and shown in the datagrid the characters appear as squares, could there...
Read more >Programming/Parsing FAQs - Apache XML
Full international character support. Both utf-8 and utf-16 cover the full Unicode character set, which includes all of the characters from all major...
Read more >how to parse special characters in xml - elevateindy.org
XML processors parse these reserved characters since XML uses tree-like structures of tags and representing entities in a challenging task.
Read more >UTF-8 - Wikipedia
UTF-8 is a variable-length character encoding used for electronic communication. Defined by the Unicode Standard, the name is derived from Unicode (or ...
Read more >Regular expressions - JavaScript - MDN Web Docs
Regular expressions are patterns used to match character ... or a combination of simple and special characters, such as /ab*c/ or /Chapter ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, that’s me! 😃 I’m using the support alias for all things javacc-related.
Basically javacc tokenizer just gets an array of characters and works on them. So any decoding should happen outside - before it reaches the charstream. For example, in java you specify the encoding when you create the reader.On Oct 31, 2017 2:38 PM, zosrothko notifications@github.com wrote:“You are confusing between encoding and char type size. Javacc doesn’t care about encoding”… May be I missed something or misunderstood… Could you be more specific on this confusion?
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.