Object-oriented Parser System
v3.6

oops3
Class Utils

Object
  extended by Utils
All Implemented Interfaces:
Symbols
Direct Known Subclasses:
Gen, Main, Visitor

public abstract class Utils
extends Object
implements Symbols

useful functions.

Version:
3.5.1

Field Summary
protected  boolean error
          true if there was an error.
 
Fields inherited from interface Symbols
badInput, endOfFile, firstSymbol, noInput
 
Constructor Summary
Utils()
           
 
Method Summary
static String className(Object o)
          return simplified class name.
protected  void error(Parser.Node node, String message)
          writes error message with (nonzero) position from node.
protected  void error(String message)
          writes error message, sets error.
static String fromString(String s)
          return internal representation of the characters of an external string.
 boolean getError()
           
protected  void message(String message)
          should be overwritten to redirect all messages.
static void testScanner(PrintWriter out, Parser parser, Scanner scanner)
          Scanner test driver, reads from scanner and prints to out.
static String toChars(Object o)
          return external representation of the characters of a string.
static String toString(Parser parser, BitSet set)
          return external representation of a Symbols, Literal, and Pattern set.
static String toString(String s, char delim)
          return external representation of a string (enclosed in quotes).
protected  void warning(Parser.Node node, String message)
          writes warning message with (nonzero) position from node.
protected  void warning(String message)
          writes warning message.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

error

protected boolean error
true if there was an error.

See Also:
error(java.lang.String)
Constructor Detail

Utils

public Utils()
Method Detail

getError

public boolean getError()

toString

public static String toString(String s,
                              char delim)
return external representation of a string (enclosed in quotes).

Parameters:
delim - single or double quote to surround the result.

toChars

public static String toChars(Object o)
return external representation of the characters of a string.


toString

public static String toString(Parser parser,
                              BitSet set)
return external representation of a Symbols, Literal, and Pattern set.


fromString

public static String fromString(String s)
return internal representation of the characters of an external string.


className

public static String className(Object o)
return simplified class name.


testScanner

public static void testScanner(PrintWriter out,
                               Parser parser,
                               Scanner scanner)
                        throws IOException
Scanner test driver, reads from scanner and prints to out.

Throws:
IOException

message

protected void message(String message)
should be overwritten to redirect all messages.


error

protected void error(String message)
writes error message, sets error.

See Also:
message(java.lang.String)

error

protected void error(Parser.Node node,
                     String message)
writes error message with (nonzero) position from node.


warning

protected void warning(String message)
writes warning message.

See Also:
message(java.lang.String)

warning

protected void warning(Parser.Node node,
                       String message)
writes warning message with (nonzero) position from node.



(c) 2008 Axel T. Schreiner