org.millscript.millscript.syntax
Class XMLElementSyntax

java.lang.Object
  extended by org.millscript.millscript.syntax.Syntax
      extended by org.millscript.millscript.syntax.PostfixSyntax
          extended by org.millscript.millscript.syntax.BothfixSyntax
              extended by org.millscript.millscript.syntax.XMLElementSyntax
All Implemented Interfaces:
PostfixSyntaxInterface, PrefixSyntaxInterface

public final class XMLElementSyntax
extends BothfixSyntax

This class implements syntax for the < operator. This character has both a prefix and postfix meaning. In postfix form, it is used as a relation operator, the less-than operator. In prefix form, it is used as the opening character for either an XML element or XML comment.

Postfix: Relational operator
E < E'
Prefix: XML Element
<E E'=E'' E'''=E''''>
<!-- comment -->

See Also:
ApplyExpr, XMLExpr

Constructor Summary
XMLElementSyntax()
           
 
Method Summary
 Expr postfix(java.lang.String sym, int prec, Expr lhs, Parser parser)
          Parse the syntax for the specified symbol, using the specified Parser.
 Expr prefix(java.lang.String sym, Parser parser)
          Parse the syntax for the specified symbol, using the specified Parser.
 XMLExpr readXML(Parser parser)
          Parse an XML expression.
 
Methods inherited from class org.millscript.millscript.syntax.PostfixSyntax
getPrecedence, setPrec
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLElementSyntax

public XMLElementSyntax()
Method Detail

postfix

public Expr postfix(java.lang.String sym,
                    int prec,
                    Expr lhs,
                    Parser parser)
Description copied from interface: PostfixSyntaxInterface
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. As this is postfix syntax, we are also supplied the expression on the left hand side of the symbol along with the current precedence we should parse to.

Specified by:
postfix in interface PostfixSyntaxInterface
Specified by:
postfix in class PostfixSyntax
Parameters:
sym - the symbol to parse this syntax for
prec - the current precedence we should parse to
lhs - the expression on the left hand side of the specified symbol
parser - Parser to parse from, i.e. the source to parse from
Returns:
an expression for this syntax
See Also:
PostfixSyntaxInterface.postfix(java.lang.String, int, org.millscript.millscript.expr.Expr, org.millscript.millscript.syntax.Parser)

readXML

public XMLExpr readXML(Parser parser)
Parse an XML expression. XML syntax requires that the tag starts with a name, followed by optional attributes, then a closing character sequence. There are two alternatives for the closing sequence, depending on whether the tag is an empty-element tag or a start/end tag.

Parameters:
parser - Parser to parse from, i.e. the source to parse from
Returns:
an XML expression based on the parsed source

prefix

public Expr 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 BothfixSyntax
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.