Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(53)

Issue 6203060: Reafactored Lexer class to allow chaining. The full chain when parsing #if directive looks like thi… (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 11 months ago by Alok Priyadarshi
Modified:
13 years, 11 months ago
Reviewers:
kbr1
CC:
angleproject-review_googlegroups.com
Base URL:
http://angleproject.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Reafactored Lexer class to allow chaining. The full chain when parsing #if directive looks like this: Preprocessor -> MacroExpander -> DirectiveHandler -> MacroExpander -> DefinedFilter -> Tokenizer. This chain dynamically changes depending on the current context. Also added an incomplete implementation of #if handling and ExpressionParser to illustrate how this design is supposed to work. Committed: https://code.google.com/p/angleproject/source/detail?r=1084

Patch Set 1 #

Patch Set 2 : #

Total comments: 5

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4819 lines, -307 lines) Patch
M src/build_angle.gyp View 1 2 1 chunk +7 lines, -2 lines 0 comments Download
A src/compiler/preprocessor/new/DirectiveParser.h View 1 2 1 chunk +47 lines, -0 lines 0 comments Download
A src/compiler/preprocessor/new/DirectiveParser.cpp View 1 2 1 chunk +224 lines, -0 lines 0 comments Download
M src/compiler/preprocessor/new/Lexer.h View 1 2 2 chunks +3 lines, -26 lines 0 comments Download
D src/compiler/preprocessor/new/Lexer.cpp View 1 chunk +0 lines, -33 lines 0 comments Download
A src/compiler/preprocessor/new/MacroExpander.h View 1 2 1 chunk +30 lines, -0 lines 0 comments Download
A src/compiler/preprocessor/new/MacroExpander.cpp View 1 chunk +23 lines, -0 lines 0 comments Download
M src/compiler/preprocessor/new/Preprocessor.h View 3 chunks +8 lines, -4 lines 0 comments Download
M src/compiler/preprocessor/new/Preprocessor.cpp View 1 2 1 chunk +10 lines, -9 lines 0 comments Download
M src/compiler/preprocessor/new/Token.h View 2 chunks +18 lines, -3 lines 0 comments Download
A src/compiler/preprocessor/new/Tokenizer.h View 1 2 1 chunk +49 lines, -0 lines 0 comments Download
A + src/compiler/preprocessor/new/Tokenizer.cpp View 1 chunk +2208 lines, -9 lines 0 comments Download
A + src/compiler/preprocessor/new/Tokenizer.l View 7 chunks +43 lines, -20 lines 0 comments Download
A src/compiler/preprocessor/new/directive_expression.cpp View 1 2 1 chunk +1897 lines, -0 lines 0 comments Download
A src/compiler/preprocessor/new/directive_expression.y View 1 2 1 chunk +243 lines, -0 lines 0 comments Download
M src/compiler/preprocessor/new/generate_parser.sh View 1 2 1 chunk +9 lines, -10 lines 0 comments Download
D src/compiler/preprocessor/new/pp.l View 1 chunk +0 lines, -191 lines 0 comments Download

Messages

Total messages: 4
Alok Priyadarshi
Sorry for the huge patch. I have marked files that have just been renamed. http://codereview.appspot.com/6203060/diff/2001/src/compiler/preprocessor/new/Tokenizer.h ...
13 years, 11 months ago (2012-05-09 20:52:37 UTC) #1
kbr1
LGTM after one cleanup. http://codereview.appspot.com/6203060/diff/2001/src/compiler/preprocessor/new/DirectiveParser.cpp File src/compiler/preprocessor/new/DirectiveParser.cpp (right): http://codereview.appspot.com/6203060/diff/2001/src/compiler/preprocessor/new/DirectiveParser.cpp#newcode44 src/compiler/preprocessor/new/DirectiveParser.cpp:44: if (token->type == '#') parseDirective(token); ...
13 years, 11 months ago (2012-05-09 21:04:14 UTC) #2
Alok Priyadarshi
http://codereview.appspot.com/6203060/diff/2001/src/compiler/preprocessor/new/DirectiveParser.cpp File src/compiler/preprocessor/new/DirectiveParser.cpp (right): http://codereview.appspot.com/6203060/diff/2001/src/compiler/preprocessor/new/DirectiveParser.cpp#newcode44 src/compiler/preprocessor/new/DirectiveParser.cpp:44: if (token->type == '#') parseDirective(token); On 2012/05/09 21:04:14, kbr1 ...
13 years, 11 months ago (2012-05-09 21:25:03 UTC) #3
kbr1
13 years, 11 months ago (2012-05-09 21:35:15 UTC) #4
http://codereview.appspot.com/6203060/diff/2001/src/compiler/preprocessor/new...
File src/compiler/preprocessor/new/DirectiveParser.cpp (right):

http://codereview.appspot.com/6203060/diff/2001/src/compiler/preprocessor/new...
src/compiler/preprocessor/new/DirectiveParser.cpp:44: if (token->type == '#')
parseDirective(token);
On 2012/05/09 21:25:03, Alok Priyadarshi wrote:
> I am not sure what defining character constants would accomplish? In fact I
find
> it clearer to use the actual character literals everywhere.

Leave this to your discretion in that case. Still think it would reduce the
possibility of typos if they were constants rather than literals.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b