home *** CD-ROM | disk | FTP | other *** search
- import java.io.PrintStream;
-
- public class JScriptExprConst extends JScriptExprNode {
- private String aConst;
- private JSbxValue aValue;
-
- public JScriptExprConst(String var1, JSbxValue var2) {
- this(var1, var2, (JScriptExprNode)null);
- }
-
- public JScriptExprConst(String var1, JSbxValue var2, JScriptExprNode var3) {
- super(var3);
- this.aConst = new String(var1);
- this.aValue = (JSbxValue)(var2 != null ? var2.clone() : null);
- }
-
- public boolean IsConstant() {
- return true;
- }
-
- public boolean IsLValue() {
- return false;
- }
-
- public void Show(PrintStream var1, int var2) {
- var1.println("{const:" + this.aConst + "}");
- }
-
- protected void DoGenerateCode(JScriptCodeGenParam var1) throws JScriptExprParserException, JSbxException {
- switch (this.aValue.GetType()) {
- case 1:
- throw new JScriptExprParserException(1015);
- case 2:
- var1.AddCode(new JSP_ObjectConst(this.aValue.GetObject()));
- return;
- case 4:
- var1.AddCode(new JSP_StringConst(this.aValue.GetString()));
- return;
- case 8:
- var1.AddCode(new JSP_BoolConst(this.aValue.GetBool()));
- return;
- case 16:
- var1.AddCode(new JSP_NumConst(this.aValue.GetDouble()));
- return;
- default:
- }
- }
-
- protected void DoPreGenerateCode(JScriptCodeGenParam var1) throws JScriptExprParserException, JSbxException {
- }
-
- protected void DoPostGenerateCode(JScriptCodeGenParam var1) throws JScriptExprParserException, JSbxException {
- }
- }
-