|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.aptana.ide.parsing.AbstractParser
public abstract class AbstractParser
| Field Summary | |
|---|---|
protected Lexeme |
currentLexeme
The current lexeme being considered in the parse |
protected static Lexeme |
EOS
End of stream lexeme. |
| Constructor Summary | |
|---|---|
protected |
AbstractParser(java.lang.String language)
Creates a parser for the language specified and from the resource specified by the stream. |
| Method Summary | |
|---|---|
protected void |
addChildParser(IParser child)
addChildParser |
protected void |
addChildParsers()
addChildParsers |
protected void |
addGrammars(ILexerBuilder lexerBuilder)
addGrammars |
protected void |
addLexeme(Lexeme lexeme)
addLexeme |
abstract void |
addLexerGrammar(ILexerBuilder builder)
This method loads the parser's lexer grammar using the specified builder. |
protected void |
advance()
Advance to the next lexeme in the lexeme stream |
protected void |
assertAndAdvance(int type,
java.lang.String errorKey)
Advance to the next lexeme if the current one is of the specified name |
protected void |
assertInSet(int[] set,
java.lang.String errorKey)
Make sure the current token is in the specified set |
protected void |
assertType(int type,
java.lang.String errorKey)
Make sure the current token is of the specified type |
void |
changeLanguage(java.lang.String mimeType,
int offset,
IParseNode parentNode)
changeLanguage |
protected abstract ITokenList |
createLanguageTokenList()
createLanguageTokenList |
abstract IParseState |
createParseState(IParseState parent)
Create a single parse state for this language. |
protected void |
flushCache(java.lang.String delimiterGroupName)
Clear the lexeme cache up to and including the specified delimiter. |
int |
getEndingOffset()
getEndingOffset |
java.lang.String |
getLanguage()
Get this parser's language type |
ILanguageChangeListener |
getLanguageChangeListener()
getChangeLanguageEventHandler |
protected LexemeList |
getLexemeList()
getLexemList |
ILexer |
getLexer()
Get the lexer associated with this parser |
protected Lexeme |
getNextLexemeInLanguage()
getNextLexemeInLanguage |
protected IParseNodeFactory |
getParseNodeFactory()
getParseNodeFactory |
IParser |
getParserForMimeType(java.lang.String language)
getParserForLanguage |
protected IParseState |
getParseState()
getParseState |
protected boolean |
hasParent()
hasParent |
abstract void |
initializeLexer()
Perform any initializations on the lexer now that it has been created |
protected void |
initializeLexers()
initializeLexers |
protected boolean |
inSet(int[] set)
Determine if the current lexeme is in the specified set |
protected boolean |
isEOS()
Determine if we are at the end of the source we are currently parsing |
protected boolean |
isType(int type)
Determine if the current lexeme is of the given type |
IParseNode |
parse(IParseState parseState)
Parse the edit to the source document encapsulated within the IParseState |
abstract void |
parseAll(IParseNode parentNode)
parseOneStatement |
protected void |
removeLexeme(Lexeme lexeme)
removeLexeme |
void |
setLanguageChangeListener(ILanguageChangeListener eventHandler)
setChangeLanguageEventHandler |
protected void |
throwParseError(java.lang.String message)
Throw a parse exception |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Lexeme EOS
protected Lexeme currentLexeme
| Constructor Detail |
|---|
protected AbstractParser(java.lang.String language)
throws ParserInitializationException
language - -
language mime type
ParserInitializationException| Method Detail |
|---|
protected void addChildParser(IParser child)
child -
protected void addChildParsers()
throws ParserInitializationException
ParserInitializationException
protected void addGrammars(ILexerBuilder lexerBuilder)
throws LexerException
lexerBuilder -
LexerExceptionprotected void addLexeme(Lexeme lexeme)
lexeme -
public abstract void addLexerGrammar(ILexerBuilder builder)
throws LexerException
addLexerGrammar in interface IParserbuilder - The lexer builder being used to generate this language's lexer
LexerException
protected void advance()
throws LexerException
LexerException
protected void assertAndAdvance(int type,
java.lang.String errorKey)
throws LexerException,
java.text.ParseException
type - The name index to test against the current lexemeerrorKey - A key used to look up an error message from our error property list
LexerException
java.text.ParseException
protected void assertInSet(int[] set,
java.lang.String errorKey)
throws java.text.ParseException
set - The target set of lexeme type indexes to test againsterrorKey - A key used to look up an error message from our error property list
java.text.ParseException
protected void assertType(int type,
java.lang.String errorKey)
throws java.text.ParseException
type - The type index to compare against the current tokenerrorKey - A key used to look up an error message from our error property list
java.text.ParseException
public void changeLanguage(java.lang.String mimeType,
int offset,
IParseNode parentNode)
throws LexerException,
java.text.ParseException
IParser
changeLanguage in interface IParserparentNode - TODO
LexerException
java.text.ParseExceptionIParser.changeLanguage(java.lang.String, int, IParseNode)protected abstract ITokenList createLanguageTokenList()
public abstract IParseState createParseState(IParseState parent)
IParser
createParseState in interface IParserIParser.createParseState(com.aptana.ide.parsing.IParseState)
protected void flushCache(java.lang.String delimiterGroupName)
throws LexerException
delimiterGroupName -
LexerExceptionpublic int getEndingOffset()
public java.lang.String getLanguage()
getLanguage in interface IParserpublic ILanguageChangeListener getLanguageChangeListener()
IParser
getLanguageChangeListener in interface IParserIParser.getLanguageChangeListener()protected LexemeList getLexemeList()
public ILexer getLexer()
getLexer in interface IParser
protected Lexeme getNextLexemeInLanguage()
throws LexerException
LexerExceptionprotected IParseNodeFactory getParseNodeFactory()
public IParser getParserForMimeType(java.lang.String language)
getParserForMimeType in interface IParserlanguage -
protected IParseState getParseState()
protected boolean hasParent()
public abstract void initializeLexer()
throws LexerException
initializeLexer in interface IParserLexerException
protected void initializeLexers()
throws LexerException
LexerExceptionprotected boolean inSet(int[] set)
set - The target set of lexeme name indexes to test against
protected boolean isEOS()
protected boolean isType(int type)
type - The type to test against the current lexeme
public IParseNode parse(IParseState parseState)
throws LexerException
IParser
parse in interface IParserLexerExceptionIParser.parse(com.aptana.ide.parsing.IParseState)
public abstract void parseAll(IParseNode parentNode)
throws java.text.ParseException,
LexerException
parseAll in interface IParserparentNode -
java.text.ParseException
LexerExceptionprotected void removeLexeme(Lexeme lexeme)
lexeme - public void setLanguageChangeListener(ILanguageChangeListener eventHandler)
IParser
setLanguageChangeListener in interface IParserIParser.setLanguageChangeListener(com.aptana.ide.parsing.ILanguageChangeListener)
protected void throwParseError(java.lang.String message)
throws java.text.ParseException
message - The exception message
java.text.ParseException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||