Absimpa v196
A B C D E G I J L M N O P R S T U V _

A

absimpa - package absimpa
Abstract Simple Parser.
absimpa.lexer - package absimpa.lexer
An example implementation of a lexer.
add(Grammar<N, C>) - Method in class absimpa.Sequence
 
addToken(C, String) - Method in class absimpa.lexer.SimpleLexer
adds a mapping from a regular expression to the given token code.
addToken(ExprLanguage.Codes, String) - Method in class example.ExprLanguage.L
 

B

BNF<N,C extends java.lang.Enum<C>> - Class in absimpa
is an alternative to GrammarBuilder to create a grammar by providing a string syntax resembling Backus Naur Form (BNF) to build recursive grammars.
BNF(Class<C>) - Constructor for class absimpa.BNF
creates a BNF parser and registers all elements c of the enumeration as tokens of the grammar with new TokenGrammar<N,C>(c).

C

Choice<N,C extends java.lang.Enum<C>> - Class in absimpa
 
Choice(Grammar<N, C>) - Constructor for class absimpa.Choice
 
choice(Grammar<N, C>) - Method in class absimpa.GrammarBuilder
creates a grammar to recognize any one of a number of sub grammars, one of which is the given g.
choice(Grammar<N, C>, Grammar<N, C>) - Method in class absimpa.GrammarBuilder
 
choice(Grammar<N, C>, Grammar<N, C>, Grammar<N, C>) - Method in class absimpa.GrammarBuilder
 
choice(Grammar<N, C>, Grammar<N, C>, Grammar<N, C>, Grammar<N, C>) - Method in class absimpa.GrammarBuilder
 
choice(Grammar<N, C>, Grammar<N, C>, Grammar<N, C>, Grammar<N, C>, Grammar<N, C>) - Method in class absimpa.GrammarBuilder
 
choice(Grammar<N, C>, Grammar<N, C>, Grammar<N, C>, Grammar<N, C>, Grammar<N, C>, Grammar<N, C>...) - Method in class absimpa.GrammarBuilder
 
compile(String) - Method in class absimpa.BNF
compiles a previously define rule.
compile() - Method in class absimpa.Grammar
compiles the grammar into a parser to recognize the grammar.
create(List<N>) - Method in interface absimpa.NodeFactory
creates a new N from the child objects.
create(SimpleLexer<N, C>) - Method in interface example.LeafFactory
 
createLexer() - Static method in class example.ExprLanguage
 
createParser() - Static method in class example.ExprLanguage
 
current() - Method in interface absimpa.Lexer
provides the current token code.
current() - Method in class absimpa.lexer.SimpleLexer
 
currentText() - Method in class absimpa.lexer.SimpleLexer
 
currentToken() - Method in class absimpa.lexer.SimpleLexer
returns the current token.

D

dump(Appendable, String) - Method in class example.ExprLanguage.Expr
 

E

eofCode() - Method in interface absimpa.lexer.LexerInfo
 
etype - Variable in class example.ExprLanguage.Expr
 
example - package example
provides an example use of the parser.
ExprLanguage - Class in example
create a simple expression language and use it for testing.
ExprLanguage() - Constructor for class example.ExprLanguage
 
ExprLanguage.Eparser - Class in example
 
ExprLanguage.Eparser(Parser<ExprLanguage.Expr, ExprLanguage.Codes>) - Constructor for class example.ExprLanguage.Eparser
 
ExprLanguage.Expr - Class in example
 
ExprLanguage.L - Class in example
 
ExprLanguage.L(ExprLanguage.Codes) - Constructor for class example.ExprLanguage.L
 

G

getCode() - Method in class example.Token
 
getColumn() - Method in exception absimpa.ParseException
 
getDetail() - Method in class absimpa.Repeat
 
getDetail() - Method in class absimpa.TokenGrammar
 
getExpectedTokenCodes() - Method in exception absimpa.ParseException
 
getFoundTokenCode() - Method in exception absimpa.ParseException
 
getGrammar(String) - Method in class absimpa.BNF
return the grammar defined for the given name.
getLine() - Method in exception absimpa.ParseException
 
getMessage() - Method in exception absimpa.ParseException
creates a message from the fields set in this exception.
getMoreInfo() - Method in exception absimpa.ParseException
 
getName() - Method in class absimpa.Grammar
 
getRegex() - Method in interface absimpa.lexer.LexerInfo
 
getSourceName() - Method in exception absimpa.ParseException
 
getText() - Method in class example.Token
 
getTokenText() - Method in exception absimpa.ParseException
 
Grammar<N,C extends java.lang.Enum<C>> - Class in absimpa
The Grammar describes a language made of sequences of C objects provided by a Lexer.
GrammarBuilder<N,C extends java.lang.Enum<C>> - Class in absimpa
helps to build a Grammar for a language made from objects of type C.
GrammarBuilder(NodeFactory<N>) - Constructor for class absimpa.GrammarBuilder
the resulting GrammarBuilder will enter the given factory into grammar objects as they are created, if no factory is explicitly provided.

