/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package openbook.tools.parser;
// $ANTLR 3.2 Sep 23, 2009 12:02:23 Java.g 2010-05-15 01:06:37
import java.io.IOException;
import java.util.HashMap;
import org.antlr.runtime.BaseRecognizer;
import org.antlr.runtime.BitSet;
import org.antlr.runtime.DFA;
import org.antlr.runtime.EarlyExitException;
import org.antlr.runtime.FailedPredicateException;
import org.antlr.runtime.IntStream;
import org.antlr.runtime.MismatchedSetException;
import org.antlr.runtime.NoViableAltException;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.RecognizerSharedState;
import org.antlr.runtime.Token;
import org.antlr.runtime.TokenStream;
import org.antlr.runtime.debug.DebugEventListener;
import org.antlr.runtime.debug.DebugEventSocketProxy;
import org.antlr.runtime.debug.DebugParser;
/** A Java 1.5 grammar for ANTLR v3 derived from the spec
*
* This is a very close representation of the spec; the changes
* are comestic (remove left recursion) and also fixes (the spec
* isn't exactly perfect). I have run this on the 1.4.2 source
* and some nasty looking enums from 1.5, but have not really
* tested for 1.5 compatibility.
*
* I built this with: java -Xmx100M org.antlr.Tool java.g
* and got two errors that are ok (for now):
* java.g:691:9: Decision can match input such as
* "'0'..'9'{'E', 'e'}{'+', '-'}'0'..'9'{'D', 'F', 'd', 'f'}"
* using multiple alternatives: 3, 4
* As a result, alternative(s) 4 were disabled for that input
* java.g:734:35: Decision can match input such as "{'$', 'A'..'Z',
* '_', 'a'..'z', '\u00C0'..'\u00D6', '\u00D8'..'\u00F6',
* '\u00F8'..'\u1FFF', '\u3040'..'\u318F', '\u3300'..'\u337F',
* '\u3400'..'\u3D2D', '\u4E00'..'\u9FFF', '\uF900'..'\uFAFF'}"
* using multiple alternatives: 1, 2
* As a result, alternative(s) 2 were disabled for that input
*
* You can turn enum on/off as a keyword :)
*
* Version 1.0 -- initial release July 5, 2006 (requires 3.0b2 or higher)
*
* Primary author: Terence Parr, July 2006
*
* Version 1.0.1 -- corrections by Koen Vanderkimpen & Marko van Dooren,
* October 25, 2006;
* fixed normalInterfaceDeclaration: now uses typeParameters instead
* of typeParameter (according to JLS, 3rd edition)
* fixed castExpression: no longer allows expression next to type
* (according to semantics in JLS, in contrast with syntax in JLS)
*
* Version 1.0.2 -- Terence Parr, Nov 27, 2006
* java spec I built this from had some bizarre for-loop control.
* Looked weird and so I looked elsewhere...Yep, it's messed up.
* simplified.
*
* Version 1.0.3 -- Chris Hogue, Feb 26, 2007
* Factored out an annotationName rule and used it in the annotation rule.
* Not sure why, but typeName wasn't recognizing references to inner
* annotations (e.g. @InterfaceName.InnerAnnotation())
* Factored out the elementValue section of an annotation reference. Created
* elementValuePair and elementValuePairs rules, then used them in the
* annotation rule. Allows it to recognize annotation references with
* multiple, comma separated attributes.
* Updated elementValueArrayInitializer so that it allows multiple elements.
* (It was only allowing 0 or 1 element).
* Updated localVariableDeclaration to allow annotations. Interestingly the JLS
* doesn't appear to indicate this is legal, but it does work as of at least
* JDK 1.5.0_06.
* Moved the Identifier portion of annotationTypeElementRest to annotationMethodRest.
* Because annotationConstantRest already references variableDeclarator which
* has the Identifier portion in it, the parser would fail on constants in
* annotation definitions because it expected two identifiers.
* Added optional trailing ';' to the alternatives in annotationTypeElementRest.
* Wouldn't handle an inner interface that has a trailing ';'.
* Swapped the expression and type rule reference order in castExpression to
* make it check for genericized casts first. It was failing to recognize a
* statement like "Class<Byte> TYPE = (Class<Byte>)...;" because it was seeing
* 'Class<Byte' in the cast expression as a less than expression, then failing
* on the '>'.
* Changed createdName to use typeArguments instead of nonWildcardTypeArguments.
* Again, JLS doesn't seem to allow this, but java.lang.Class has an example of
* of this construct.
* Changed the 'this' alternative in primary to allow 'identifierSuffix' rather than
* just 'arguments'. The case it couldn't handle was a call to an explicit
* generic method invocation (e.g. this.<E>doSomething()). Using identifierSuffix
* may be overly aggressive--perhaps should create a more constrained thisSuffix rule?
*
* Version 1.0.4 -- Hiroaki Nakamura, May 3, 2007
*
* Fixed formalParameterDecls, localVariableDeclaration, forInit,
* and forVarControl to use variableModifier* not 'final'? (annotation)?
*
* Version 1.0.5 -- Terence, June 21, 2007
* --a[i].foo didn't work. Fixed unaryExpression
*
* Version 1.0.6 -- John Ridgway, March 17, 2008
* Made "assert" a switchable keyword like "enum".
* Fixed compilationUnit to disallow "annotation importDeclaration ...".
* Changed "Identifier ('.' Identifier)*" to "qualifiedName" in more
* places.
* Changed modifier* and/or variableModifier* to classOrInterfaceModifiers,
* modifiers or variableModifiers, as appropriate.
* Renamed "bound" to "typeBound" to better match language in the JLS.
* Added "memberDeclaration" which rewrites to methodDeclaration or
* fieldDeclaration and pulled type into memberDeclaration. So we parse
* type and then move on to decide whether we're dealing with a field
* or a method.
* Modified "constructorDeclaration" to use "constructorBody" instead of
* "methodBody". constructorBody starts with explicitConstructorInvocation,
* then goes on to blockStatement*. Pulling explicitConstructorInvocation
* out of expressions allowed me to simplify "primary".
* Changed variableDeclarator to simplify it.
* Changed type to use classOrInterfaceType, thus simplifying it; of course
* I then had to add classOrInterfaceType, but it is used in several
* places.
* Fixed annotations, old version allowed "@X(y,z)", which is illegal.
* Added optional comma to end of "elementValueArrayInitializer"; as per JLS.
* Changed annotationTypeElementRest to use normalClassDeclaration and
* normalInterfaceDeclaration rather than classDeclaration and
* interfaceDeclaration, thus getting rid of a couple of grammar ambiguities.
* Split localVariableDeclaration into localVariableDeclarationStatement
* (includes the terminating semi-colon) and localVariableDeclaration.
* This allowed me to use localVariableDeclaration in "forInit" clauses,
* simplifyi
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Apache OpenJPA是Jakarta Persistence API 3.0规范的实现 (5324个子文件)
RELEASE_STEPS.adoc 5KB
supportedJava8TimeTypes.adoc 2KB
credentials.apt 3KB
usage.apt 3KB
older_versions.apt 2KB
index.apt 2KB
index.apt 1KB
schema.apt 1KB
enhance.apt 1KB
testenhance.apt 1KB
sql.apt 1KB
mmg.bat 3KB
branchdiff.bat 2KB
rollback.bat 1KB
test.bat 940B
docit.bat 934B
status.bat 866B
OpenTrader.css 6KB
jest.css 5KB
docbook.css 4KB
openbooks.css 3KB
java.css 1KB
TestXMLCustomerOrder.db2 4KB
user.dict 224B
org.apache.openjpa.kernel.exps.ExpressionParser 843B
org.apache.openjpa.kernel.exps.ExpressionParser 825B
checkout.gif 849B
add-to-cart.gif 800B
login.gif 723B
login.gif 723B
logo.gif 623B
console_view.gif 582B
orders.gif 561B
start_task.gif 318B
.gitignore 131B
joins-constant.graffle 73KB
appid-hierarchy.graffle 30KB
string-rel-map.graffle 25KB
embedded-coll.graffle 25KB
inher-tpc.graffle 23KB
inv-key-coll.graffle 23KB
enhancement.graffle 21KB
secondary-table.graffle 21KB
basic-coll.graffle 21KB
sqlquery-model.graffle 21KB
inher-superclass-table.graffle 20KB
verify.groovy 862B
RELEASE-NOTES.html 19KB
jest.html 18KB
index.html 7KB
README.html 5KB
index.html 4KB
package.html 3KB
OpenTrader.html 2KB
fetch-plan.html 2KB
main.html 2KB
query.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1000B
MarketData.html 995B
package.html 994B
package.html 988B
entity-name.html 986B
package.html 985B
package.html 973B
package.html 973B
package.html 972B
response-format.html 965B
package.html 962B
package.html 961B
package.html 945B
package.html 942B
package.html 937B
package.html 937B
package.html 928B
package.html 927B
package.html 927B
package.html 926B
package.html 924B
package.html 922B
package.html 910B
package.html 908B
package.html 908B
package.html 903B
package.html 903B
package.html 901B
package.html 895B
package.html 891B
package.html 866B
Polling.html 864B
package.html 863B
package.html 859B
共 5324 条
- 1
- 2
- 3
- 4
- 5
- 6
- 54
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6797
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- vmware workstation pro 17 linux版
- 3479521_1710042575-1.rwmod
- 安装及环境配置UMCM-2023C-ma笔记
- (完整)数据库课程设计餐厅点餐说明书-21ab6d3c8beb172ded630b1c59eef8c75ebf952c.doc
- 2023-04-06-项目笔记 - 第一百五十四阶段 - 4.4.2.152全局变量的作用域-152 -2024.06.04
- 松哥解协议松哥解协议松哥解协议松哥解协议松哥解协议
- 618节日618节日618节日
- tensorflow-gpu-2.9.1-cp37-cp37m-win-amd64.whl
- tensorflow-gpu-2.9.0-cp37-cp37m-win-amd64.whl
- tensorflow-gpu-2.9.0-cp39-cp39-win-amd64.whl
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功