[CALCITE-1788] Simplify handling of position in the parser

Add a new class, Span, a mutable builder for SqlParserPosition. It makes
it easier to keep track of the positions of all of the tokens and
non-terminals that are being reduced to a non-terminal.

Extension parsers may need to change "SqlParserPos pos" parameters to
"Span s".


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/d6193040
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/d6193040
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/d6193040

Branch: refs/heads/master
Commit: d619304070bf2874ab760c92ec2573ee6c19f536
Parents: 7d8e052
Author: Julian Hyde <[email protected]>
Authored: Fri May 12 16:18:55 2017 -0700
Committer: Julian Hyde <[email protected]>
Committed: Sun May 21 12:18:30 2017 -0700

----------------------------------------------------------------------
 core/src/main/codegen/templates/Parser.jj       | 4202 ++++++++----------
 .../calcite/rel/rel2sql/SqlImplementor.java     |    5 +-
 .../apache/calcite/sql/fun/SqlItemOperator.java |   10 +-
 .../org/apache/calcite/sql/parser/Span.java     |  154 +
 .../sql/parser/SqlAbstractParserImpl.java       |   23 +
 .../apache/calcite/sql/parser/SqlParserPos.java |   77 +-
 .../calcite/sql/validate/SqlValidatorImpl.java  |    3 +-
 core/src/test/codegen/includes/parserImpls.ftl  |    8 +-
 .../calcite/sql/parser/SqlParserTest.java       |    4 +-
 .../apache/calcite/test/SqlValidatorTest.java   |   18 +-
 piglet/src/main/javacc/PigletParser.jj          |    4 +-
 site/_docs/history.md                           |    6 +
 site/_docs/reference.md                         |    2 +-
 13 files changed, 2237 insertions(+), 2279 deletions(-)
----------------------------------------------------------------------


Reply via email to