You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jh...@apache.org on 2015/09/03 00:16:22 UTC
[34/50] incubator-calcite git commit: [CALCITE-805] Add support for
using an alternative grammar specification for left and right curly braces.
Additionally, add support for including addition token manager declarations.
[CALCITE-805] Add support for using an alternative grammar specification for left and right curly braces. Additionally, add support for including addition token manager declarations.
Project: http://git-wip-us.apache.org/repos/asf/incubator-calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/5cb95e64
Tree: http://git-wip-us.apache.org/repos/asf/incubator-calcite/tree/5cb95e64
Diff: http://git-wip-us.apache.org/repos/asf/incubator-calcite/diff/5cb95e64
Branch: refs/heads/branch-release
Commit: 5cb95e644f38da1a13d6def96eeec935b650289c
Parents: e0a4230
Author: Jacques Nadeau <ja...@apache.org>
Authored: Fri Jul 24 16:38:18 2015 -0700
Committer: Jacques Nadeau <ja...@apache.org>
Committed: Fri Jul 24 18:49:36 2015 -0700
----------------------------------------------------------------------
core/src/main/codegen/config.fmpp | 2 ++
core/src/main/codegen/templates/Parser.jj | 8 ++++++++
2 files changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/5cb95e64/core/src/main/codegen/config.fmpp
----------------------------------------------------------------------
diff --git a/core/src/main/codegen/config.fmpp b/core/src/main/codegen/config.fmpp
index d480488..80276c4 100644
--- a/core/src/main/codegen/config.fmpp
+++ b/core/src/main/codegen/config.fmpp
@@ -74,6 +74,8 @@ data: {
]
includeCompoundIdentifier: true
+ includeBraces: true
+ includeAdditionalDeclarations: false
}
}
http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/5cb95e64/core/src/main/codegen/templates/Parser.jj
----------------------------------------------------------------------
diff --git a/core/src/main/codegen/templates/Parser.jj b/core/src/main/codegen/templates/Parser.jj
index 36f9e05..231c03d 100644
--- a/core/src/main/codegen/templates/Parser.jj
+++ b/core/src/main/codegen/templates/Parser.jj
@@ -5382,12 +5382,16 @@ String CommonNonReservedKeyWord() :
{
< LPAREN: "(">
| < RPAREN: ")">
+ <#if parser.includeBraces >
| < LBRACE_D: "{" (" ")* ["d","D"] >
| < LBRACE_T: "{" (" ")* ["t","T"] >
| < LBRACE_TS: "{" (" ")* ["t","T"] ["s","S"] >
| < LBRACE_FN: "{" (" ")* ["f","F"] ["n","N"] >
| < LBRACE: "{" >
| < RBRACE: "}" >
+ <#else>
+ <#include "/@includes/braces.ftl" />
+ </#if>
| < LBRACKET: "[" >
| < RBRACKET: "]" >
| < SEMICOLON: ";" >
@@ -5432,6 +5436,10 @@ TOKEN_MGR_DECLS : {
void popState() {
SwitchTo(lexicalStateStack.remove(lexicalStateStack.size() - 1));
}
+
+ <#if parser.includeAdditionalDeclarations>
+ <#include "/@includes/tokenManagerDeclarations.ftl" />
+ </#if>
}
/*