|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines the common services provided by structures which can contain ActionScript 'statements'.
Method Summary | |
void |
addComment(java.lang.String text)
Adds a single-line comment to list of statements being generated |
void |
addStmt(java.lang.String statement)
Checks the syntax of the given code, and then adds the statement to the end of the current block. |
StatementContainer |
newDoWhile(java.lang.String condition)
Adds a do-while-loop to the code. |
StatementContainer |
newFor(java.lang.String init,
java.lang.String condition,
java.lang.String update)
Adds a C-style for-loop to the code. |
StatementContainer |
newForIn(java.lang.String init,
java.lang.String list)
Adds a for-in-loop to the code. |
ASIfStatement |
newIf(java.lang.String condition)
Adds an if-statement to the code. |
ASSwitchStatement |
newSwitch(java.lang.String condition)
Adds a switch-statement to the code. |
StatementContainer |
newWhile(java.lang.String condition)
Adds a while-loop to the code. |
Method Detail |
public void addStmt(java.lang.String statement)
SyntaxException
- if the syntax of the given code fragment is
incorrect.public void addComment(java.lang.String text)
text
- the text of the comment (minus the initial '//') which
must not include any newline characters.public ASIfStatement newIf(java.lang.String condition)
block.newIf("test()").addStmt("trace('success')")results in
if (test()) { trace('success'); }
public StatementContainer newFor(java.lang.String init, java.lang.String condition, java.lang.String update)
block.newFor("var i=0", "i<10", "i++").addStmt("trace(i)")results in
for (var i=0; i<10; i++) { trace(i); }
public StatementContainer newForIn(java.lang.String init, java.lang.String list)
block.newForIn("var i", "myArray").addStmt("trace(i)")results in
for (var i in myArray) { trace(i); }
public StatementContainer newWhile(java.lang.String condition)
block.newWhile("test()").addStmt("trace('hi there')")results in
while (test()) { trace('hi there'); }
public StatementContainer newDoWhile(java.lang.String condition)
block.newDoWhile("test()").addStmt("trace('hi there')")results in
do { trace('hi there'); } while (test());
public ASSwitchStatement newSwitch(java.lang.String condition)
ASSwitchStatement
for more information.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |