Commit Graph

1142 Commits

Author SHA1 Message Date
Terence Parr fb63c9927e tweak comment 2012-11-18 09:12:30 -08:00
Terence Parr afe2224881 wasn't checking soon enough for rule redef; now it sets a dead flag in
AST so no more walking dup.
  error(51): T.g:7:0: rule s redefinition (ignoring); previous at line 3
2012-11-18 09:07:30 -08:00
Terence Parr 6a345316df if labels, don't allow set collapse for
a : A # X | B ;
2012-11-17 18:06:23 -08:00
Terence Parr 80b1fa7acb properly check for grammar/filename difference 2012-11-17 17:24:13 -08:00
Terence Parr 8631c143da add check for command placement in lexer rules 2012-11-17 17:03:29 -08:00
Terence Parr 9d34d4d3c9 forgot a case for actions in lexer rules. 2012-11-17 17:00:11 -08:00
Terence Parr e86f89724f added check: action in lexer rules must be last element of outermost alt 2012-11-17 16:50:38 -08:00
Terence Parr 5e519d0063 playground tweaks 2012-11-17 16:27:10 -08:00
Terence Parr b1a3370934 .tokens files goes in output dir like parser file. 2012-11-17 16:25:51 -08:00
Terence Parr 78c75ee5e4 add comment showing snippet to fix unit test, allowing SLL to avoid LL with preds. 2012-11-17 13:44:33 -08:00
Terence Parr 40e95ea5e9 Merge branch 'lexer-block-ref' of git://github.com/sharwell/antlr4 2012-11-15 13:01:41 -08:00
Terence Parr a69ccb3c70 Merge branch 'token-stream-bugs' of git://github.com/sharwell/antlr4 2012-11-15 12:55:32 -08:00
Sam Harwell 18f5354d1b Merge branch 'master' into token-stream-bugs 2012-11-14 15:07:33 -06:00
Sam Harwell 92ae0f0fa6 Merge branch 'recognizer-local-state' 2012-11-14 14:40:56 -06:00
Sam Harwell 9fe197e5b8 Fix rule reference should have been to lexerBlock 2012-11-14 13:06:35 -06:00
Terence Parr fdf3a86969 Merge branch 'implicit-labels' of https://github.com/sharwell/antlr4 2012-11-13 17:08:43 -08:00
Sam Harwell 5db5c3393d TestPositionAdjustingLexer 2012-11-13 13:31:46 -06:00
Sam Harwell 751b063cae Improved accuracy of implicit label analysis within alternatives 2012-11-12 13:50:15 -06:00
Sam Harwell 1b08a014d2 Update GrammarTreeVisitor to include an ANTLR 4-style listener interface 2012-11-12 13:47:46 -06:00
Sam Harwell 05fb538304 Since ASTLabelType=GrammarAST, construct CommonTreeNodeStream with GrammarASTAdaptor to make sure UP/DOWN nodes cannot result in a ClassCastException 2012-11-12 13:41:26 -06:00
Sam Harwell 669f676c55 Updated NetBeans code style for ANTLR and StringTemplate file types 2012-11-12 13:37:50 -06:00
Terence Parr 328dedd778 change version 2012-11-11 10:41:04 -08:00
Sam Harwell 94c33074be Avoid unnecessary call to TokenStream.LT 2012-11-11 11:37:28 -06:00
Terence Parr 64a5be0675 nongreedy decisions can't be LL(1) 2012-11-04 12:06:36 -08:00
Sam Harwell ead9258da3 Fix test name 2012-11-04 13:35:10 -06:00
Sam Harwell a62775c4ba Updated unit tests to reflect new expectations for parser EOF handling 2012-11-04 13:25:26 -06:00
Terence Parr a5016b60f9 nongreedy decisions can't be LL(1) 2012-11-04 10:37:25 -08:00
Terence Parr c073835186 Merge branch 'lexer-recover-eof' of github.com:sharwell/antlr4 2012-11-04 09:35:28 -08:00
Terence Parr f8ec86edd7 rm err 'no wildcard in parser' 2012-11-04 09:34:14 -08:00
Sam Harwell 0903370117 Add unit tests where lexer error recovery consumes to EOF 2012-11-04 11:30:03 -06:00
Sam Harwell cf5bf7c384 Add testPredicatedKeywords 2012-11-03 15:47:15 -05:00
Sam Harwell b6653293df Tweak comment 2012-11-03 14:07:47 -05:00
Terence Parr baa4dcf1b9 +? works, had bad input 2012-11-03 11:01:23 -07:00
Terence Parr c8a9ed6d30 added unit test 2012-11-03 10:57:16 -07:00
Terence Parr a9d4aeab71 no ? extends on rule ctx getters. 2012-11-03 08:57:49 -07:00
Terence Parr 8c4edb8fba clean playground 2012-11-03 08:53:26 -07:00
Terence Parr 675776267f foo 2012-11-03 08:47:32 -07:00
Sam Harwell d220f90d3b Remove generics from all runtime code which did not use them to provide type safety 2012-11-01 18:07:12 -05:00
Sam Harwell 3470978749 Updated naming conventions since RuleContext stores invoking states but PredictionContext stores return states 2012-11-01 13:47:44 -05:00
Sam Harwell 2ce42f46f8 Check for null 2012-11-01 11:01:48 -05:00
Sam Harwell 9b1741c90e Detect labels on blocks which are not sets (and report an error) 2012-11-01 11:01:37 -05:00
Sam Harwell 01f8716ec4 Fix BasicSemanticCheck to check for token names that do not start with an uppercase letter 2012-11-01 08:55:07 -05:00
Sam Harwell adee7ffd8f Fix expected unit test results 2012-11-01 08:52:39 -05:00
Sam Harwell 5a519b9222 Ignore tests that fail but aren't critical and got deferred 2012-11-01 08:48:26 -05:00
Sam Harwell 0446c91280 Use junit 4 API 2012-11-01 08:46:56 -05:00
Sam Harwell 3278997a89 Move lexer predicates test to TestSemPredEvalLexer 2012-10-31 21:52:51 -05:00
Sam Harwell 05363cd5ef Fix tests in TestSemPredEvalLexer 2012-10-31 21:52:51 -05:00
Sam Harwell d748271816 Remove getSpeculativeText since getText works again 2012-10-31 21:52:50 -05:00
Terence Parr a0dd1b4018 Merge branch 'test-performance-features' of git://github.com/sharwell/antlr4 2012-10-31 17:39:14 -07:00
Terence Parr fca4710004 alter tests 2012-10-31 12:46:11 -07:00
Sam Harwell bd121facef Add the COMPUTE_CHECKSUM option to TestPerformance 2012-10-30 17:49:51 -05:00
Sam Harwell a96e7a2e70 Added many new features and flags to TestPerformance 2012-10-30 17:10:42 -05:00
Sam Harwell 5924d3f935 Corrections to Java grammars used by TestPerformance 2012-10-30 16:39:12 -05:00
Sam Harwell efa9ea7811 Simplify LexerATNSimulator to reduce duplicate code (duplicate instruction executions and duplicated code blocks) 2012-10-30 09:24:03 -05:00
Sam Harwell 1e5cfb4a1e Add unit test for behavior of lexer with input-position-sensitive predicates 2012-10-30 08:46:02 -05:00
Sam Harwell 13e940b1db Fix error messages not shown if invoke(...) throws InvocationTargetException 2012-10-30 08:35:00 -05:00
Sam Harwell 6db106855f Fix Java test grammars 2012-10-30 08:34:04 -05:00
Terence Parr a115490d5e Merge branch 'warnings-as-errors' of git://github.com/sharwell/antlr4 2012-10-29 11:27:46 -07:00
Sam Harwell 871db85ecb Add field DecisionState.nonGreedy, computed in tool and serialized as one bit in the state type field 2012-10-29 13:14:50 -05:00
Sam Harwell 94d3de748e Unit tests for ('a' | 'ab') in lexers 2012-10-29 13:14:34 -05:00
Sam Harwell 37425b70d0 Subtle whitespace changes in Java.stg reduces size of generated code without hurting legibility 2012-10-28 17:16:37 -05:00
Sam Harwell 25c5802ba4 Use suggested v4 syntax in unit tests 2012-10-28 17:11:36 -05:00
Sam Harwell 55c1652fcd Unit tests for parser greedy/non-greedy 2012-10-28 17:11:02 -05:00
Sam Harwell f46d06aec6 Fix testA, testB, and testE in TestSymbolIssues 2012-10-28 16:59:40 -05:00
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 b89445e861 Merge branch 'maven-update' of git://github.com/sharwell/antlr4 2012-10-24 12:58:52 -07:00
Sam Harwell a80a6022ff Update pom.xml 2012-10-22 12:19:24 -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
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 a40073a8cc Merge remote-tracking branch 'antlr/master' into non-greedy 2012-10-15 01:58:15 -05:00
Sam Harwell d738949ccd Fix testOptional and testNoViableAltAvoidance 2012-10-14 22:41:18 -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 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
Terence Parr 75a01636d0 got ambiguity reporting set right I think. fixed unit tests to force exact ambig detection. 2012-10-14 18:42:43 -07:00
Terence Parr 01bbce6952 full LL is always correct now, if slower. Stops prediction when resolvesToJustOneViableAlt(). SLL always uses heuristic 2012-10-14 13:25:34 -07:00
Terence Parr e7ece0e90a got fast prediction termination with exactAmbig option that forces ANTLR to scan ahead until it identifies the true ambiguity. 2012-10-13 18:12:33 -07:00
Terence Parr ec32b71761 another unit test 2012-10-13 15:48:58 -07:00