Commit Graph

1169 Commits

Author SHA1 Message Date
Sam Harwell 589d6bf187 Remove field which hides another field with the same name; add check for this condition to OutputModelWalker 2012-07-18 16:06:33 -05:00
Sam Harwell 45815d97f7 Specifically test for the ModelElement annotation on fields (not just any annotation will do) 2012-07-18 16:06:32 -05:00
Terence Parr f220212a95 couldn't get Horstmann's routine to do EPS not PS so had to backtrack. 2012-07-14 16:32:04 -07:00
Terence Parr 22bb947019 Merge branch 'master' of github.com:antlr/antlr4 2012-07-14 15:41:42 -07:00
Terence Parr 47362b2951 use Horstmann's PS save not mine; it'll handle Japanese char etc.. this way. 2012-07-14 15:38:33 -07:00
Sam Harwell 96654531b7 Use isEmpty() instead of size()==0, specify generic arguments 2012-07-13 14:33:42 -05:00
Terence Parr 683b915507 rm prints 2012-07-12 13:25:41 -07:00
Terence Parr 4923cb3874 reorg r : '...' ; matching. deals with -> cmds better (and more of em) 2012-07-12 13:25:18 -07:00
Terence Parr de744f912a allow A : '<' -> skip ; style token name/literal aliases. 2012-07-12 12:25:12 -07:00
Terence Parr a3371ac9ea rm unneeded override. 2012-07-09 17:32:20 -07:00
Terence Parr 9738658126 rm unneeded code to set line/charpos 2012-07-09 17:32:03 -07:00
Terence Parr 9a4227841d -print -> -tree 2012-07-08 13:38:56 -07:00
Terence Parr 707ff615b4 tweak javadoc 2012-07-08 12:18:43 -07:00
Terence Parr 3b2c0a6177 fix bug in get hidden channel stuff. rewrote. update test. 2012-07-07 18:48:48 -07:00
Terence Parr ec47251bb2 unbuffered release() can get markers in weird order since we reset p to beginning of buffer. Might mark at 1 and then at release p = 0 etc... Don't look for errors. Just reset earliestMarker if needed. 2012-07-04 11:32:41 -07:00
Terence Parr 00808ef11f off by 1 error. 2012-07-03 13:44:44 -07:00
Terence Parr d0e7e79b2b make sure tokenNames puts tokens at right spot; didn't handle wholes in token type sequence. 2012-07-03 13:37:43 -07:00
Terence Parr 9455f5cd30 bug fix; .tokens didn't allow ' ' or 'a b'. 2012-07-03 13:15:35 -07:00
Terence Parr 2e9c449ec4 fix a few tests 2012-07-03 12:42:10 -07:00
Terence Parr 1d9aef0a5e replace .tokens file parser with regex to avoid \t becoming tab char. 2012-07-03 12:40:36 -07:00
Terence Parr 6b6274b0c8 add type narrowed getters 2012-07-02 15:48:45 -07:00
Terence Parr 71bd16020f Merge branch 'master' into nogenerics-in-error-listener-2nd-try 2012-07-02 12:45:48 -07:00
Terence Parr 111c44b3fd add default ctor to Lexer 2012-07-02 12:45:30 -07:00
Terence Parr 4329f00186 Merge branch 'master' into nogenerics-in-error-listener-2nd-try 2012-07-02 12:19:51 -07:00
Terence Parr ae7313f36a factor out input.read() and make ctor for easy subclass. 2012-07-02 12:19:20 -07:00
Terence Parr 3ad87ba12c rm generic parameter from ANTLRErrorListener, ripple effect. 2012-07-01 22:34:35 -07:00
Terence Parr bb5790d6a9 Add convenience method. 2012-07-01 17:36:22 -07:00
Terence Parr 37396d6040 clean up 2012-07-01 12:20:54 -07:00
Terence Parr db66257d7e cleanup so Lexer lets us subclass to support multiple token emit()s per lex rule match. 2012-07-01 12:19:44 -07:00
Terence Parr 0b4fa240c5 alter comment 2012-07-01 10:55:31 -07:00
Terence Parr 6053ac5269 rm gunit; hmm...my commits are wacked on this/last one. sorry! 2012-07-01 09:45:35 -07:00
Terence Parr f80166b39c Rewrote the unbuffered token stream to use a type-adjusted version of the unbuffered character stream. Simpler and I get to remove fast queue and lookahead string classes. These unbuffered streams always prime the pump with the 1st single.
Added a unit test for the unbuffered token stream.

