home *** CD-ROM | disk | FTP | other *** search
- import java.io.PrintStream;
-
- public class JScriptExprTerm extends JScriptExprNode {
- private String aTermStrg;
- private JScriptParserTerm aTerm;
-
- public JScriptExprTerm(String var1) {
- this(var1, (JScriptExprNode)null, (JScriptParserTerm)null);
- }
-
- public JScriptExprTerm(String var1, JScriptParserTerm var2) {
- this(var1, (JScriptExprNode)null, var2);
- }
-
- public JScriptExprTerm(JScriptParserTerm var1) {
- this(new String("JScriptParserTerm"), (JScriptExprNode)null, var1);
- }
-
- public JScriptExprTerm(String var1, JScriptExprNode var2, JScriptParserTerm var3) {
- super(var2);
- this.aTermStrg = new String(var1);
- this.aTerm = var3;
- }
-
- public boolean IsConstant() {
- return false;
- }
-
- public boolean IsLValue() {
- return this.aTerm != null;
- }
-
- public void Show(PrintStream var1, int var2) {
- if (this.aTerm != null) {
- var1.print("{term:");
- this.aTerm.Show(var1);
- var1.println("}");
- } else {
- var1.println("{term:" + this.aTermStrg + "}");
- }
- }
-
- protected void DoGenerateCode(JScriptCodeGenParam var1) throws JScriptExprParserException, JScriptParserException, JSbxException {
- if (this.aTerm != null) {
- if (var1.IsExpressionInForInStatement() && !((JScriptExprNode)this).HasParent() && this.aTerm.GetSubTermCount() == 1 && this.aTerm.GetSubTerm(0).GetNumberOfCallOrIndex() == 0) {
- var1.AddCode(new JSP_CreateGlobal(this.aTerm.GetSubTerm(0).aIdentifier.aIdentifierName, -1));
- }
-
- this.aTerm.GenerateRValueCode(var1);
- } else {
- CreateOldCodeException();
- }
- }
-
- protected void DoGenerateLValueCode(JScriptCodeGenParam var1) throws JScriptExprParserException, JScriptParserException, JSbxException {
- if (this.aTerm != null) {
- this.aTerm.GenerateLValueCode(var1);
- } else {
- CreateOldCodeException();
- }
- }
-
- protected void DoPreGenerateCode(JScriptCodeGenParam var1) throws JScriptExprParserException, JScriptParserException, JSbxException {
- if (this.aTerm != null) {
- this.aTerm.GeneratePreCode(var1);
- } else {
- CreateOldCodeException();
- }
- }
-
- protected void DoPostGenerateCode(JScriptCodeGenParam var1) throws JScriptExprParserException, JScriptParserException, JSbxException {
- if (this.aTerm != null) {
- this.aTerm.GeneratePostCode(var1);
- } else {
- CreateOldCodeException();
- }
- }
-
- private static final void CreateOldCodeException() throws JScriptExprParserException {
- System.out.println("WARNING: TERM has no JScirptParserTerm !!!");
- throw new JScriptExprParserException(42040, "alter Code aufgerufen !!!");
- }
- }
-