Top Inners Fields Constructors Methods
org.jbibtex

public Class BibTeXParser

extends Object
implements BibTeXParserConstants
Class Inheritance
All Implemented Interfaces
org.jbibtex.BibTeXParserConstants
Imports
java.io.File, .FileReader, .Reader, java.util.Collections, .ArrayList, .List, .Map

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
pack-priv static class
private static class

Field Summary

Modifier and TypeField and Description
private BibTeXDatabase
private List<Exception>
private long
private final BibTeXParser.JJCalls[]
private int
private List<int[]>
private int[]
private int
private int
pack-priv SimpleCharStream
private int
private int
private final int[]
private static int[]
private static int[]
private Token
private int[]
private static final BibTeXParser.LookaheadSuccess
public Token
jj_nt

Next token.

private int
private boolean
private Token
private KeyMap<BibTeXString>
public Token
token

Current token.

public BibTeXParserTokenManager
token_source

Generated Token Manager.

private boolean

Constructor Summary

AccessConstructor and Description
public
public
BibTeXParser(Provider stream)

Constructor.

public
BibTeXParser(String dsl)

Constructor.

public
BibTeXParser(BibTeXParserTokenManager tm)

Constructor with generated Token Manager.

Method Summary

Modifier and TypeMethod and Description
public void
addMacro(String key, String value)

public void
private final BibTeXParser.Field
private final List<BibTeXParser.Field>
public void
checkCrossReferenceResolution(Key key, BibTeXEntry entry)

Checks the entry argument before constructing a new CrossReferenceValue instance.

public void
checkStringResolution(Key key, BibTeXString string)

Checks the string argument before constructing a new ReferenceValue instance.

private final BibTeXComment
private final BibTeXDatabase
Database(boolean performErrorRecovery)

public final void
disable_tracing()

Disable tracing.

public final void
enable_tracing()

Enable tracing.

private final BibTeXEntry
public ParseException
generateParseException()

Generate ParseException.

public BibTeXDatabase
public List<Exception>
public KeyMap<BibTeXString>
public final Token
getNextToken()

Get the next Token.

public final Token
getToken(int index)

Get the specific Token.

private <E extends Exception> void
handleException(E e, boolean performErrorRecovery)

private final Token
private final BibTeXInclude
private static boolean
private boolean
jj_2_1(int xla)

private boolean
jj_2_2(int xla)

private boolean
jj_2_3(int xla)

private boolean
jj_2_4(int xla)

private boolean
jj_2_5(int xla)

private boolean
jj_2_6(int xla)

private boolean
jj_2_7(int xla)

private boolean
jj_2_8(int xla)

private boolean
jj_2_9(int xla)

private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private void
jj_add_error_token(int kind, int pos)

private Token
jj_consume_token(int kind)

private static void
private static void
private int
private void
private void
jj_save(int index, int xla)

private boolean
jj_scan_token(int kind)

private final Key
Key()

private String
Literal(int braceLevel, String delimiter)

private final Token
Name()

public String
nextKey()

Generates a key value for an anonymous BibTeX bibliography database entry.

private final BibTeXObject
public BibTeXDatabase
parse(Reader reader)

Parses the BibTeX document in "normal" mode.

private static BibTeXDatabase
public BibTeXDatabase
parseFully(Reader reader)

Parses the BibTeX document in "error recovery" mode.

private final BibTeXPreamble
public void
public void
ReInit(Provider stream)

Reinitialise.

public void
public void
public void
private void
private void
private void
SetState(int state)

private final Value
private void
SkipTo(String symbol)

private final BibTeXString
public final boolean
trace_enabled()

Trace enabled.

private final Value
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databaseback to summary
private BibTeXDatabase database
exceptionsback to summary
private List<Exception> exceptions
idback to summary
private long id
jj_2_rtnsback to summary
private final BibTeXParser.JJCalls[] jj_2_rtns
jj_endposback to summary
private int jj_endpos
jj_expentriesback to summary
private List<int[]> jj_expentries
jj_expentryback to summary
private int[] jj_expentry
jj_gcback to summary
private int jj_gc
jj_genback to summary
private int jj_gen
jj_input_streamback to summary
pack-priv SimpleCharStream jj_input_stream
jj_kindback to summary
private int jj_kind
jj_laback to summary
private int jj_la
jj_la1back to summary
private final int[] jj_la1
jj_la1_0back to summary
private static int[] jj_la1_0
jj_la1_1back to summary
private static int[] jj_la1_1
jj_lastposback to summary
private Token jj_lastpos
jj_lasttokensback to summary
private int[] jj_lasttokens
jj_lsback to summary
private static final BibTeXParser.LookaheadSuccess jj_ls
jj_ntback to summary
public Token jj_nt