Made sure that the unbuffered streams move forward always on a consume

Removed the reset method from the unbuffered streams because it's meaningless to reset to the beginning of the buffer.
2012-07-01 09:39:11 -07:00
Terence Parr 5c69d31e88 CommonTokenFactory now knows how to copy the text out of the character stream buffer before they disappear in unbuffered character strengths; added ctor.
Lexer now guarantees that the text of the current token is always available to the emit() method even if the character stream is unbuffered.

Added some hooks to see some of the internal data in the unbuffered character stream so that I can test it better.

Updated LexerInterpreter so that it uses the token factory.

Improved/added unit tests for the unbuffered character string.

Updated various comments
2012-06-30 16:40:16 -07:00
Terence Parr 44355d6ff6 oops; don't need these afterall 2012-06-30 16:36:25 -07:00
Terence Parr 3900606024 no need for range field. removed. overrirde tostring so nothing weird comes out. 2012-06-30 16:36:01 -07:00
Terence Parr 0c22d12870 updated comments, remove duplicate code, add new functionality. 2012-06-29 13:02:44 -07:00
Terence Parr e861902a10 set hidden channel num to 1 not 99. default is chan 0 2012-06-29 12:03:54 -07:00
Terence Parr f396b4dc82 error->syntaxError in listener 2012-06-25 13:25:13 -07:00
Terence Parr 740208ee4d test code. 2012-06-17 16:56:26 -07:00
Terence Parr b18475113b Merge branch 'master' into interactive 2012-06-16 17:20:04 -07:00
Terence Parr bfc90d473c fix help msg slightly. 2012-06-13 12:42:21 -07:00
Terence Parr 13d9f6ed53 add comment 2012-06-08 17:04:46 -07:00
Terence Parr abc0e2ef87 add getSpeculativeText(); text matched so far in a lexer rule. Use this in predicates not actions. add unit tests. 2012-06-07 18:31:36 -07:00
Terence Parr 018e3c03e8 look for T not just TLexer if no parser just tokens. 2012-06-07 18:27:42 -07:00
Terence Parr b255509e96 fix a bug related to semantic predicates in the lexer and generally cleaned up variable and method names in the simulator. I moved all of the predicates to the right side of lexer rules in the unit tests. Later, we should ensure that predicates only occur on the right edge of lexer rules. We should state that the rule is not been accepted so we can't test things like getText(), we have to use more raw indexes into the character stream. In the lexer simulator, the addDFAState() method now does not try to compute whether there is a predicate in the configurations. That information has already been set into the ATNConfigSet by the getEpsilonTarget() method. [I should also point out that I have not tested the Java parsing in a while and now it hits a landmine on a number of common Java files in jdk :(. I'm not sure where that crept in] 2012-06-07 17:31:18 -07:00
Terence Parr d3c238569f fix unit test. 2012-06-06 15:44:10 -07:00
Terence Parr 5a2197a74d fix bug where X : 'x' {pred}? ; wasn't seen as alias from X to 'x'. 2012-06-02 11:44:27 -07:00
Terence Parr 7192cc9a68 rm deadcode 2012-06-02 11:44:01 -07:00
Terence Parr e1524fe86c add test 2012-06-02 11:28:25 -07:00
Terence Parr 0e9bcfbeca change in token type broke many tests; fixed. says 5 failures now. 2012-06-02 11:26:18 -07:00