org.millscript.millscript.syntax
Class ForSyntax

java.lang.Object
  extended by org.millscript.millscript.syntax.Syntax
      extended by org.millscript.millscript.syntax.PrefixSyntax
          extended by org.millscript.millscript.syntax.ForSyntax
All Implemented Interfaces:
PrefixSyntaxInterface

public final class ForSyntax
extends PrefixSyntax

This class implements for loop syntax. General syntax is.

for <condition1>; <condition2>; ... <conditionN> do ... finally ... endfor <condition> ::= where <expr> ::= while <expr> else <expr> ::= until <expr> then <expr> <binding> ::= condition ::= <name> in <expr> ::= <name> & <name> in <expr> ::= <name> from <expr> [ to <expr> ] ::= <name> from <expr> [ downto <expr> ] <-- not implemented yet

See Also:
ForExpr, ForConditionExpr

Constructor Summary
ForSyntax()
           
 
Method Summary
 ForExpr prefix(java.lang.String sym, Parser parser)
          Parse the syntax for the specified symbol, using the specified Parser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForSyntax

public ForSyntax()
Method Detail

prefix

public ForExpr prefix(java.lang.String sym,
                      Parser parser)
Description copied from interface: PrefixSyntaxInterface
Parse the syntax for the specified symbol, using the specified Parser. The symbol is specified because different symbols may share the same syntax, but result in slightly different expressions. The Parser is supplied as the source to parse from.

Specified by:
prefix in interface PrefixSyntaxInterface
Specified by:
prefix in class PrefixSyntax
Parameters:
sym - the symbol to parse this syntax for
parser - Parser to parse from, i.e. the source to parse from
Returns:
an expression for this syntax
See Also:
PrefixSyntaxInterface.prefix(java.lang.String, org.millscript.millscript.syntax.Parser)


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.