Next token.

jj_ntkback to summary
private int jj_ntk
jj_rescanback to summary
private boolean jj_rescan
jj_scanposback to summary
private Token jj_scanpos
macrosback to summary
private KeyMap<BibTeXString> macros
tokenback to summary
public Token token

Current token.

token_sourceback to summary
public BibTeXParserTokenManager token_source

Generated Token Manager.

trace_enabledback to summary
private boolean trace_enabled

Constructor Detail

BibTeXParserback to summary
public BibTeXParser() throws ParseException, TokenMgrException
BibTeXParserback to summary
public BibTeXParser(Provider stream)

Constructor.

BibTeXParserback to summary
public BibTeXParser(String dsl) throws ParseException, TokenMgrException

Constructor.

BibTeXParserback to summary
public BibTeXParser(BibTeXParserTokenManager tm)

Constructor with generated Token Manager.

Method Detail

addMacroback to summary
public void addMacro(String key, String value)
addMacroback to summary
public void addMacro(BibTeXString macro)
Assignmentback to summary
private final BibTeXParser.Field Assignment() throws ParseException
AssignmentListback to summary
private final List<BibTeXParser.Field> AssignmentList() throws ParseException
checkCrossReferenceResolutionback to summary
public void checkCrossReferenceResolution(Key key, BibTeXEntry entry)

Checks the entry argument before constructing a new CrossReferenceValue instance. The default behaviour is to prohibit unresolved references.

Exceptions
ObjectResolutionException:
If the entry is null.
See Also
BibTeXDatabase#resolveEntry(Key)
checkStringResolutionback to summary
public void checkStringResolution(Key key, BibTeXString string)

Checks the string argument before constructing a new ReferenceValue instance. The default behaviour is to prohibit unresolved references.

Exceptions
ObjectResolutionException:
If the string is null.
See Also
BibTeXDatabase#resolveString(Key), BibTeXParser#getMacros()
Commentback to summary
private final BibTeXComment Comment() throws ParseException
Databaseback to summary
private final BibTeXDatabase Database(boolean performErrorRecovery) throws ParseException
disable_tracingback to summary
public final void disable_tracing()

Disable tracing.

enable_tracingback to summary
public final void enable_tracing()

Enable tracing.

Entryback to summary
private final BibTeXEntry Entry() throws ParseException
generateParseExceptionback to summary
public ParseException generateParseException()

Generate ParseException.

getDatabaseback to summary
public BibTeXDatabase getDatabase()
getExceptionsback to summary
public List<Exception> getExceptions()
getMacrosback to summary
public KeyMap<BibTeXString> getMacros()
getNextTokenback to summary
public final Token getNextToken()

Get the next Token.

getTokenback to summary
public final Token getToken(int index)

Get the specific Token.

handleExceptionback to summary
private <E extends Exception> void handleException(E e, boolean performErrorRecovery) throws handleException-E-boolean-:E
Identifierback to summary
private final Token Identifier() throws ParseException
Includeback to summary
private final BibTeXInclude Include() throws ParseException
isDigitStringback to summary
private static boolean isDigitString(String string)
jj_2_1back to summary
private boolean jj_2_1(int xla)
jj_2_2back to summary
private boolean jj_2_2(int xla)
jj_2_3back to summary
private boolean jj_2_3(int xla)
jj_2_4back to summary
private boolean jj_2_4(int xla)
jj_2_5back to summary
private boolean jj_2_5(int xla)
jj_2_6back to summary
private boolean jj_2_6(int xla)
jj_2_7back to summary
private boolean jj_2_7(int xla)
jj_2_8back to summary
private boolean jj_2_8(int xla)
jj_2_9back to summary
private boolean jj_2_9(int xla)
jj_3_1back to summary
private boolean jj_3_1()
jj_3_2back to summary
private boolean jj_3_2()
jj_3_3back to summary
private boolean jj_3_3()
jj_3_4back to summary
private boolean jj_3_4()
jj_3_5back to summary
private boolean jj_3_5()
jj_3_6back to summary
private boolean jj_3_6()
jj_3_7back to summary
private boolean jj_3_7()
jj_3_8back to summary
private boolean jj_3_8()
jj_3_9back to summary
private boolean jj_3_9()
jj_3R_Identifier_602_9_3back to summary
private boolean jj_3R_Identifier_602_9_3()
jj_3R_Name_580_9_4back to summary
private boolean jj_3R_Name_580_9_4()
jj_add_error_tokenback to summary
private void jj_add_error_token(int kind, int pos)
jj_consume_tokenback to summary
private Token jj_consume_token(int kind) throws ParseException
jj_la1_init_0back to summary
private static void jj_la1_init_0()
jj_la1_init_1back to summary
private static void jj_la1_init_1()
jj_ntk_fback to summary
private int jj_ntk_f()
jj_rescan_tokenback to summary
private void jj_rescan_token()
jj_saveback to summary
private void jj_save(int index, int xla)
jj_scan_tokenback to summary
private boolean jj_scan_token(int kind)
Keyback to summary
private final Key Key() throws ParseException
Literalback to summary
private String Literal(int braceLevel, String delimiter) throws ParseException, ParseException
Nameback to summary
private final Token Name() throws ParseException
nextKeyback to summary
public String nextKey()

