Sam Harwell
885f6530ad
Use chained calls to append instead of string concatenation
2012-07-20 14:52:49 -05:00
Sam Harwell
6259ab5c9e
Use StringBuilder instead of StringBuffer
2012-07-20 14:52:48 -05:00
Sam Harwell
2056e019a5
Use HashMap instead of Hashtable
2012-07-20 14:52:47 -05:00
Sam Harwell
44ef41ff29
Remove unnecessary variable initializations
2012-07-20 14:52:46 -05:00
Sam Harwell
6045bd4eb5
Add null check
2012-07-20 14:52:45 -05:00
Sam Harwell
84e1025801
Remove extraneous ';' (empty statement), remove unnecessary null checks and dead code
2012-07-20 14:52:44 -05:00
Sam Harwell
3b9940b02a
Use isEmpty() instead of comparing size() with 0
2012-07-20 14:52:43 -05:00
Sam Harwell
4c4f767d17
Prevent NPE after reporting error
2012-07-20 14:52:13 -05:00
Sam Harwell
4c1e9b4119
Improve performance of equals
2012-07-20 14:51:55 -05:00
Sam Harwell
3a35f3cb08
Check object type in equals
2012-07-20 14:51:53 -05:00
Sam Harwell
8b4a461262
Merge branch 'ModelElement'
2012-07-18 16:14:14 -05:00
Sam Harwell
29d71acef9
Update documentation
2012-07-18 16:12:37 -05:00
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
Sam Harwell
a37f8cf4f1
Add missing license notices
2012-07-18 15:57:48 -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
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
9738658126
rm unneeded code to set line/charpos
2012-07-09 17:32:03 -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
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
3ad87ba12c
rm generic parameter from ANTLRErrorListener, ripple effect.
2012-07-01 22:34:35 -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
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
0c22d12870
updated comments, remove duplicate code, add new functionality.
2012-06-29 13:02:44 -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
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
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
Terence Parr
5a2fe297e3
ack. more cleanup work will be required for change of token types from 3..n to 1..n
2012-06-01 18:08:00 -07:00
Terence Parr
8481979f69
rename method
2012-06-01 18:06:48 -07:00
Terence Parr
94071d7d82
prevent negative indexes
2012-06-01 17:36:21 -07:00
Terence Parr
de83aacb65
add unit test
2012-05-31 17:02:15 -07:00
Terence Parr
3b1d91e010
fix unit tests
2012-05-24 13:08:15 -07:00
Terence Parr
6539c5f464
remove inappropriate attributes of lexer rules
2012-05-24 13:07:43 -07:00
Terence Parr
cd82465830
updated [...] parser so it handles < > and [ ] properly. no escapes now.
2012-05-23 12:48:07 -07:00