I

initAnalysis(CharSequence) - Method in class absimpa.lexer.SimpleLexer
resets the lexer and initializes it to analyze the given text.

J

join(Iterable<?>, String, String, String) - Static method in class absimpa.Util
join a list of things into a string with a prefix, a separator and a suffix.

L

LeafFactory<N,C extends java.lang.Enum<C>> - Interface in example
 
LeftRecursiveException - Exception in absimpa
thrown by Grammar.compile().
LeftRecursiveException(String) - Constructor for exception absimpa.LeftRecursiveException
 
Lexer<N,TokenCode extends java.lang.Enum<TokenCode>> - Interface in absimpa
defines the interface to a lexical analyzer (lexer) needed by the Parser.
LexerInfo<C extends java.lang.Enum<C>> - Interface in absimpa.lexer
provides additional information about an enum for SimpleLexer.SimpleLexer(Class, example.LeafFactory) to automatically set up the lexical analysis for all tokens of the enum.
LookaheadConflictException - Exception in absimpa
thrown by Grammar.compile().
LookaheadConflictException(EnumSet<?>, Grammar<?, ?>, Grammar<?, ?>) - Constructor for exception absimpa.LookaheadConflictException
 

M

main(String[]) - Static method in class absimpa.BNF
prints the grammar employed to parse grammars.

N

next() - Method in interface absimpa.Lexer
returns a node of type N for the current token while advancing the current token internally to the next one.
next() - Method in class absimpa.lexer.SimpleLexer
discards the current token and advance to the next one.
NodeFactory<N> - Interface in absimpa
creates a new N from a list of N objects provided by a parser.

O

opt(NodeFactory<N>) - Method in class absimpa.Grammar
wraps this into a Repeat with min=0 and {code max=1}.
opt() - Method in class absimpa.Grammar
wraps this into a Repeat with min=0 and {code max=1}.
opt(Grammar<N, C>) - Method in class absimpa.GrammarBuilder
convenience function to call GrammarBuilder.repeat(Grammar,int,int) with min=0 and max=1.
opt(NodeFactory<N>, Grammar<N, C>) - Method in class absimpa.GrammarBuilder
convenience function to call GrammarBuilder.repeat(NodeFactory,Grammar,int,int) with min=0 and max=1.
or(Grammar<N, C>) - Method in class absimpa.Choice
 

P

parse(Lexer<N, C>) - Method in interface absimpa.Parser
parses a sequence of objects of type <C> from the given Lexer and transforms it into an object of type <N>.
parse(Lexer<ExprLanguage.Expr, ExprLanguage.Codes>) - Method in class example.ExprLanguage.Eparser
 
parseException(Set<TokenCode>) - Method in interface absimpa.Lexer
creates a ParseException on request from the parser.
parseException(Set<C>) - Method in class absimpa.lexer.SimpleLexer
 
ParseException - Exception in absimpa
The parser may throw a ParseException, but it does not create it itself.
ParseException(Set<?>, Enum<?>) - Constructor for exception absimpa.ParseException
 
Parser<N,C extends java.lang.Enum<C>> - Interface in absimpa
parses input in the form of token codes as provided by a lexical analyzer and constructs result objects.

R

Recurse<N,C extends java.lang.Enum<C>> - Class in absimpa
 
Recurse() - Constructor for class absimpa.Recurse
 
rep(NodeFactory<N>, int, int) - Method in class absimpa.Grammar
wraps this into a Repeat.
repeat(NodeFactory<N>, Grammar<N, C>, int, int) - Method in class absimpa.GrammarBuilder
creates a grammar to recognize a repetition of the given subgrammar g.
repeat(Grammar<N, C>, int, int) - Method in class absimpa.GrammarBuilder
creates a grammar like GrammarBuilder.repeat(NodeFactory, Grammar,int,int), but with the default NodeFactory.
Repeat<N,C extends java.lang.Enum<C>> - Class in absimpa
 
Repeat(int, int, Grammar<N, C>) - Constructor for class absimpa.Repeat
 
rule(String) - Method in class absimpa.BNF
create an empty rule to be filled later.
rule(String, String) - Method in class absimpa.BNF
same as the three parameter rule(), but without any node factory.
rule(String, String, NodeFactory<N>) - Method in class absimpa.BNF
translates a rule with the given name into a grammar described by expansion, using the given node factory.
rule(String, String, NodeFactory<N>, NodeFactory<N>) - Method in class absimpa.BNF
create a rule that uses two node factories.
rule(String, String, NodeFactory<N>, NodeFactory<N>, NodeFactory<N>...) - Method in class absimpa.BNF
create a rule that uses many node factories.
ruleString() - Method in class absimpa.Grammar
 

S

seq(NodeFactory<N>, Grammar<N, C>) - Method in class absimpa.GrammarBuilder
creates a grammar to recognize a sequence of subgrammars which starts with g.
seq(Grammar<N, C>) - Method in class absimpa.GrammarBuilder
creates a grammar like GrammarBuilder.seq(NodeFactory, Grammar), but with the default NodeFactory.
seq(Grammar<N, C>, Grammar<N, C>) - Method in class absimpa.GrammarBuilder
 
seq(Grammar<N, C>, Grammar<N, C>, Grammar<N, C>) - Method in class absimpa.GrammarBuilder
 
seq(Grammar<N, C>, Grammar<N, C>, Grammar<N, C>, Grammar<N, C>) - Method in class absimpa.GrammarBuilder
 
seq(Grammar<N, C>, Grammar<N, C>, Grammar<N, C>, Grammar<N, C>, Grammar<N, C>) - Method in class absimpa.GrammarBuilder
 
seq(Grammar<N, C>, Grammar<N, C>, Grammar<N, C>, Grammar<N, C>, Grammar<N, C>, Grammar<N, C>...) - Method in class absimpa.GrammarBuilder
 
Sequence<N,C extends java.lang.Enum<C>> - Class in absimpa
is a grammar to recognize a sequence of child grammars.
Sequence(Grammar<N, C>) - Constructor for class absimpa.Sequence
 
setChild(Grammar<N, C>) - Method in class absimpa.Recurse
 
setColumn(int) - Method in exception absimpa.ParseException
set number of the input column within the input line on which the parse error occurred.
setLine(int) - Method in exception absimpa.ParseException
set number of the input line (or anything resembling a line) on which the parse error occurred.
setMoreInfo(String) - Method in exception absimpa.ParseException
 
setName(String) - Method in class absimpa.Grammar
used by Grammar.toString() only, not needed for the function of the grammar.
setNodeFactory(NodeFactory<N>) - Method in class absimpa.Grammar
 
setSkipRe(String) - Method in class absimpa.lexer.SimpleLexer
 
setSourceName(String) - Method in exception absimpa.ParseException
set the name of the source from which the line with the parse error was read.
setTokenText(String) - Method in exception absimpa.ParseException
sets a string representation of the token that caused the error.
SimpleLexer<N,C extends java.lang.Enum<C>> - Class in absimpa.lexer
is an example implementation of a Lexer which analyzes a string by trying out regular expressions for tokens until a match is found.
SimpleLexer(C, LeafFactory<N, C>) - Constructor for class absimpa.lexer.SimpleLexer
creates a TrivialLexer to return eofCode when the end of input is encountered.
SimpleLexer(Class<CC>, LeafFactory<N, C>) - Constructor for class absimpa.lexer.SimpleLexer
adds all constants found in class tokenCode with SimpleLexer.addToken(C, java.lang.String) except if it is identical to the LexerInfo.eofCode() it provides.
star(NodeFactory<N>) - Method in class absimpa.Grammar
wraps this into a Repeat with min=0 and {code max} really huge.
star() - Method in class absimpa.Grammar
wraps this into a Repeat with min=0 and {code max} really huge.
star(Grammar<N, C>) - Method in class absimpa.GrammarBuilder
convenience function to call GrammarBuilder.repeat(Grammar,int,int) with min=0 and max=Integer.MAX_VALUE.
star(NodeFactory<N>, Grammar<N, C>) - Method in class absimpa.GrammarBuilder
convenience function to call GrammarBuilder.repeat(NodeFactory,Grammar,int,int) with min=0 and max=Integer.MAX_VALUE.

T

toBNF() - Method in class absimpa.Grammar
 
token(C) - Method in class absimpa.GrammarBuilder
creates a grammar to recognize the given token code.
Token<N,C extends java.lang.Enum<C>> - Class in example
provides a typical token as a pair of the token text and its type from an enumeration C.
Token(String, C) - Constructor for class example.Token
 
TokenGrammar<N,C extends java.lang.Enum<C>> - Class in absimpa
a grammar to recognize a single token.
TokenGrammar(C) - Constructor for class absimpa.TokenGrammar
 
toString() - Method in class absimpa.Grammar
 
toString() - Method in class absimpa.lexer.SimpleLexer
 
toString() - Method in class example.Token
 

U

Util - Class in absimpa
the typical set of static utility methods.
Util() - Constructor for class absimpa.Util
 

V

value() - Method in class example.ExprLanguage.Expr
 

_

_ruleString() - Method in class absimpa.Choice
 
_ruleString() - Method in class absimpa.Recurse
 
_ruleString() - Method in class absimpa.Repeat
 
_ruleString() - Method in class absimpa.Sequence
 
_ruleString() - Method in class absimpa.TokenGrammar
 

A B C D E G I J L M N O P R S T U V _
Absimpa v196