Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
ANTLR Runtime Source Code
ANTLR is a powerful parser generator for multiple programming languages
including Java.
ANTLR contains 2 major modules:
ANTLR Runtime Source Code files are provided in the distribution packge (antlr4-4.10.1.zip). You can download them at ANTLR Website.
You can also browse the source code below:
✍: FYIcenter
⏎ org/antlr/v4/runtime/FailedPredicateException.java
/*
* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
* Use of this file is governed by the BSD 3-clause license that
* can be found in the LICENSE.txt file in the project root.
*/
package org.antlr.v4.runtime;
import org.antlr.v4.runtime.atn.ATNState;
import org.antlr.v4.runtime.atn.AbstractPredicateTransition;
import org.antlr.v4.runtime.atn.PredicateTransition;
import java.util.Locale;
/** A semantic predicate failed during validation. Validation of predicates
* occurs when normally parsing the alternative just like matching a token.
* Disambiguating predicate evaluation occurs when we test a predicate during
* prediction.
*/
public class FailedPredicateException extends RecognitionException {
private final int ruleIndex;
private final int predicateIndex;
private final String predicate;
public FailedPredicateException(Parser recognizer) {
this(recognizer, null);
}
public FailedPredicateException(Parser recognizer, String predicate) {
this(recognizer, predicate, null);
}
public FailedPredicateException(Parser recognizer,
String predicate,
String message)
{
super(formatMessage(predicate, message), recognizer, recognizer.getInputStream(), recognizer._ctx);
ATNState s = recognizer.getInterpreter().atn.states.get(recognizer.getState());
AbstractPredicateTransition trans = (AbstractPredicateTransition)s.transition(0);
if (trans instanceof PredicateTransition) {
this.ruleIndex = ((PredicateTransition)trans).ruleIndex;
this.predicateIndex = ((PredicateTransition)trans).predIndex;
}
else {
this.ruleIndex = 0;
this.predicateIndex = 0;
}
this.predicate = predicate;
this.setOffendingToken(recognizer.getCurrentToken());
}
public int getRuleIndex() {
return ruleIndex;
}
public int getPredIndex() {
return predicateIndex;
}
public String getPredicate() {
return predicate;
}
private static String formatMessage(String predicate, String message) {
if (message != null) {
return message;
}
return String.format(Locale.getDefault(), "failed predicate: {%s}?", predicate);
}
}
⏎ org/antlr/v4/runtime/FailedPredicateException.java
Or download all of them as a single archive file:
File name: antlr-runtime-4.10.1-sources.jar File size: 308953 bytes Release date: 2022-04-15 Download
⇐ What Is ANTLR Parser Generator
2018-10-21, ≈74🔥, 0💬
Popular Posts:
How to download and install mysql-connector-j-8.0.31 .zip?Connector/J Java library is a JDBC Driver ...
What Is log4j-1.2.13.jar? I got the JAR file from logging-log4j-1.2.13.zip .log4j-1.2.13.jar is the ...
layout.jar is a component in iText Java library to provide layout functionalities. iText Java librar...
JDK 11 java.xml.jmod is the JMOD file for JDK 11 XML (eXtensible Markup Language) module. JDK 11 XML...
GJT (Giant Java Tree) implementation of XML Pull Parser. JAR File Size and Download Location: File n...