net.sourceforge.czt.parser.z
Class OperatorScanner

java.lang.Object
  extended by net.sourceforge.czt.parser.z.OperatorScanner
All Implemented Interfaces:
net.sourceforge.czt.java_cup.runtime.Scanner

public class OperatorScanner
extends java.lang.Object
implements net.sourceforge.czt.java_cup.runtime.Scanner

This is an operator lexer (part of context-sensitive lexis) for Z specifications in unicode format.

According to the ISO Standard for Z, the lexis for Z specifications consists of two phases: the context-free lexis and the context-sensitive lexis. This class is an implementation of sections 7.4.4 and 7.5 of the ISO Z standard, which describes the context-sensitive lexis.

This class transforms a stream of tokens into another stream of tokens. It translates words (DECORWORD or DECLWORD tokens) into operator tokens like L, I, etc. There are two cases in which a transformation to operator tokens is not performed:

The transformation into operator tokens requires a lookup in an operator table, which must be set appropriately before the lookup is performed. This is usually done by the parser who updates the operator table while parsing. This is not standard conforming since the operator table gets updated when an operator template is parsed while the standard requires that the scope of the associations between words and operator tokens is the whole of the section in which the operator template appears (not just from the operator template onwards).


Method Summary
 OpTable getOperatorTable()
           
protected  net.sourceforge.czt.java_cup.runtime.Symbol localLookup(net.sourceforge.czt.java_cup.runtime.Symbol symbol)
          Lookup the value of this symbol
 net.sourceforge.czt.java_cup.runtime.Symbol next_token()
           
 void setOperatorTable(OpTable table)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getOperatorTable

public OpTable getOperatorTable()

setOperatorTable

public void setOperatorTable(OpTable table)

next_token

public net.sourceforge.czt.java_cup.runtime.Symbol next_token()
                                                       throws java.lang.Exception
Specified by:
next_token in interface net.sourceforge.czt.java_cup.runtime.Scanner
Throws:
java.lang.Exception

localLookup

protected net.sourceforge.czt.java_cup.runtime.Symbol localLookup(net.sourceforge.czt.java_cup.runtime.Symbol symbol)
Lookup the value of this symbol



Copyright © 2003-2007 Community Z Tools Project. All Rights Reserved.