com.agentfactory.common.parser
Interface Scanner


public interface Scanner

This is a public interface that should be implemented by all syntax scanners. Concrete implementations of this class should implement a scanning algorithm that breaks the source program into a list of relevant Token objects. The scanner should then be designed to return, on request, the set of tokens that corresponds to an individual statement in the language. Finally, concrete scanner instances are also responsible for detecting when the ends of the source program has been reached.


Method Summary
 boolean completed()
          This method check whether or not the end of the program has been reached.
 java.util.List<Token> getNextStatement()
          This is the method that is responsible for returning an ordered list of tokens that corresponds to the next statement in the program.
 void init(java.lang.String source, java.lang.String resource)
           
 

Method Detail

init

void init(java.lang.String source,
          java.lang.String resource)

getNextStatement

java.util.List<Token> getNextStatement()
This is the method that is responsible for returning an ordered list of tokens that corresponds to the next statement in the program.

Returns:
a list of Token objects

completed

boolean completed()
This method check whether or not the end of the program has been reached.

Returns:
true if the end is reached, false otherise