Changeset f980549 for src/Parser
- Timestamp:
- Sep 20, 2017, 12:24:45 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- b18830e
- Parents:
- 764e009 (diff), 47b5b63 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/Parser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
r764e009 rf980549 44 44 //############################################################################## 45 45 46 typedef CodeLocation YYLTYPE; 47 #define YYLTYPE_IS_DECLARED 1 /* alert the parser that we have our own definition */ 48 46 49 extern char * yyfilename; 47 50 extern int yylineno; 51 extern YYLTYPE yylloc; 48 52 49 53 class ParseNode { … … 73 77 ParseNode * next = nullptr; 74 78 std::string * name = nullptr; 75 CodeLocation location = { yyfilename, yylineno };79 CodeLocation location = yylloc; 76 80 }; // ParseNode 77 81 -
src/Parser/lex.ll
r764e009 rf980549 26 26 27 27 unsigned int column = 0; // position of the end of the last token parsed 28 #define YY_USER_ACTION column += yyleng; // trigger before each matching rule's action28 #define YY_USER_ACTION yylloc.first_line = yylineno; yylloc.first_column = column; column += yyleng; yylloc.last_column = column; yylloc.last_line = yylineno; yylloc.filename = yyfilename ? yyfilename : ""; // trigger before each matching rule's action 29 29 30 30 #include <string> -
src/Parser/parser.yy
r764e009 rf980549 116 116 117 117 bool forall = false; // aggregate have one or more forall qualifiers ? 118 119 # define YYLLOC_DEFAULT(Cur, Rhs, N) \ 120 do \ 121 if (N) { \ 122 (Cur).first_line = YYRHSLOC(Rhs, 1).first_line; \ 123 (Cur).first_column = YYRHSLOC(Rhs, 1).first_column; \ 124 (Cur).last_line = YYRHSLOC(Rhs, N).last_line; \ 125 (Cur).last_column = YYRHSLOC(Rhs, N).last_column; \ 126 (Cur).filename = YYRHSLOC(Rhs, 1).filename; \ 127 } else { \ 128 (Cur).first_line = (Cur).last_line = \ 129 YYRHSLOC(Rhs, 0).last_line; \ 130 (Cur).first_column = (Cur).last_column = \ 131 YYRHSLOC(Rhs, 0).last_column; \ 132 (Cur).filename = YYRHSLOC(Rhs, 0).filename; \ 133 } \ 134 while (0) 118 135 %} 119 136 … … 346 363 %precedence ELSE // token precedence for start of else clause in IF/WAITFOR statement 347 364 365 %locations 348 366 349 367 %start translation_unit // parse-tree root
Note: See TracChangeset
for help on using the changeset viewer.