rgfernandes / cpp-ripper Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/cpp-ripper
Automatically exported from code.google.com/p/cpp-ripper
What steps will reproduce the problem?
1. Parse something like "double a = 6.267e-002;"
What is the expected output? What do you see instead?
parsing exception occured while parsing 'literal' expected
'skip(ident_next_char^)' at line number 9, and character number 18
{6.26737614678093e-002, -6.21825704935264e-001, 4.38399455776503e-001 },
(error points at the "e" in the first floating point number above)
What version of the product are you using? On what operating system?
revision 5
Original issue reported on code.google.com by [email protected]
on 17 Nov 2009 at 6:14
What steps will reproduce the problem?
1. try to parse attached file.
What is the expected output? What do you see instead?
You can see an exception:
parsing exception occured while parsing 'literal' expected
'skip(ident_next_char^)' at
line number 0, and character number 13
enum a{ B = 0x1} C
^
What version of the product are you using? On what operating system?
sept-9-2009-source
Rootcause:
What is happening is, that the 0x1 hexadecimal value is parsed as an
octal_literal("0") and not as a hex_literal("0x1"). The cause is, that in the
place of unsigned_literal, the octal_literal is checked first, and that breaks
the compiler paradigm of searching the longest possible token string.
Proposed fix:
the simplest way to fix this issue is to re-arrange the parsing order from:
unsigned_literal
= decimal_literal
| octal_literal
| hex_literal;
to:
unsigned_literal
= decimal_literal
| hex_literal
| octal_literal;
this way the hex literal(which is always longer because of "0x" factor) will be
parsed before octal.
Original issue reported on code.google.com by [email protected]
on 15 Oct 2013 at 3:02
Attachments:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.