Generates a key value for an anonymous BibTeX bibliography database entry.

See Also
BibTeXEntry#getKey, BibTeXDatabase#resolveEntry(Key)
Objectback to summary
private final BibTeXObject Object() throws ParseException
parseback to summary
public BibTeXDatabase parse(Reader reader) throws ObjectResolutionException, ParseException, TokenMgrException

Parses the BibTeX document in "normal" mode. The parser throws an exception is an error condition is detected.

Exceptions
ObjectResolutionException:
If the database is inconsistent.
ParseException:
If the produced sequence of tokens cannot be consumed.
TokenMgrException:
If a token cannot be produced.
See Also
CharacterFilterReader
parseBibTeXDatabaseback to summary
private static BibTeXDatabase parseBibTeXDatabase(File file) throws ParseException
parseFullyback to summary
public BibTeXDatabase parseFully(Reader reader) throws ObjectResolutionException

Parses the BibTeX document in "error recovery" mode. The parser does its best to recover from typical error conditions by skipping the problematic object definition. The parser maintains a list of exceptions. This list is cleared when a parse method is invoked again.

Exceptions
ObjectResolutionException:
If the database is inconsistent.
See Also
CharacterFilterReader
Preambleback to summary
private final BibTeXPreamble Preamble() throws ParseException
ReInitback to summary
public void ReInit(String s)
ReInitback to summary
public void ReInit(Provider stream)

Reinitialise.

ReInitback to summary
public void ReInit(BibTeXParserTokenManager tm)

Reinitialise.

removeMacroback to summary
public void removeMacro(String key)
removeMacroback to summary
public void removeMacro(BibTeXString macro)
resolveCrossReferencesback to summary
private void resolveCrossReferences()
setDatabaseback to summary
private void setDatabase(BibTeXDatabase database)
SetStateback to summary
private void SetState(int state) throws ParseException
SimpleValueback to summary
private final Value SimpleValue() throws ParseException
SkipToback to summary
private void SkipTo(String symbol) throws ParseException, ParseException
Stringback to summary
private final BibTeXString String() throws ParseException
trace_enabledback to summary
public final boolean trace_enabled()

Trace enabled.

Valueback to summary
private final Value Value() throws ParseException
org.jbibtex back to summary

private Class BibTeXParser.Field

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Key
private Value

Constructor Summary

AccessConstructor and Description
private
Field(Key key, Value value)

Method Summary

Modifier and TypeMethod and Description
public Key
public Value
private void
setKey(Key key)

private void
setValue(Value value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
private Key key
valueback to summary
private Value value

Constructor Detail

Fieldback to summary
private Field(Key key, Value value)

Method Detail

getKeyback to summary
public Key getKey()
getValueback to summary
public Value getValue()
setKeyback to summary
private void setKey(Key key)
setValueback to summary
private void setValue(Value value)
org.jbibtex back to summary

pack-priv final Class BibTeXParser.JJCalls

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv Token
pack-priv int
pack-priv BibTeXParser.JJCalls

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

argback to summary
pack-priv int arg
firstback to summary
pack-priv Token first
genback to summary
pack-priv int gen
nextback to summary
pack-priv BibTeXParser.JJCalls next

Constructor Detail

JJCallsback to summary
pack-priv JJCalls()
org.jbibtex back to summary

private final Class BibTeXParser.LookaheadSuccess

extends RuntimeException
Class Inheritance
Annotations
@SuppressWarnings:serial

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Throwable
fillInStackTrace()

Overrides java.lang.Throwable.fillInStackTrace.

Fills in the execution stack trace.

Constructor Detail

LookaheadSuccessback to summary
private LookaheadSuccess()

Method Detail

fillInStackTraceback to summary
public Throwable fillInStackTrace()

Overrides java.lang.Throwable.fillInStackTrace.

Doc from java.lang.Throwable.fillInStackTrace.

Fills in the execution stack trace. This method records within this Throwable object information about the current state of the stack frames for the current thread.

If the stack trace of this Throwable is not writable, calling this method has no effect.

Annotations
@Override