Commit Graph

1579 Commits

Author SHA1 Message Date
Sam Harwell 59b3a05a05 warning 108 for "token name foo is already defined" 2012-10-28 16:58:49 -05:00
Sam Harwell b879d508ee Fix generated alt numbers for non-greedy quantifiers 2012-10-28 16:45:45 -05:00
Sam Harwell 4d2df41cdb Format and document the 'state' template to improve readability 2012-10-28 16:42:23 -05:00
Sam Harwell 85e2802d66 Use a group file instead of loose templates (easier to understand the interactions) 2012-10-28 11:24:08 -05:00
Sam Harwell 4adef1e455 Output from -atn flag shows the order of outgoing edges from decision states. 2012-10-28 11:17:39 -05:00
Sam Harwell 950f588ac0 Fix implementations: TokenStream interface says getText method returns non-null 2012-10-28 10:04:34 -05:00
Terence Parr bd0868c305 Merge branch 'action-init' of github.com:sharwell/antlr4 2012-10-26 17:37:45 -07:00
Sam Harwell f4a3d6f3a8 Move initialization of finallyAction to fillNamedActions - factory cannot provide context information for the Action construction before the constructor completes 2012-10-26 15:46:22 -05:00
Sam Harwell e89807e350 Add non-greedy quantifier syntax: greedy forms are *, +, ?, and non-greedy forms are *?, +?, ??
"greedy" is no longer a block option, and all loops are greedy unless the non-greedy quantifier is explicitly used
Add warning 131 when .* is used, because they probably intended to use the non-greedy form .*?
2012-10-26 15:40:05 -05:00
Sam Harwell 8494007025 Add regression test for antlr/antlr4#26 (an exception upon simple rule with double recursion in an alternative) 2012-10-25 21:45:03 -05:00
Sam Harwell 5a5f56e91c Add unit test for antlr/antlr4#25 (currently fails because the underlying problem hasn't been fixed) 2012-10-25 21:35:19 -05:00
Sam Harwell 73c6ce5c7e CIRCULAR_DEPENDENCY error number changed to 200 to make room for expanding the set of grammar errors 2012-10-25 21:34:24 -05:00
Sam Harwell bfc395d23b Add regression test for antlr/antlr4#19 (getter for context is not a list when it should be) 2012-10-25 18:03:03 -05:00
Sam Harwell 514a1500ea Add regression test for antlr/antlr4#6 (NullPointerException in getMissingSymbol) 2012-10-25 17:42:09 -05:00
Terence Parr d5341b55af Merge branch 'encapsulation' of git://github.com/sharwell/antlr4 2012-10-24 12:59:46 -07:00
Terence Parr b89445e861 Merge branch 'maven-update' of git://github.com/sharwell/antlr4 2012-10-24 12:58:52 -07:00
Terence Parr cb0f5c0e51 Merge branch 'parsecancellationexception' of git://github.com/sharwell/antlr4 2012-10-24 12:58:26 -07:00
Terence Parr 31c9fc33f1 Merge branch 'ordered-configs' of git://github.com/sharwell/antlr4 2012-10-24 10:51:56 -07:00
Terence Parr 4f918f75bc Merge branch 'get-reachable-target' of git://github.com/sharwell/antlr4 2012-10-24 10:41:46 -07:00
Sam Harwell a80a6022ff Update pom.xml 2012-10-22 12:19:24 -05:00
Sam Harwell bb44db6397 Create a new ParseCancellationException for BailErrorStrategy. Derived from RuntimeException so existing handlers will still work. 2012-10-22 12:12:39 -05:00
Sam Harwell 36c63db299 Remove redundant casts, encapsulate fields in RecognitionException 2012-10-22 09:52:55 -05:00
Sam Harwell 4790ab76e1 Encapsulate fields in NoViableAltException and LexerNoViableAltException 2012-10-22 09:40:44 -05:00
Sam Harwell 1ae3c0104c Simplify FailedPredicateException constructors, encapsulate fields 2012-10-22 09:18:29 -05:00
Sam Harwell 12b2c34946 Lexer uses strictly-ordered alternatives within a rule. Simplifies code, increases performance when non-terminal (lexer rules) depth is limited, and actually fixes non-greedy behavior 2012-10-21 22:04:38 -05:00
Terence Parr ed7d4b1dc1 fail option on predicates work. 2012-10-20 15:57:06 -07:00
Terence Parr d96e02019a working towards b3 2012-10-20 13:59:57 -07:00
Terence Parr ab6b341942 a few tweaks/comments. 2012-10-20 12:51:36 -07:00
Terence Parr d996b5c8c7 update change log 2012-10-20 12:15:43 -07:00
Sam Harwell 52f1d3b6e5 Simplify getReachableTarget 2012-10-16 08:04:42 -05:00
Sam Harwell 1af9b4c338 Simplify and document non-greedy behavior in processAcceptConfigs 2012-10-16 08:01:46 -05:00
Sam Harwell fb87e4c785 Another fix for non-greedy with closures 2012-10-16 07:53:23 -05:00
Sam Harwell f9a63b8810 Fix bug in PredictionContext.arrayMerge 2012-10-15 14:57:06 -05:00
Sam Harwell c737baf20c Add several unit tests for greedy/non-greedy behavior in lexer 2012-10-15 14:37:23 -05:00
Sam Harwell 6fa853c14f Fixes to LexerATNSimulator.closure, fixes to non-greedy positive closure 2012-10-15 02:01:07 -05:00
Sam Harwell a40073a8cc Merge remote-tracking branch 'antlr/master' into non-greedy 2012-10-15 01:58:15 -05:00
Sam Harwell bbe77782db Fix state checking in new non-greedy handling 2012-10-15 00:56:25 -05:00
Sam Harwell d738949ccd Fix testOptional and testNoViableAltAvoidance 2012-10-14 22:41:18 -05:00
Sam Harwell aa2223cd6a Fix assertion in PredictionContext.mergeArrays 2012-10-14 22:40:34 -05:00
Sam Harwell 7c221f13ed Unify EMPTY_FULL_CTX_INVOKING_STATE and EMPTY_INVOKING_STATE (fixes an array indexing error during closure) 2012-10-14 22:25:11 -05:00
Sam Harwell 30b5e2c6be Fix greedy tests behaving as non-greedy in TestATNLexerInterpreter 2012-10-14 21:46:59 -05:00
Sam Harwell b0a4200a08 Allow greedy option for blocks in both lexer and parser 2012-10-14 21:46:58 -05:00
Sam Harwell 025cc6187a Fix handling of non-greedy blocks in the lexer (uses regex-style non-greedy with unordered alternatives) 2012-10-14 21:46:57 -05:00
Sam Harwell 28b243cda5 BlockEndState links to start state for each block in the ATN (constructed during deserialization) 2012-10-14 21:45:35 -05:00
Sam Harwell 0d30a7a60b Add ATN representation for non-greedy decisions 2012-10-14 21:45:34 -05:00
Sam Harwell 9ea072aee0 Uniform handling of non-greedy decisions in ATN factory 2012-10-14 21:45:33 -05:00
Sam Harwell 39c73302f6 Explicit greedy option overrides implicit greedy option 2012-10-14 21:45:32 -05:00
Sam Harwell 65793adfc8 Fix detection of unsupported block options 2012-10-14 21:45:31 -05:00
Sam Harwell 850fe5b9c2 Make sure to serialize/deserialize the ATN before using the interpreter since the runtime alters the ATN on load 2012-10-14 21:45:31 -05:00
Sam Harwell b3b1a3750d Allow optionsSpec at the beginning of a lexer block 2012-10-14 21:45:30 -05:00