net.sf.sasl.language.placeholder.syntax
Class PlaceholderScriptScanner

java.lang.Object
  extended by net.sf.sasl.language.placeholder.syntax.PlaceholderScriptScanner
All Implemented Interfaces:
java_cup.runtime.Scanner

public class PlaceholderScriptScanner
extends Object
implements java_cup.runtime.Scanner

Small adapter to a jflex generated placeholder scanner.

Since:
0.0.1 (sasl-common-aspect-library)
Author:
Philipp Förmer

Constructor Summary
PlaceholderScriptScanner(InputStream inputStream)
          Creates a scanner that reads the input from the given stream.
PlaceholderScriptScanner(String input)
          Creates a scanner that reads the input from the given string.
 
Method Summary
 java_cup.runtime.ComplexSymbolFactory.ComplexSymbol getCurrentSymbol()
          Returns the current symbol that was read via a call to next_token().
 boolean isScanErrorOccured()
          Returns true if a fatal scan error occured during the last call of next_token().
 java_cup.runtime.Symbol next_token()
          Reads the next symbol from the input and returns it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlaceholderScriptScanner

public PlaceholderScriptScanner(String input)
                         throws IllegalArgumentException
Creates a scanner that reads the input from the given string.

Parameters:
input - non null
Throws:
IllegalArgumentException
Since:
0.0.1 (sasl-common-aspect-library)

PlaceholderScriptScanner

public PlaceholderScriptScanner(InputStream inputStream)
                         throws IllegalArgumentException
Creates a scanner that reads the input from the given stream.

Parameters:
inputStream - non null
Throws:
IllegalArgumentException
Since:
0.0.1 (sasl-common-aspect-library)
Method Detail

next_token

public java_cup.runtime.Symbol next_token()
                                   throws ScanException
Reads the next symbol from the input and returns it.

Specified by:
next_token in interface java_cup.runtime.Scanner
Returns:
non null
Throws:
ScanException - if a fatal scan error occurs, for example the input could not be matched.
Since:
0.0.1 (sasl-common-aspect-library)

getCurrentSymbol

public java_cup.runtime.ComplexSymbolFactory.ComplexSymbol getCurrentSymbol()
Returns the current symbol that was read via a call to next_token(). Returns null if the next_token() was never called. If a fatal scan error occured that it points to the symbol that was last successfully read.

Returns:
null or non null.
Since:
0.0.1 (sasl-common-aspect-library)

isScanErrorOccured

public boolean isScanErrorOccured()
Returns true if a fatal scan error occured during the last call of next_token(). False else.

Returns:
true or false.
Since:
0.0.1 (sasl-common-aspect-library)


Copyright © 2010. All Rights Reserved.