com.google.streamhtmlparser.impl
Class JavascriptParserImpl

java.lang.Object
  extended by com.google.streamhtmlparser.impl.GenericParser
      extended by com.google.streamhtmlparser.impl.JavascriptParserImpl
All Implemented Interfaces:
JavascriptParser, Parser

public class JavascriptParserImpl
extends GenericParser
implements JavascriptParser

Many comments copied almost verbatim from the original C version.


Field Summary
 
Fields inherited from class com.google.streamhtmlparser.impl.GenericParser
columnNumber, currentState, initialState, intToExtStateTable, lineNumber, parserStateTable
 
Fields inherited from interface com.google.streamhtmlparser.JavascriptParser
STATE_COMMENT, STATE_DQ, STATE_Q, STATE_REGEXP, STATE_TEXT
 
Fields inherited from interface com.google.streamhtmlparser.Parser
STATE_ERROR
 
Constructor Summary
JavascriptParserImpl()
          Creates a JavascriptParserImpl object.
JavascriptParserImpl(JavascriptParserImpl aJavascriptParserImpl)
          Creates a JavascriptParserImpl object that is a copy of the one provided.
 
Method Summary
protected  com.google.streamhtmlparser.impl.InternalState handleEnterState(com.google.streamhtmlparser.impl.InternalState currentState, com.google.streamhtmlparser.impl.InternalState expectedNextState, char input)
          Invoked when the parser enters a new state.
protected  com.google.streamhtmlparser.impl.InternalState handleExitState(com.google.streamhtmlparser.impl.InternalState currentState, com.google.streamhtmlparser.impl.InternalState expectedNextState, char input)
          Invoked when the parser exits a state.
protected  com.google.streamhtmlparser.impl.InternalState handleInState(com.google.streamhtmlparser.impl.InternalState currentState, char input)
          Invoked for each character read when no state change occured.
 void reset()
          Reset the parser back to its initial default state.
 
Methods inherited from class com.google.streamhtmlparser.impl.GenericParser
getColumnNumber, getLineNumber, getState, parse, parse, record, setColumnNumber, setLineNumber, setNextState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.streamhtmlparser.Parser
getColumnNumber, getLineNumber, getState, parse, parse, setColumnNumber, setLineNumber
 

Constructor Detail

JavascriptParserImpl

public JavascriptParserImpl()
Creates a JavascriptParserImpl object.


JavascriptParserImpl

public JavascriptParserImpl(JavascriptParserImpl aJavascriptParserImpl)
Creates a JavascriptParserImpl object that is a copy of the one provided.

Parameters:
aJavascriptParserImpl - the JavascriptParserImpl to copy
Method Detail

reset

public void reset()
Description copied from class: GenericParser
Reset the parser back to its initial default state.

Specified by:
reset in interface Parser
Overrides:
reset in class GenericParser

handleEnterState

protected com.google.streamhtmlparser.impl.InternalState handleEnterState(com.google.streamhtmlparser.impl.InternalState currentState,
                                                                          com.google.streamhtmlparser.impl.InternalState expectedNextState,
                                                                          char input)
Description copied from class: GenericParser
Invoked when the parser enters a new state.

Overrides:
handleEnterState in class GenericParser
Parameters:
currentState - the current state of the parser
expectedNextState - the next state according to the state table definition
input - the last character parsed
Returns:
the state to change to, could be the same as the expectedNextState provided

handleExitState

protected com.google.streamhtmlparser.impl.InternalState handleExitState(com.google.streamhtmlparser.impl.InternalState currentState,
                                                                         com.google.streamhtmlparser.impl.InternalState expectedNextState,
                                                                         char input)
Description copied from class: GenericParser
Invoked when the parser exits a state.

Overrides:
handleExitState in class GenericParser
Parameters:
currentState - the current state of the parser
expectedNextState - the next state according to the state table definition
input - the last character parsed
Returns:
the state to change to, could be the same as the expectedNextState provided

handleInState

protected com.google.streamhtmlparser.impl.InternalState handleInState(com.google.streamhtmlparser.impl.InternalState currentState,
                                                                       char input)
Description copied from class: GenericParser
Invoked for each character read when no state change occured.

Overrides:
handleInState in class GenericParser
Parameters:
currentState - the current state of the parser
input - the last character parsed
Returns:
the state to change to, could be the same as the expectedNextState provided


Copyright © 2010-2012 Google. All Rights Reserved.