|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Sav.Z.Statement
An object that represents a Z statement and forms a Script. Statement corresponds to some string fragment, usually separated by ";".
Below the code prints Statements of a Script and marks the failure Statements.
Session ss = new Session(); Script scr = new Script(text); ss.analyse(scr): Statement[] stmArray = scr.statements(); if (ss.hasErrors()) { ... } Statement stm = null; try { ss.execute(scr); } catch (ZException exc) { stm = ss.curStatement(); } System.out.println("EXECUTION TRACE"); for (int i = 0; i < stmArray.length; ++i) { System.out.print(stmArray[i]); if (stmArray[i].hasFailures()) System.out.println(" - FAILURE"); else System.out.println(); if (stmArray[i] == stm) { System.out.print("INTERRUPTION LINE: " + stm.getLineNumber()); break; } }
Script.statements()
Field Summary | |
static int |
BASE
|
static int |
BRACE
|
static int |
BRACE_TERM
|
static int |
BRACKET
|
static int |
BRACKET_TERM
|
static int |
CATEGORY
|
static int |
COLON
|
static int |
COMMA
|
static int |
CONJUNCTIVE
|
static int |
DECLARATION
|
static int |
DECLARED
|
static int |
DELIVERED
|
static int |
DESCRIPTIVE
|
static int |
DIVIDE
|
static int |
ELLIPSIS
|
static int |
EQUALITY
|
static int |
EXTRACTION
|
static int |
FILE
|
static int |
INEQUALITY
|
static java.lang.String |
KEYS
|
static int |
LEFT_SLASH
|
static int |
MULTITUDE
|
static int |
NONE
|
static int |
NUMBER
|
static int |
P1
|
static int |
P2
|
static int |
PARENTHESIS
|
static int |
PARENTHESIS_TERM
|
static int |
PROCEDURE
|
static int |
RANGE
|
static int |
RIGHT_SLASH
|
static int |
SPACE
|
static int |
SPECIFICATION
|
static int |
STRING
|
static int |
TERMINATION
|
static int |
WORD
|
Method Summary | |
int |
begin()
Returns begin position of a Statement in a text string. |
int |
end()
Returns end position of a Statement in a text string. |
Error[] |
errors()
Returns array of Errors produced by Script analysis. |
java.lang.String |
express()
Returns string of a Statement expressions from expressBegin() to expressEnd() position. |
int |
expressBegin()
Returns a begin position of a Statement expressions in a text string. |
int |
expressEnd()
Returns end position of a Statement expressions in a text string. |
Failure[] |
failures()
Returns array of Failures produced by Script execution. |
int |
getLineNumber()
Returns line number of a Statement in a Script. |
boolean |
hasErrors()
Tests to see if Statement has Errors. |
boolean |
hasFailures()
Tests to see if Statement has Failures. |
boolean |
hasWarnings()
Tests to see if Statement has Warnings. |
boolean |
isEmpty()
Tests if a Statement is empty. |
java.lang.String |
rightExpression()
Returns string of corrected Statement expression (without ";\n"), or returns "" empty string. |
java.lang.String |
toString()
Returns string of a Statement. |
Warning[] |
warnings()
Returns array of Warnings, namely Errors or Failures, produced by Script analysis or execution. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String KEYS
public static final int NONE
public static final int CATEGORY
public static final int PROCEDURE
public static final int MULTITUDE
public static final int FILE
public static final int BASE
public static final int SPECIFICATION
public static final int ELLIPSIS
public static final int NUMBER
public static final int STRING
public static final int WORD
public static final int SPACE
public static final int BRACE
public static final int BRACKET
public static final int PARENTHESIS
public static final int BRACE_TERM
public static final int BRACKET_TERM
public static final int PARENTHESIS_TERM
public static final int RANGE
public static final int COLON
public static final int DIVIDE
public static final int LEFT_SLASH
public static final int RIGHT_SLASH
public static final int EXTRACTION
public static final int INEQUALITY
public static final int EQUALITY
public static final int DECLARATION
public static final int COMMA
public static final int TERMINATION
public static final int P1
public static final int DESCRIPTIVE
public static final int CONJUNCTIVE
public static final int P2
public static final int DELIVERED
public static final int DECLARED
Method Detail |
public boolean isEmpty()
true
, if Statement is formed by empty or error stringpublic int expressBegin()
public int expressEnd()
public java.lang.String express()
public int begin()
public int end()
public java.lang.String toString()
toString
in class java.lang.Object
public int getLineNumber()
public java.lang.String rightExpression()
public boolean hasWarnings()
warnings()
public boolean hasErrors()
errors()
public boolean hasFailures()
failures()
public Warning[] warnings()
hasWarnings()
public Error[] errors()
hasErrors()
public Failure[] failures()
hasFailures()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |