|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsav.z.Statement
An object that represents a Zigzag statement of 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 |
Fields inherited from interface sav.outfit.Lexis |
BASE, BRACE, BRACE_TERM, BRACKET, BRACKET_TERM, CATEGORY, COLON, COMMA, DECLARATION, DECLARED, DESCRIPTIVE, DEVS, DIVIDE, ELLIPSIS, EQUALITY, EXTRACTION, FILE, FILED, FUNCTION, INEQUALITY, INTERNAL, KEYS, LEFT_SLASH, MDERIVABLE, NONE, NUMBER, P1, P2, PARENTHESIS, PARENTHESIS_TERM, POINT, PROCEDURE, QUOTE, RANGE, REVERSE_SOLIDUS, SPACE, SPECIFICATION, STRING, TERMINATION, VARIABLE, VDERIVABLE, VERTICAL_LINE, 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 |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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()
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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |