Top Inners Fields Constructors Methods
org.jabref.logic.bst

public Class BstVM

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.file.Path, java.util.Collection, .Deque, .List, .Objects, java.util.stream.Collectors, org.jabref.model.database.BibDatabase, org.jabref.model.entry.BibEntry, org.antlr.v4.runtime.BailErrorStrategy, .BaseErrorListener, .CharStream, .CharStreams, .CommonTokenStream, .RecognitionException, .Recognizer, org.antlr.v4.runtime.misc.ParseCancellationException, org.antlr.v4.runtime.tree.ParseTree

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
protected static final Integer
protected BstVMContext
private Path
protected final ParseTree
protected static final Integer

Constructor Summary

AccessConstructor and Description
public
BstVM(Path path)

public
protected
private

Method Summary

Modifier and TypeMethod and Description
private static ParseTree
protected Deque<Object>
public String

Returns:

list of references in plain text form
render
(Collection<BibEntry>
list of entries to convert
bibEntries
,
BibDatabase
(may be null) the bibDatabase used for resolving strings / crossref
bibDatabase
)

Transforms the given list of BibEntries to a rendered list of references using the parsed bst program

public String
render(Collection<BibEntry> bibEntries)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FALSEback to summary
protected static final Integer FALSE
latestContextback to summary
protected BstVMContext latestContext
pathback to summary
private Path path
treeback to summary
protected final ParseTree tree
TRUEback to summary
protected static final Integer TRUE

Constructor Detail

BstVMback to summary
public BstVM(Path path) throws RecognitionException, IOException
BstVMback to summary
public BstVM(String s) throws RecognitionException
BstVMback to summary
protected BstVM(CharStream bst) throws RecognitionException
BstVMback to summary
private BstVM(ParseTree tree)

Method Detail

charStream2CommonTreeback to summary
private static ParseTree charStream2CommonTree(CharStream query)
getStackback to summary
protected Deque<Object> getStack()
renderback to summary
public String render(Collection<BibEntry> bibEntries, BibDatabase bibDatabase)

Transforms the given list of BibEntries to a rendered list of references using the parsed bst program

Parameters
bibEntries:Collection<BibEntry>

list of entries to convert

bibDatabase:BibDatabase

(may be null) the bibDatabase used for resolving strings / crossref

Returns:String

list of references in plain text form

renderback to summary
public String render(Collection<BibEntry> bibEntries)
org.jabref.logic.bst back to summary

private Class BstVM.ThrowingErrorListener

extends BaseErrorListener
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final BstVM.ThrowingErrorListener

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
syntaxError(Recognizer<?, ?>
What parser got the error. From this object, you can access the context as well as the input stream.
recognizer
,
Object
The offending token in the input token stream, unless recognizer is a lexer (then it's null). If no viable alternative error, e has token at which we started production for the decision.
offendingSymbol
,
int
The line number in the input where the error occurred.
line
,
int
The character position within that line where the error occurred.
charPositionInLine
,
String
The message to emit.
msg
,
RecognitionException
The exception generated by the parser that led to the reporting of an error. It is null in the case where the parser was able to recover in line without exiting the surrounding rule.
e
)

Overrides org.antlr.v4.runtime.BaseErrorListener.syntaxError.

Implements org.antlr.v4.runtime.ANTLRErrorListener.syntaxError.

Upon syntax error, notify any interested parties.

Inherited from org.antlr.v4.runtime.BaseErrorListener:
reportAmbiguityreportAttemptingFullContextreportContextSensitivity

Field Detail

INSTANCEback to summary
public static final BstVM.ThrowingErrorListener INSTANCE

Constructor Detail

ThrowingErrorListenerback to summary
private ThrowingErrorListener()

Method Detail

syntaxErrorback to summary
public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) throws ParseCancellationException

Overrides org.antlr.v4.runtime.BaseErrorListener.syntaxError.

Implements org.antlr.v4.runtime.ANTLRErrorListener.syntaxError.

Doc from org.antlr.v4.runtime.ANTLRErrorListener.syntaxError.

Upon syntax error, notify any interested parties. This is not how to recover from errors or compute error messages. ANTLRErrorStrategy specifies how to recover from syntax errors and how to compute error messages. This listener's job is simply to emit a computed message, though it has enough information to create its own message in many cases.

The RecognitionException is non-null for all syntax errors except when we discover mismatched token errors that we can recover from in-line, without returning from the surrounding rule (via the single token insertion and deletion mechanism).

Parameters
recognizer:Recognizer<?, ?>

What parser got the error. From this object, you can access the context as well as the input stream.

offendingSymbol:Object

The offending token in the input token stream, unless recognizer is a lexer (then it's null). If no viable alternative error, e has token at which we started production for the decision.

line:int

The line number in the input where the error occurred.

charPositionInLine:int

The character position within that line where the error occurred.

msg:String

The message to emit.

e:RecognitionException

The exception generated by the parser that led to the reporting of an error. It is null in the case where the parser was able to recover in line without exiting the surrounding rule.

Annotations
@Override