summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/parser/bounded_token_buffer.h5
-rw-r--r--src/parser/cvc/Cvc.g4
-rw-r--r--src/parser/smt/Smt.g4
-rw-r--r--src/parser/smt2/Smt2.g4
4 files changed, 11 insertions, 6 deletions
diff --git a/src/parser/bounded_token_buffer.h b/src/parser/bounded_token_buffer.h
index fad5edc1e..a29462687 100644
--- a/src/parser/bounded_token_buffer.h
+++ b/src/parser/bounded_token_buffer.h
@@ -18,6 +18,11 @@
** an exception. Only use this factory if you *know* that the grammar
** has bounded lookahead (e.g., if you've set the k parameter in the
** parser.
+ **
+ ** NOTE: ANTLR3 puts "hidden" tokens into this buffer too, so
+ ** pathological inputs can exceed the k token lookahead, even if
+ ** your grammar really is LL(k). Be sure that irrelevant tokens
+ ** are SKIP()'d and not "hidden".
**/
#ifndef __CVC4__PARSER__BOUNDED_TOKEN_BUFFER_H
diff --git a/src/parser/cvc/Cvc.g b/src/parser/cvc/Cvc.g
index 979f2a7c3..8fa1ca55a 100644
--- a/src/parser/cvc/Cvc.g
+++ b/src/parser/cvc/Cvc.g
@@ -555,10 +555,10 @@ fragment DIGIT : '0'..'9';
/**
* Matches and skips whitespace in the input and ignores it.
*/
-WHITESPACE : (' ' | '\t' | '\f' | '\r' | '\n') { $channel = HIDDEN;; };
+WHITESPACE : (' ' | '\t' | '\f' | '\r' | '\n')+ { SKIP();; };
/**
* Matches the comments and ignores them
*/
-COMMENT : '%' (~('\n' | '\r'))* { $channel = HIDDEN;; };
+COMMENT : '%' (~('\n' | '\r'))* { SKIP();; };
diff --git a/src/parser/smt/Smt.g b/src/parser/smt/Smt.g
index 8bbbbe0be..f125826d3 100644
--- a/src/parser/smt/Smt.g
+++ b/src/parser/smt/Smt.g
@@ -646,7 +646,7 @@ USER_VALUE
* Matches and skips whitespace in the input.
*/
WHITESPACE
- : (' ' | '\t' | '\f' | '\r' | '\n')+ { $channel = HIDDEN;; }
+ : (' ' | '\t' | '\f' | '\r' | '\n')+ { SKIP();; }
;
/**
@@ -672,7 +672,7 @@ STRING_LITERAL
* Matches the comments and ignores them
*/
COMMENT
- : ';' (~('\n' | '\r'))* { $channel = HIDDEN;; }
+ : ';' (~('\n' | '\r'))* { SKIP();; }
;
diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g
index f549d2148..705eee4d4 100644
--- a/src/parser/smt2/Smt2.g
+++ b/src/parser/smt2/Smt2.g
@@ -661,7 +661,7 @@ fragment SIMPLE_SYMBOL
* Matches and skips whitespace in the input.
*/
WHITESPACE
- : (' ' | '\t' | '\f' | '\r' | '\n')+ { $channel = HIDDEN; }
+ : (' ' | '\t' | '\f' | '\r' | '\n')+ { SKIP(); }
;
/**
@@ -727,7 +727,7 @@ STRING_LITERAL
* Matches the comments and ignores them
*/
COMMENT
- : ';' (~('\n' | '\r'))* { $channel = HIDDEN; }
+ : ';' (~('\n' | '\r'))* { SKIP(); }
;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback