java.lang.Object
com.port80.eclipse.llk.editors.parser.LLKEditorParser
- All Implemented Interfaces:
- ILLKLLKEditorParser, ILLKParser
- public class LLKEditorParser
- extends java.lang.Object
- implements ILLKParser, ILLKLLKEditorParser
| Fields inherited from interface com.port80.eclipse.llk.editors.parser.ILLKLLKEditorParser |
ABSTRACT, action, ADD_ASSIGN, AND, AND_ASSIGN, ASSIGN, BANG, BOOLEAN, BREAK, BYTE, CARRET, CASE, CATCH, CHAR, CHARACTER, charSet, Choice, Choices, CLASS, CODE, codeRule, COLON, COMMA, COMMENT, CONST, CONTINUE, CPPCOMMENT, DEC, DECIMAL, DEFAULT, DIV, DIV_ASSIGN, DO, DOT, DOUBLE, Element, ELSE, EOF, EQ, EXTENDS, FALSE, FINAL, FINALLY, FixedLookahead, FLOAT, FOR, GE, GOTO, grammarClassDeclaration, grammarHeader, grammarOptions, GT, HASH, HEADER, HEX, IDENTIFIER, IF, IGNORE, IMPLEMENTS, IMPORT, INC, INSTANCEOF, INT, INTERFACE, INVALID, KEYWORDS, LAND, LBRACE, LBRACKET, LE, LEXER, lexerRule, LLK_TOKENTYPE_LAST, LONG, Lookahead, LOOKAHEAD, LOR, LPAREN, LSHIFT, LSHIFT_ASSIGN, LT, MINUS, MOD_ASSIGN, MULT_ASSIGN, NATIVE, NE, NEW, NEWLINE, nodeDescriptor, nodeDescriptorExpression, NULL, NULL_TREE, NUMBER, OCTAL, OPTIONS, OR, OR_ASSIGN, PACKAGE, PARSER, parserRule, PERCENT, PLUS, PRIVATE, PROTECTED, PUBLIC, QUESTION, RANGE, RBRACE, RBRACKET, REAL, RETURN, rootNode, RPAREN, RSHIFT, RSHIFT_ASSIGN, ruleRef, semanticPredict, SEMICOLON, SHORT, SPACES, STAR, STATIC, STRING, stringRef, SUB_ASSIGN, SUPER, SWITCH, SYNCHRONIZED, THIS, THROW, THROWS, TILDE, TOKEN_NAMES, tokenSet, TRANSIENT, TREEPARSER, treeParserRule, treeRef, TRUE, TRY, VOID, VOLATILE, WHILE, XOR_ASSIGN |
|
Method Summary |
LLKParseException |
_parseException(java.lang.String msg,
LLKToken t,
LLKParserInput input)
|
protected boolean |
_synMark()
|
protected boolean |
_synMatch(int type)
|
protected boolean |
_synMatch(int[] bset)
|
protected boolean |
_synMatchNot(int type)
|
protected boolean |
_synMatchNot(int[] bset)
|
protected boolean |
_synMatchNotRange(int first,
int last)
|
protected boolean |
_synMatchRange(int first,
int last)
|
protected boolean |
_synRewind(boolean b)
|
ASTaction |
action()
|
private void |
addLiteral(java.lang.String s,
java.util.List ret,
LLKToken t)
|
boolean |
BooleanLiteral()
|
protected void |
charRange(ASTcharSet charset,
boolean exclude)
|
void |
charSet(int mod,
java.lang.String label,
java.lang.String op)
|
void |
charSetPart(ASTcharSet charset,
boolean exclude)
|
private boolean |
checkAlias(java.lang.String name,
java.lang.String value)
|
private TokenSet |
checkCharSetRef(java.lang.String s)
|
private void |
checkLiteralRef(java.lang.String s)
|
void |
choice(int g)
|
Choices |
choices(LLKToken start,
int g)
|
void |
codeChoice()
|
void |
codeChoices()
|
void |
codeElement()
|
void |
codeRule(int g)
|
void |
consume()
|
void |
consume(int n)
|
private int |
countNodes(LLKNode n)
|
private void |
defineCharSet(java.lang.String name,
ASTcharSet charset)
|
void |
element(int g)
|
void |
error(LLKParseException e)
|
void |
error(java.lang.String msg,
java.lang.Exception e)
|
void |
error(java.lang.String msg,
LLKToken t)
|
void |
FixedLookahead(Choices choices)
|
ASTgrammars |
getGrammars()
|
java.lang.String |
getLanguage()
|
ASTlexerGrammar |
getLexerGrammar()
|
ASTparserGrammar |
getParserGrammar()
|
ASTtreeParserGrammar |
getTreeParserGrammar()
|
void |
grammarClassDeclaration()
|
ASTaction |
grammarHeader()
|
void |
GrammarOption(com.port80.util.attr.IAttrTable options,
java.lang.String grammar_type)
|
void |
grammarOptions(com.port80.util.attr.IAttrTable options,
java.lang.String grammar_type)
|
ASTgrammars |
grammars()
|
LLKToken |
Identifier()
|
void |
inlineLookaheadChoice(int g)
|
void |
inlineLookaheadChoices(LLKToken start,
int g)
|
void |
inlineLookaheadElement(int g)
|
int |
IntegerLiteral()
|
private boolean |
isPublic(int mod)
|
int |
KeywordAttribute(LLKToken ident,
int mod)
|
void |
KeywordDeclaration()
|
int |
LA(int n)
|
int |
LA0()
|
int |
LA1()
|
int |
LexerAttribute(LLKToken ident,
int mod)
|
ASTlexerGrammar |
lexerGrammar()
|
void |
lexerReferences()
|
void |
lexerRule()
|
void |
literalChoice(java.util.List ret)
|
java.util.List |
literalChoices()
|
void |
literalElement(java.util.List ret)
|
private void |
llkCloseNode(LLKNode node)
|
void |
llkConsumeUntil(int c)
Consume chars until one matches the given char |
void |
llkConsumeUntil(int[] a)
Consume chars until one matches the given token type. |
void |
llkConsumeUntil(int[] bitset,
boolean inverted)
Consume chars until one matches the given token type. |
void |
llkDisableContext(java.lang.String context)
|
void |
llkEnableContext(java.lang.String context)
|
protected static boolean |
llkGetBit(int n,
int[] bset)
|
protected static boolean |
llkGetBitInverted(int n,
int[] bset)
|
LLKParserInput |
llkGetInput()
|
SourceLocation |
llkGetLocation()
|
SourceLocation |
llkGetLocation(LLKNode n)
|
java.lang.String |
llkGetNodeName(int type)
|
char[] |
llkGetSource()
|
java.lang.String |
llkGetSource(int start,
int end)
|
java.lang.String |
llkGetSource(LLKNode n)
|
java.lang.String |
llkGetSource(LLKToken t)
|
protected void |
llkInit()
|
private void |
llkOpenNode(LLKNode node)
|
void |
llkReset()
|
void |
lookahead(int g)
|
void |
lookaheadChoice(int g)
|
Choices |
lookaheadChoices(LLKToken start,
int g)
|
void |
lookaheadElement(int g)
|
LLKToken |
LT(int n)
|
LLKToken |
LT0()
|
LLKToken |
LT1()
|
static void |
main(java.lang.String[] args)
|
void |
MatchPair(int open,
int close,
int level)
|
int |
Modifiers(int mod)
|
java.lang.String |
Name()
|
java.util.List |
NameList()
|
void |
nodeDescriptor()
|
void |
nodeDescriptorExpression()
|
private boolean |
notTailOfExpansionUnit()
|
private java.util.List |
parseCSV(LLKToken start,
LLKToken end,
boolean allowpercent)
Parse a comma seperated value list. |
ASTparserGrammar |
parserGrammar()
|
void |
parserReferences()
|
void |
parserRule()
|
java.lang.String |
PrimitiveType()
|
java.lang.String |
QualifiedIdentifier()
|
java.lang.String |
ResultType()
|
void |
rootNode()
|
java.util.List |
RuleArguments()
|
java.util.List |
RuleParameters()
|
void |
ruleRef(int mod,
java.lang.String label,
java.lang.String op)
|
void |
semanticPredict()
|
private int |
setAccess(int mod,
int access)
|
private void |
skipFrom(LLKToken start)
Skip to (but excluded) the close token that match the open token starting at 'start'. |
private void |
skipMatchPair(int open,
int close,
int level)
Consume till but exclude the matching close token. |
private java.lang.String |
skipWhitespace(java.lang.StringBuffer buf)
|
java.lang.String |
StringLiteral()
|
java.lang.String |
stringRef(int mod,
java.lang.String label,
java.lang.String op)
|
static void |
test1(java.lang.String[] args)
|
LLKNode |
test1a(char[] source,
int iter)
|
void |
test1dump(char[] source)
|
LLKToken |
tokenRef()
|
void |
tokenSet(int mod,
java.lang.String label,
java.lang.String op)
|
ASTtreeParserGrammar |
treeParserGrammar()
|
void |
treeParserReferences()
|
void |
treeParserRule()
|
void |
treeRef(int mod,
java.lang.String label,
java.lang.String op)
|
java.lang.String |
Type()
|
void |
uponEOF()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAME
private static final java.lang.String NAME
- See Also:
- Constant Field Values
VERBOSE
private static boolean VERBOSE
LEXER_GRAMMAR
private static final int LEXER_GRAMMAR
- See Also:
- Constant Field Values
PARSER_GRAMMAR
private static final int PARSER_GRAMMAR
- See Also:
- Constant Field Values
TREEPARSER_GRAMMAR
private static final int TREEPARSER_GRAMMAR
- See Also:
- Constant Field Values
grammars
protected ASTgrammars grammars
- Top level node that contains all the grammars.
lexerGrammar
protected ASTlexerGrammar lexerGrammar
parserGrammar
protected ASTparserGrammar parserGrammar
treeParserGrammar
protected ASTtreeParserGrammar treeParserGrammar
grammar
protected Grammar grammar
- The current grammar.
lexerLiteralTable
protected java.util.Map lexerLiteralTable
- Use to check for duplicated literal.
charsetTable
protected java.util.Map charsetTable
module
protected java.lang.String module
_INPUT_VOCAB_SIZE
protected static final int _INPUT_VOCAB_SIZE
- See Also:
- Constant Field Values
llkInput
protected LLKParserInput llkInput
llkMain
protected ILLKMain llkMain
llkSource
protected char[] llkSource
_syntacticPredictListeners
protected java.util.List _syntacticPredictListeners
_semanticPredictListeners
protected java.util.List _semanticPredictListeners
llkTree
LLKTree llkTree
LLKEditorParser
public LLKEditorParser(LLKParserInput input,
ILLKMain main)
LLKEditorParser
public LLKEditorParser(ILLKLexer lexer,
ILLKMain main)
main
public static void main(java.lang.String[] args)
llkInit
protected void llkInit()
getGrammars
public ASTgrammars getGrammars()
getLexerGrammar
public ASTlexerGrammar getLexerGrammar()
getParserGrammar
public ASTparserGrammar getParserGrammar()
getTreeParserGrammar
public ASTtreeParserGrammar getTreeParserGrammar()
getLanguage
public java.lang.String getLanguage()
test1
public static void test1(java.lang.String[] args)
test1dump
public void test1dump(char[] source)
test1a
public LLKNode test1a(char[] source,
int iter)
countNodes
private int countNodes(LLKNode n)
skipFrom
private void skipFrom(LLKToken start)
- Skip to (but excluded) the close token that match the open token starting at 'start'.
skipMatchPair
private void skipMatchPair(int open,
int close,
int level)
throws LLKParseException
- Consume till but exclude the matching close token.
parseCSV
private java.util.List parseCSV(LLKToken start,
LLKToken end,
boolean allowpercent)
- Parse a comma seperated value list.
skipWhitespace
private java.lang.String skipWhitespace(java.lang.StringBuffer buf)
llkOpenNode
private void llkOpenNode(LLKNode node)
llkCloseNode
private void llkCloseNode(LLKNode node)
addLiteral
private void addLiteral(java.lang.String s,
java.util.List ret,
LLKToken t)
checkLiteralRef
private void checkLiteralRef(java.lang.String s)
defineCharSet
private void defineCharSet(java.lang.String name,
ASTcharSet charset)
checkCharSetRef
private TokenSet checkCharSetRef(java.lang.String s)
checkAlias
private boolean checkAlias(java.lang.String name,
java.lang.String value)
setAccess
private int setAccess(int mod,
int access)
notTailOfExpansionUnit
private boolean notTailOfExpansionUnit()
error
public void error(LLKParseException e)
error
public void error(java.lang.String msg,
java.lang.Exception e)
error
public void error(java.lang.String msg,
LLKToken t)
isPublic
private boolean isPublic(int mod)
llkReset
public void llkReset()
- Specified by:
llkReset in interface ILLKParser
grammars
public final ASTgrammars grammars()
throws LLKParseException
lexerGrammar
public final ASTlexerGrammar lexerGrammar()
throws LLKParseException
parserGrammar
public final ASTparserGrammar parserGrammar()
throws LLKParseException
treeParserGrammar
public final ASTtreeParserGrammar treeParserGrammar()
throws LLKParseException
grammarHeader
public final ASTaction grammarHeader()
throws LLKParseException
grammarOptions
public final void grammarOptions(com.port80.util.attr.IAttrTable options,
java.lang.String grammar_type)
throws LLKParseException
GrammarOption
public final void GrammarOption(com.port80.util.attr.IAttrTable options,
java.lang.String grammar_type)
throws LLKParseException
lexerRule
public final void lexerRule()
throws LLKParseException
parserRule
public final void parserRule()
throws LLKParseException
treeParserRule
public final void treeParserRule()
throws LLKParseException
Modifiers
public final int Modifiers(int mod)
throws LLKParseException
LexerAttribute
public final int LexerAttribute(LLKToken ident,
int mod)
throws LLKParseException
codeRule
public final void codeRule(int g)
throws LLKParseException
codeChoices
public final void codeChoices()
throws LLKParseException
codeChoice
public final void codeChoice()
throws LLKParseException
codeElement
public final void codeElement()
throws LLKParseException
choices
public final Choices choices(LLKToken start,
int g)
throws LLKParseException
choice
public final void choice(int g)
throws LLKParseException
element
public final void element(int g)
throws LLKParseException
lexerReferences
public final void lexerReferences()
throws LLKParseException
parserReferences
public final void parserReferences()
throws LLKParseException
treeParserReferences
public final void treeParserReferences()
throws LLKParseException
KeywordDeclaration
public final void KeywordDeclaration()
throws LLKParseException
KeywordAttribute
public final int KeywordAttribute(LLKToken ident,
int mod)
throws LLKParseException
literalChoices
public final java.util.List literalChoices()
throws LLKParseException
literalChoice
public final void literalChoice(java.util.List ret)
throws LLKParseException
literalElement
public final void literalElement(java.util.List ret)
throws LLKParseException
FixedLookahead
public final void FixedLookahead(Choices choices)
throws LLKParseException
lookahead
public final void lookahead(int g)
throws LLKParseException
inlineLookaheadChoices
public final void inlineLookaheadChoices(LLKToken start,
int g)
throws LLKParseException
inlineLookaheadChoice
public final void inlineLookaheadChoice(int g)
throws LLKParseException
inlineLookaheadElement
public final void inlineLookaheadElement(int g)
throws LLKParseException
lookaheadChoices
public final Choices lookaheadChoices(LLKToken start,
int g)
throws LLKParseException
lookaheadChoice
public final void lookaheadChoice(int g)
throws LLKParseException
lookaheadElement
public final void lookaheadElement(int g)
throws LLKParseException
charRange
protected final void charRange(ASTcharSet charset,
boolean exclude)
throws LLKParseException
charSetPart
public final void charSetPart(ASTcharSet charset,
boolean exclude)
throws LLKParseException
<