You are viewing a plain text version of this content. The canonical link for it is here.
Posted to imperius-commits@incubator.apache.org by ke...@apache.org on 2008/01/11 18:57:14 UTC
svn commit: r611261 [7/43] - in /incubator/imperius/trunk: ./
imperius-javaspl/ imperius-javaspl/src/main/java/org/apache/imperius/javaspl/
imperius-splcore/
imperius-splcore/src/main/antlr/org/apache/imperius/spl/parser/compiler/
imperius-splcore/src/...
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/MacroSymbol.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/MacroSymbol.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/MacroSymbol.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/MacroSymbol.java Fri Jan 11 10:56:30 2008
@@ -1,193 +1,193 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <pr...@in.ibm.com>
- *
- */
-
-
-
-package org.apache.imperius.spl.parser.compiler.symboltable;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.statements.impl.MacroDefinition;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class MacroSymbol implements Symbol
-{
- private String _macroName;
- private TypeInfo _returnType = new TypeInfo();
- private List _argTypeList;
- private MacroDefinition _macroDefn;
- private static Logger logger = SPLLogger.getSPLLogger().getLogger();
- private static final String sourceClass="MacroSymbol";
- private boolean _isArray=false;
-
- public MacroSymbol(String macroName, TypeInfo retType, List argTypes, MacroDefinition md)
- throws SPLException
- {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "MacroSymbol");
-
- this._macroName = macroName;
- this._returnType.copy(retType);
- _returnType.setReferenceTypeName(md.getReferenceTypeName());
- this._argTypeList = argTypes;
- this._macroDefn = md;
- if(md.isArray())
- {
- this._isArray=true;
- }
- //System.out.println("new MacroSymbol : "+macroName+" "+retType+" "+argTypes);
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "MacroSymbol");
-
-
- }
-
- public TypeInfo getType() {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
- // TODO Auto-generated method stub
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
- return _returnType;
- }
-
- public Object getValue() {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getValue");
-
- // TODO Auto-generated method stub
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getValue");
-
- return null;
- }
-
- public List getArgTypeList() {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getArgTypeList");
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getArgTypeList");
-
-
- return _argTypeList;
- }
-
- public void setArgTypeList(List argTypeList) {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArgTypeList");
-
- _argTypeList = argTypeList;
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArgTypeList");
-
-
- }
-
- public MacroDefinition getMacroDefn() {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMacroDefn");
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMacroDefn");
-
-
- return _macroDefn;
- }
-
- public void setMacroDefn(MacroDefinition macroDefn) {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMacroDefn");
-
-
- _macroDefn = macroDefn;
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroDefn");
-
- }
-
- public String getMacroName() {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMacroName");
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMacroName");
-
-
- return _macroName;
- }
-
- public void setMacroName(String macroName) {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMacroName");
- _macroName = macroName;
-
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroName");
-
- }
-
-
- public void setReturnType(TypeInfo returnType) {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setReturnType");
-
- _returnType.copy(returnType);
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setReturnType");
-
- }
-
- public boolean isArray() {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
-
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
- return _returnType.getIsArray();
- }
-
- public boolean isKey() {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isKey");
-
- // TODO Auto-generated method stub
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isKey");
-
- return false;
- }
-
- public boolean isClassSymbol() {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isClassSymbol");
-
- // TODO Auto-generated method stub
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isClassSymbol");
-
- return false;
- }
-
- public boolean isArray(boolean isArray)
- {
- return _returnType.getIsArray();
- }
-
- public void setArray(boolean isArray)
- {
- _returnType.setIsArray(isArray);
- }
-
- public String getReferenceTypeName()
- {
- //String referenceTypeName;
- /*try
- {
- referenceTypeName = _macroDefn.getReferenceTypeName();
- } catch (SPLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- referenceTypeName = "";
- }*/
- //return referenceTypeName;
- return _returnType.getReferenceTypeName();
- }
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <pr...@in.ibm.com>
+ *
+ */
+
+
+
+package org.apache.imperius.spl.parser.compiler.symboltable;
+
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.statements.impl.MacroDefinition;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class MacroSymbol implements Symbol
+{
+ private String _macroName;
+ private TypeInfo _returnType = new TypeInfo();
+ private List _argTypeList;
+ private MacroDefinition _macroDefn;
+ private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+ private static final String sourceClass="MacroSymbol";
+ private boolean _isArray=false;
+
+ public MacroSymbol(String macroName, TypeInfo retType, List argTypes, MacroDefinition md)
+ throws SPLException
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "MacroSymbol");
+
+ this._macroName = macroName;
+ this._returnType.copy(retType);
+ _returnType.setReferenceTypeName(md.getReferenceTypeName());
+ this._argTypeList = argTypes;
+ this._macroDefn = md;
+ if(md.isArray())
+ {
+ this._isArray=true;
+ }
+ //System.out.println("new MacroSymbol : "+macroName+" "+retType+" "+argTypes);
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "MacroSymbol");
+
+
+ }
+
+ public TypeInfo getType() {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+ // TODO Auto-generated method stub
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+ return _returnType;
+ }
+
+ public Object getValue() {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getValue");
+
+ // TODO Auto-generated method stub
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getValue");
+
+ return null;
+ }
+
+ public List getArgTypeList() {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getArgTypeList");
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getArgTypeList");
+
+
+ return _argTypeList;
+ }
+
+ public void setArgTypeList(List argTypeList) {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArgTypeList");
+
+ _argTypeList = argTypeList;
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArgTypeList");
+
+
+ }
+
+ public MacroDefinition getMacroDefn() {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMacroDefn");
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMacroDefn");
+
+
+ return _macroDefn;
+ }
+
+ public void setMacroDefn(MacroDefinition macroDefn) {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMacroDefn");
+
+
+ _macroDefn = macroDefn;
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroDefn");
+
+ }
+
+ public String getMacroName() {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMacroName");
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMacroName");
+
+
+ return _macroName;
+ }
+
+ public void setMacroName(String macroName) {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMacroName");
+ _macroName = macroName;
+
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMacroName");
+
+ }
+
+
+ public void setReturnType(TypeInfo returnType) {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setReturnType");
+
+ _returnType.copy(returnType);
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setReturnType");
+
+ }
+
+ public boolean isArray() {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+ return _returnType.getIsArray();
+ }
+
+ public boolean isKey() {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isKey");
+
+ // TODO Auto-generated method stub
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isKey");
+
+ return false;
+ }
+
+ public boolean isClassSymbol() {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isClassSymbol");
+
+ // TODO Auto-generated method stub
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isClassSymbol");
+
+ return false;
+ }
+
+ public boolean isArray(boolean isArray)
+ {
+ return _returnType.getIsArray();
+ }
+
+ public void setArray(boolean isArray)
+ {
+ _returnType.setIsArray(isArray);
+ }
+
+ public String getReferenceTypeName()
+ {
+ //String referenceTypeName;
+ /*try
+ {
+ referenceTypeName = _macroDefn.getReferenceTypeName();
+ } catch (SPLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ referenceTypeName = "";
+ }*/
+ //return referenceTypeName;
+ return _returnType.getReferenceTypeName();
+ }
+
+}
Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/MacroSymbol.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/MethodSymbol.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/MethodSymbol.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/MethodSymbol.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/MethodSymbol.java Fri Jan 11 10:56:30 2008
@@ -1,165 +1,165 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <pr...@in.ibm.com>
- *
- */
-
-
-
-package org.apache.imperius.spl.parser.compiler.symboltable;
-
-import java.util.List;
-
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-
-
-
-
-public class MethodSymbol implements Symbol
-{
- private String _methodName;
- private TypeInfo _returnType = new TypeInfo();
- private List _argList;
- private SPLSymbolTable _methodSymbolTable=null;
-
- public MethodSymbol(String nName,
- int retType,
- boolean isReturnArray,
- String returnReferenceType,
- List argList,
- SPLSymbolTable metSym) throws SPLException
- {
-
-
- _methodName = nName;
- _returnType.setIsArray(isReturnArray);
- _returnType.setReferenceTypeName(returnReferenceType);
- _returnType.setType(retType);
- //_returnType = new TypeInfo(retType,returnReferenceType,isReturnArray);
- _argList=argList;
- _methodSymbolTable = metSym;
-
- }
-
- public MethodSymbol(String nName,
- TypeInfo retType,
- List argTypeList,
- SPLSymbolTable argSymbols)
- {
-
-
- _methodName = nName;
- _returnType.copy(retType);
- _argList=argTypeList;
- _methodSymbolTable=argSymbols;
-
- }
-
- public String getMethodName()
- {
-
- return _methodName;
- }
-
-
- public void setMethodName(String methodName)
- {
-
- _methodName = methodName;
-
-
- }
-
-
- public TypeInfo getType()
- {
-
- return _returnType;
- }
-
- public Object getValue()
- {
-
- return null;
- }
-
-
- public boolean isArray()
- {
-
- return false;
- }
-
-
- public boolean isKey()
- {
-
- return false;
- }
-
-
- public boolean isClassSymbol()
- {
-
- return true;
- }
-
-
- public List getArgumentList()
- {
-
-
- return _argList;
- }
-
-
- public void setArgumentList(List argList)
- {
-
-
- _argList = argList;
-
-
- }
-
-
- public String getReferenceTypeName()
- {
- return _returnType.getReferenceTypeName();
- }
-
- public boolean isReturnArray()
- {
- return _returnType.getIsArray();
- }
-
-
-
- public TypeInfo getReturnType() {
- return _returnType;
- }
-
- public SPLSymbolTable getMethodSymbolTable() {
- return _methodSymbolTable;
- }
-
- public void getMethodSymbolTable(SPLSymbolTable symbolTable) {
- _methodSymbolTable = symbolTable;
- }
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <pr...@in.ibm.com>
+ *
+ */
+
+
+
+package org.apache.imperius.spl.parser.compiler.symboltable;
+
+import java.util.List;
+
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+
+
+
+
+public class MethodSymbol implements Symbol
+{
+ private String _methodName;
+ private TypeInfo _returnType = new TypeInfo();
+ private List _argList;
+ private SPLSymbolTable _methodSymbolTable=null;
+
+ public MethodSymbol(String nName,
+ int retType,
+ boolean isReturnArray,
+ String returnReferenceType,
+ List argList,
+ SPLSymbolTable metSym) throws SPLException
+ {
+
+
+ _methodName = nName;
+ _returnType.setIsArray(isReturnArray);
+ _returnType.setReferenceTypeName(returnReferenceType);
+ _returnType.setType(retType);
+ //_returnType = new TypeInfo(retType,returnReferenceType,isReturnArray);
+ _argList=argList;
+ _methodSymbolTable = metSym;
+
+ }
+
+ public MethodSymbol(String nName,
+ TypeInfo retType,
+ List argTypeList,
+ SPLSymbolTable argSymbols)
+ {
+
+
+ _methodName = nName;
+ _returnType.copy(retType);
+ _argList=argTypeList;
+ _methodSymbolTable=argSymbols;
+
+ }
+
+ public String getMethodName()
+ {
+
+ return _methodName;
+ }
+
+
+ public void setMethodName(String methodName)
+ {
+
+ _methodName = methodName;
+
+
+ }
+
+
+ public TypeInfo getType()
+ {
+
+ return _returnType;
+ }
+
+ public Object getValue()
+ {
+
+ return null;
+ }
+
+
+ public boolean isArray()
+ {
+
+ return false;
+ }
+
+
+ public boolean isKey()
+ {
+
+ return false;
+ }
+
+
+ public boolean isClassSymbol()
+ {
+
+ return true;
+ }
+
+
+ public List getArgumentList()
+ {
+
+
+ return _argList;
+ }
+
+
+ public void setArgumentList(List argList)
+ {
+
+
+ _argList = argList;
+
+
+ }
+
+
+ public String getReferenceTypeName()
+ {
+ return _returnType.getReferenceTypeName();
+ }
+
+ public boolean isReturnArray()
+ {
+ return _returnType.getIsArray();
+ }
+
+
+
+ public TypeInfo getReturnType() {
+ return _returnType;
+ }
+
+ public SPLSymbolTable getMethodSymbolTable() {
+ return _methodSymbolTable;
+ }
+
+ public void getMethodSymbolTable(SPLSymbolTable symbolTable) {
+ _methodSymbolTable = symbolTable;
+ }
+
+}
Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/MethodSymbol.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/PropertySymbol.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/PropertySymbol.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/PropertySymbol.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/PropertySymbol.java Fri Jan 11 10:56:30 2008
@@ -1,123 +1,123 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <pr...@in.ibm.com>
- *
- */
-
-
-
-package org.apache.imperius.spl.parser.compiler.symboltable;
-
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-
-
-
-
-
-public class PropertySymbol implements Symbol
-{
-
- private TypeInfo _dataType = new TypeInfo();
- private String _name;
- private Object _value;
- //private boolean _isArray;
- private boolean _isKey;
- //private String _referenceTypeName;
- private boolean _isPropertyOfClass;
-
- public PropertySymbol(String n,
- int type,
- String referenceType,
- boolean isArray,
- boolean isKey,
- boolean isProp) throws SPLException
- {
- _dataType = new TypeInfo(type,referenceType,isArray);
- _name = n;
- _isKey = isKey;
- _isPropertyOfClass = isProp;
- }
-
- public PropertySymbol(
- String n,
- TypeInfo tp ,
- boolean isKey,
- boolean isProp)
- {
-
- this._name = n;
- this._dataType.copy(tp);
-
- this._isKey = isKey;
- this._isPropertyOfClass = isProp;
-
-
- }
-
- public TypeInfo getType()
- {
-
- return _dataType;
- }
-
- public Object getValue()
- {
-
- return _value;
- }
-
- public void setValue(Object o)
- {
-
- _value = o;
- }
-
-
- public String getName()
- {
-
- return _name;
- }
-
-
- public boolean isArray()
- {
-
- return _dataType.getIsArray();
- }
-
-
- public boolean isKey()
- {
-
- return _isKey;
- }
-
- public boolean isClassSymbol()
- {
-
- return _isPropertyOfClass;
- }
-
- public String getReferenceTypeName()
- {
-
- return _dataType.getReferenceTypeName();
- }
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <pr...@in.ibm.com>
+ *
+ */
+
+
+
+package org.apache.imperius.spl.parser.compiler.symboltable;
+
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+
+
+
+
+
+public class PropertySymbol implements Symbol
+{
+
+ private TypeInfo _dataType = new TypeInfo();
+ private String _name;
+ private Object _value;
+ //private boolean _isArray;
+ private boolean _isKey;
+ //private String _referenceTypeName;
+ private boolean _isPropertyOfClass;
+
+ public PropertySymbol(String n,
+ int type,
+ String referenceType,
+ boolean isArray,
+ boolean isKey,
+ boolean isProp) throws SPLException
+ {
+ _dataType = new TypeInfo(type,referenceType,isArray);
+ _name = n;
+ _isKey = isKey;
+ _isPropertyOfClass = isProp;
+ }
+
+ public PropertySymbol(
+ String n,
+ TypeInfo tp ,
+ boolean isKey,
+ boolean isProp)
+ {
+
+ this._name = n;
+ this._dataType.copy(tp);
+
+ this._isKey = isKey;
+ this._isPropertyOfClass = isProp;
+
+
+ }
+
+ public TypeInfo getType()
+ {
+
+ return _dataType;
+ }
+
+ public Object getValue()
+ {
+
+ return _value;
+ }
+
+ public void setValue(Object o)
+ {
+
+ _value = o;
+ }
+
+
+ public String getName()
+ {
+
+ return _name;
+ }
+
+
+ public boolean isArray()
+ {
+
+ return _dataType.getIsArray();
+ }
+
+
+ public boolean isKey()
+ {
+
+ return _isKey;
+ }
+
+ public boolean isClassSymbol()
+ {
+
+ return _isPropertyOfClass;
+ }
+
+ public String getReferenceTypeName()
+ {
+
+ return _dataType.getReferenceTypeName();
+ }
+
+}
Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/PropertySymbol.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/SPLSymbolTable.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/SPLSymbolTable.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/SPLSymbolTable.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/SPLSymbolTable.java Fri Jan 11 10:56:30 2008
@@ -1,671 +1,671 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <pr...@in.ibm.com>
- *
- */
-
-
-
-package org.apache.imperius.spl.parser.compiler.symboltable;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.DataCollector;
-import org.apache.imperius.spl.external.InstanceInfo;
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.exceptions.SymbolAlreadyDefinedException;
-import org.apache.imperius.spl.parser.statements.impl.MacroDefinition;
-import org.apache.imperius.spl.parser.util.DataCollectorFactory;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class SPLSymbolTable
-{
- public static final int COLLECT = 1;
- public static final int MACRO = 2;
- public static final int DEFAULT = 3;
- public static final int BASICCOLLECT=4;
- public static final int POLICYGROUP=5;
- public static final int UNDEFINED=-1;
-
- private AnchorData _anchorData = null;
-
- private static Logger logger = SPLLogger.getSPLLogger().getLogger();
- private static final String sourceClass="SPLSymbolTable";
-
- private Map _symbolMap = null;
- private List _subSymbolTables = null;
- private SPLSymbolTable _parentTable = null;
- private int _symbolTableType = UNDEFINED;
- private DataCollector _dataCollector = null;
-
- private String _defaultQualifier = null;
-
- public void addAnchor(String className,
- String qualifier,
- List instanceInfoList) throws SPLException
- {
- if(_anchorData == null)
- {
- _anchorData = new AnchorData();
- }
- //System.out.println("SPLSymbolTable addAnchor className "+className);
- //System.out.println("SPLSymbolTable addAnchor qualifier "+qualifier);
- //System.out.println("SPLSymbolTable addAnchor instanceInfoList "+instanceInfoList);
- if(instanceInfoList.size()==0)
- {
- InstanceInfo iI=new InstanceInfo(className,null);
- //System.out.println("created new instance info object ");
-
- instanceInfoList.add(iI);
- }
- _anchorData.addInstanceInfoListForClass(className, instanceInfoList);
- _anchorData.addQualifierForClass(className, qualifier);
- if(qualifier!=null)
- {
- _defaultQualifier = qualifier;
-
- }
-// _defaultQualifier = qualifier;
-
- _populateAnchorClassSymbols(className, qualifier, instanceInfoList);
-
- }
-
- /*public void addCollectAnchor(String className,
- String qualifier,
- List instanceInfoList,
- boolean isCollectInstance) throws SPLException
- {
-
- //System.out.println("SPLSymbolTable addAnchor className "+className);
- //System.out.println("SPLSymbolTable addAnchor qualifier "+qualifier);
- //System.out.println("SPLSymbolTable addAnchor instanceInfoList "+instanceInfoList);
- if(instanceInfoList.size()==0)
- {
- InstanceInfo iI=new InstanceInfo(className,null,isCollectInstance);
- //System.out.println("created new instance info object ");
-
- instanceInfoList.add(iI);
- }
-
- _populateCollectAnchorClassSymbols(className, qualifier, instanceInfoList);
-
- }*/
-
- public AnchorData getAnchorData()
- {
- return _anchorData;
- }
-
- public void setAnchorData(AnchorData anchorData)
- {
- _anchorData = anchorData;
-
- }
-
-
- public SPLSymbolTable(SPLSymbolTable pt)
- {
- this(pt,DEFAULT);
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "SPLSymbolTable");
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "SPLSymbolTable");
- }
-
-
- public SPLSymbolTable(SPLSymbolTable pt,int type)
- {
- this();
- //System.out.println("creating SPLSymbolTable(SPLSymbolTable pt,int type)");
-
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "SPLSymbolTable");
-
- //System.out.println("Setting Parent" + pt);
- this._symbolTableType = type;
- if(_symbolTableType!= COLLECT && _symbolTableType!= POLICYGROUP)
- {
- this._anchorData = pt.getAnchorData();
-
- }
-
- this._dataCollector = DataCollectorFactory.getDataCollector();
- this._defaultQualifier=pt.getDefaultQualifier();
- this.setParentSymbolTable(pt);
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "SPLSymbolTable");
- }
- public SPLSymbolTable()
- {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "SPLSymbolTable");
- //System.out.println("creating SPLSymbolTable()");
- _subSymbolTables = new ArrayList();
- _symbolMap = new LinkedHashMap();
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "SPLSymbolTable");
- }
-
- public void addChildSymbolTable(SPLSymbolTable c)
- {
- // //System.out.println("Current sym table entries" + _symbolMap);
- // //System.out.println("Adding child sym table" + c);
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "addChildSymbolTable");
- _subSymbolTables.add(c);
- c._parentTable=this;
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "addChildSymbolTable");
- }
-
- public SPLSymbolTable getParentSymbolTable()
- {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getParentSymbolTable");
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getParentSymbolTable");
- return _parentTable;
-
- }
-
-
- public void insertVariableSymbol(String name,
- TypeInfo type,
- boolean isKey,
- boolean isClassProp) throws SPLException
- {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertVariableSymbol");
- // //System.out.println("Inserting Variable: " + name + type + val);
- if(!_symbolMap.containsKey(name))
- {
-
- Symbol cimSym = new PropertySymbol(name,type,isKey,isClassProp);
- _symbolMap.put(name, cimSym);
- }
- else
- {
- logger.severe(Thread.currentThread().getName()+" "+"Symbol: " + name + " already defined");
- throw new SymbolAlreadyDefinedException("Symbol: " + name + " already defined");
- }
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertVariableSymbol");
- }
-
- public void insertVariableSymbol(String name,
- int type,
- String referenceTypeName,
- boolean isArray,
- boolean isKey,
- boolean isClassProp) throws SPLException
- {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertVariableSymbol");
- // //System.out.println("Inserting Variable: " + name + type + val);
- if(!_symbolMap.containsKey(name))
- {
- TypeInfo tp = new TypeInfo(type,referenceTypeName,isArray);
- Symbol cimSym = new PropertySymbol(name,tp,isKey,isClassProp);
- _symbolMap.put(name, cimSym);
- }
- else
- {
- logger.severe(Thread.currentThread().getName()+" "+"Symbol: " + name + " already defined");
- throw new SymbolAlreadyDefinedException("Symbol: " + name + " already defined");
- }
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertVariableSymbol");
- }
- public void insertMethodSymbol(String name,
- TypeInfo retType,
- boolean isReturnArray,
- String returnReferenceName,
- List argTypeList,
- SPLSymbolTable argsSymbolTable) throws SymbolAlreadyDefinedException
- {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertMethodSymbol");
-
- // //System.out.println("Inserting Method: " + name + retType + argTypeList);
- if(!_symbolMap.containsKey(name))
- {
- /* String nName,
- int retType,
- boolean isReturnArray,
- String returnReferenceType,
- SPLSymbolTable argsTable)*/
- Symbol cimSym = new MethodSymbol(name,
- retType,
- argTypeList,
- argsSymbolTable);
- _symbolMap.put(name, cimSym);
- //System.out.println("method symbol added to symboltable "+name);
- }
- else
- {
- logger.severe(Thread.currentThread().getName()+" "+"Symbol: " + name + " already defined");
- throw new SymbolAlreadyDefinedException("Symbol: " + name + " already defined");
- }
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "insertMethodSymbol");
-
- }
-
- public void insertMacroSymbol(String name,
- String retType,
- boolean isArray,
- ArrayList argTypeList,
- MacroDefinition macroDef) throws SPLException
- {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertMacroSymbol");
- int type = TypeConstants.getActualType(retType);
- TypeInfo returnType = new TypeInfo(type,null,isArray);
- //System.out.println("Inserting Method: " + name + retType + argTypeList);
- if(!_symbolMap.containsKey(name))
- {
- Symbol cimSym = new MacroSymbol(name,returnType,argTypeList,macroDef);
- _symbolMap.put(name, cimSym);
- }
- else
- {
- logger.severe(Thread.currentThread().getName()+" "+"Symbol: " + name + " already defined");
- throw new SymbolAlreadyDefinedException("Symbol: " + name + " already defined");
- }
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "insertMacroSymbol");
- }
-
- public Symbol getSymbol(String name) throws SPLException
- {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymbol");
- name=name.trim();
- //System.out.println("getSymbol "+name);
- Symbol retSym = null;
- if(_symbolMap.containsKey(name))
- {
- //System.out.println("_symbolMap contains "+name);
- retSym = (Symbol)_symbolMap.get(name);
- }
- else
- {
- //System.out.println("_symbolMap does not contains "+name);
- if(_parentTable != null)
- {
- //System.out.println("trying parent symboltable");
- retSym = (Symbol)_parentTable.getSymbol(name);
- }
- }
- if (retSym==null)
- {
- throw new SPLException("Symbol does not exist " + name);
- }
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymbol");
- return retSym;
- }
-
- public boolean symbolExists(String name, boolean recurse)
- {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "symbolExists");
- boolean res = false;
- if(_symbolMap.containsKey(name))
- {
- res = true;
- }
- else
- {
- if(_parentTable != null && recurse)
- {
- res = _parentTable.symbolExists(name, recurse);
- }
- }
- //System.out.println("symbol exists ? "+name+" "+res);
-
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "symbolExists");
- return res;
- }
-
-
- private void _populateAnchorClassSymbols(String className,
- String qualifier,
- List instanceInfoList)
- {
- logger.entering(sourceClass,Thread.currentThread().getName()+" " +
- "populateAnchorElementSymbols");
- Map sMap = null;
- try
- {
- //System.out.println("populateAnchorElementSymbols ::
- //_anchorElement,nameSpace :"+_anchorElement+" "+nameSpace);
-
- if(_dataCollector == null)
- {
- _dataCollector = DataCollectorFactory.getDataCollector();
- }
-
- //System.out.println("trying to get class "+className+" "+qualifier);
- //System.out.println("_dataCollector "+_dataCollector);
- sMap = _dataCollector.getSymbolsForClass(className,qualifier);
- //System.out.println("sMap "+sMap);
- Iterator it = sMap.keySet().iterator();
-
- while(it.hasNext())
- {
- String key = (String)it.next();
- Symbol s = (Symbol)sMap.get(key);
- Iterator instanceInfoListIt = instanceInfoList.iterator();
- if(instanceInfoList != null && !instanceInfoList.isEmpty())
- {
- while(instanceInfoListIt.hasNext())
- {
- InstanceInfo instanceInfo = (InstanceInfo)instanceInfoListIt.next();
- String instanceName = instanceInfo.getInstanceName();
- _symbolMap.put(instanceName + "." + key,s);
- //System.out.println("Symbol added to symbolmap : "+instanceName + "." + key);
- }
-
- }
- else
- {
- _symbolMap.put(className + "." + key,s);
- //System.out.println("Symbol added to symbolmap : "+className + "." + key);
-
- }
- }
-
- }
- catch (SPLException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
- /* insertVariableSymbol(_anchorElement + ".intprop",TypeConstants.intType,false);
- insertVariableSymbol(_anchorElement + ".intprop2",TypeConstants.intType,false);
- insertVariableSymbol(_anchorElement + ".doubleprop",TypeConstants.doubleType,false);
- insertVariableSymbol(_anchorElement + ".stringprop3",TypeConstants.stringType,false);*/
-
-
- // TODO Auto-generated method stub
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "populateAnchorElementSymbols");
-
- }
-
-
- /*private void _populateCollectAnchorClassSymbols(String className,
- String qualifier,
- List instanceInfoList)
- {
- logger.entering(sourceClass,Thread.currentThread().getName()+" " +
- "populateAnchorElementSymbols");
- Map sMap = null;
- try
- {
- //System.out.println("populateAnchorElementSymbols ::
- //_anchorElement,nameSpace :"+_anchorElement+" "+nameSpace);
-
- if(_dataCollector == null)
- {
- _dataCollector = DataCollectorFactory.getDataCollector();
- }
-
- sMap = _dataCollector.getSymbolsForClass(className,qualifier);
- Iterator it = sMap.keySet().iterator();
-
- while(it.hasNext())
- {
- String key = (String)it.next();
- Symbol s = (Symbol)sMap.get(key);
- Iterator instanceInfoListIt = instanceInfoList.iterator();
- if(instanceInfoList != null && !instanceInfoList.isEmpty())
- {
- while(instanceInfoListIt.hasNext())
- {
- InstanceInfo instanceInfo = (InstanceInfo)instanceInfoListIt.next();
- String instanceName = instanceInfo.getInstanceName();
- _symbolMap.put(instanceName + "." + key,s);
- //System.out.println("Symbol added to symbolmap : "+instanceName + "." + key);
- }
-
- }
- else
- {
- _symbolMap.put(className + "." + key,s);
- //System.out.println("Symbol added to symbolmap : "+className + "." + key);
-
- }
- }
-
- }
- catch (SPLException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "populateAnchorElementSymbols");
-
- }*/
-
-
-
- public void populateInstanceValuesForInstance(
- String className,
- String instanceName,
- Object instance,
- Map currentInstanceSymbols) throws SPLException
- {
- logger.entering(sourceClass,Thread.currentThread().getName()
- +" "+ "populateSymbolTableWithInstanceValues");
- //System.out.println("SPLSymbolTable::populateSymbolTableWithInstanceValues");
- resetSymbolValues();
-
- Iterator keyIt = currentInstanceSymbols.keySet().iterator();
- while(keyIt.hasNext())
- {
-
- String currentKey = (String)keyIt.next();
- String qualifiedKey = currentKey;
- qualifiedKey = instanceName + "." + currentKey;
-
- //System.out.println("currentKey "+currentKey);
- PropertySymbol sym = (PropertySymbol)getSymbol(qualifiedKey);
-
- Object value = (Object)currentInstanceSymbols.get(currentKey);
- sym.setValue(value);
- if(logger.isLoggable(Level.FINE))
- {
- logger.fine(Thread.currentThread().getName()+
- " SPLSymbolTable setting symbol:"
- +sym.getName()+" from:"+sym.getValue()+" to:"+value);
- }
-
-
- }
- _insertInstanceObject(className, instanceName, instance);
-
-
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "populateSymbolTableWithInstanceValues");
- }
-
- /*public void populateInstanceValuesForCollect(
- String className,
- String instanceName,
- Object instance,
- Map currentInstanceSymbols) throws SPLException
- {
- logger.entering(sourceClass,Thread.currentThread().getName()
- +" "+ "populateSymbolTableWithInstanceValues");
- //System.out.println("SPLSymbolTable::populateSymbolTableWithInstanceValues");
- resetSymbolValues();
-
- Iterator keyIt = currentInstanceSymbols.keySet().iterator();
- while(keyIt.hasNext())
- {
-
- String currentKey = (String)keyIt.next();
- String qualifiedKey = currentKey;
- qualifiedKey = instanceName + "." + currentKey;
-
- //System.out.println("currentKey "+currentKey);
- PropertySymbol sym = (PropertySymbol)getSymbol(qualifiedKey);
-
- Object value = (Object)currentInstanceSymbols.get(currentKey);
- sym.setValue(value);
- if(logger.isLoggable(Level.FINE))
- {
- logger.fine(Thread.currentThread().getName()+
- " SPLSymbolTable setting symbol:"
- +sym.getName()+" from:"+sym.getValue()+" to:"+value);
- }
-
-
- }
-
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "populateSymbolTableWithInstanceValues");
- }*/
-
- private void _insertInstanceObject(String className,
- String instanceName,
- Object instance) throws SPLException
- {
- _anchorData.insertInstanceObject(className, instanceName, instance);
-
- }
-
-
- public void resetSymbolValues()
- {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "resetSymbolValues");
- //TBD
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "resetSymbolValues");
- }
-
-
- public void setParentSymbolTable(SPLSymbolTable table) {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setParentSymbolTable");
- this._parentTable = table;
- table._subSymbolTables.add(this);
-
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setParentSymbolTable");
-
- }
- public List getSubSymbolTables() {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSubSymbolTables");
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSubSymbolTables");
-
- return _subSymbolTables;
- }
- public void setSubSymbolTables(List symbolTables) {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSubSymbolTables");
- _subSymbolTables = symbolTables;
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSubSymbolTables");
-
- }
- public Map getSymbolMap() {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymbolMap");
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymbolMap");
-
- return _symbolMap;
-
-
- }
- public void setSymbolMap(Map map) {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymbolMap");
- _symbolMap = map;
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymbolMap");
-
- }
- public int getSymbolTableType() {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymbolTableType");
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymbolTableType");
-
- return _symbolTableType;
- }
- public void setSymbolTableType(int tp) {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymbolTableType");
- this._symbolTableType = tp;
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymbolTableType");
- }
-
-
-// public DataCollector getDataCollector() {
-// logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getDataCollector");
-// logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getDataCollector");
-//
-// return _dataCollector;
-// }
- public void setDataCollector(DataCollector dataCollector) {
- logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setDataCollector");
- if(dataCollector == null) {
- this._dataCollector = DataCollectorFactory.getDataCollector();
- } else {
- this._dataCollector = dataCollector;
- }
-
- logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setDataCollector");
-
- }
-
- public List getAnchorClassList()
- {
-
- List anchorClassList = _anchorData.getAnchorClassList();
- return anchorClassList;
- }
-
- public String getQualifierForClass(String className)
- {
- String qualifier = _anchorData.getQualifierForClass(className);
- return qualifier;
- }
-
- public List getInstanceInfoList(String className)
- {
- List instanceInfoList = _anchorData.getInstanceInfoList(className);
- return instanceInfoList;
- }
-
- public Object getInstance(String instanceName)
- {
- Object instance = null;
- instance = _anchorData.getInstance(instanceName);
-// if(instance ==null){
-//// SPLSymbolTable stab=this;
-////
-//// while(stab.getParentSymbolTable() != null){
-//// SPLSymbolTable parent=stab.getParentSymbolTable();
-//// instance = parent._anchorData.getInstance(instanceName);
-//// if(instance != null){
-//// break;
-//// }
-//// stab=stab.getParentSymbolTable();
-//// }
-//// logger.severe(Thread.currentThread().getName()+" "+"Did not find instance in Symbol Table: " + instanceName);
-//
-// }
-//
- return instance;
-
- }
-
- public String getDefaultQualifier()
- {
- return _defaultQualifier;
- }
-
- public void setDefaultQualifier(String qualifier) {
- _defaultQualifier = qualifier;
- }
-
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <pr...@in.ibm.com>
+ *
+ */
+
+
+
+package org.apache.imperius.spl.parser.compiler.symboltable;
+
+
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.DataCollector;
+import org.apache.imperius.spl.external.InstanceInfo;
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.exceptions.SymbolAlreadyDefinedException;
+import org.apache.imperius.spl.parser.statements.impl.MacroDefinition;
+import org.apache.imperius.spl.parser.util.DataCollectorFactory;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class SPLSymbolTable
+{
+ public static final int COLLECT = 1;
+ public static final int MACRO = 2;
+ public static final int DEFAULT = 3;
+ public static final int BASICCOLLECT=4;
+ public static final int POLICYGROUP=5;
+ public static final int UNDEFINED=-1;
+
+ private AnchorData _anchorData = null;
+
+ private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+ private static final String sourceClass="SPLSymbolTable";
+
+ private Map _symbolMap = null;
+ private List _subSymbolTables = null;
+ private SPLSymbolTable _parentTable = null;
+ private int _symbolTableType = UNDEFINED;
+ private DataCollector _dataCollector = null;
+
+ private String _defaultQualifier = null;
+
+ public void addAnchor(String className,
+ String qualifier,
+ List instanceInfoList) throws SPLException
+ {
+ if(_anchorData == null)
+ {
+ _anchorData = new AnchorData();
+ }
+ //System.out.println("SPLSymbolTable addAnchor className "+className);
+ //System.out.println("SPLSymbolTable addAnchor qualifier "+qualifier);
+ //System.out.println("SPLSymbolTable addAnchor instanceInfoList "+instanceInfoList);
+ if(instanceInfoList.size()==0)
+ {
+ InstanceInfo iI=new InstanceInfo(className,null);
+ //System.out.println("created new instance info object ");
+
+ instanceInfoList.add(iI);
+ }
+ _anchorData.addInstanceInfoListForClass(className, instanceInfoList);
+ _anchorData.addQualifierForClass(className, qualifier);
+ if(qualifier!=null)
+ {
+ _defaultQualifier = qualifier;
+
+ }
+// _defaultQualifier = qualifier;
+
+ _populateAnchorClassSymbols(className, qualifier, instanceInfoList);
+
+ }
+
+ /*public void addCollectAnchor(String className,
+ String qualifier,
+ List instanceInfoList,
+ boolean isCollectInstance) throws SPLException
+ {
+
+ //System.out.println("SPLSymbolTable addAnchor className "+className);
+ //System.out.println("SPLSymbolTable addAnchor qualifier "+qualifier);
+ //System.out.println("SPLSymbolTable addAnchor instanceInfoList "+instanceInfoList);
+ if(instanceInfoList.size()==0)
+ {
+ InstanceInfo iI=new InstanceInfo(className,null,isCollectInstance);
+ //System.out.println("created new instance info object ");
+
+ instanceInfoList.add(iI);
+ }
+
+ _populateCollectAnchorClassSymbols(className, qualifier, instanceInfoList);
+
+ }*/
+
+ public AnchorData getAnchorData()
+ {
+ return _anchorData;
+ }
+
+ public void setAnchorData(AnchorData anchorData)
+ {
+ _anchorData = anchorData;
+
+ }
+
+
+ public SPLSymbolTable(SPLSymbolTable pt)
+ {
+ this(pt,DEFAULT);
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "SPLSymbolTable");
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "SPLSymbolTable");
+ }
+
+
+ public SPLSymbolTable(SPLSymbolTable pt,int type)
+ {
+ this();
+ //System.out.println("creating SPLSymbolTable(SPLSymbolTable pt,int type)");
+
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "SPLSymbolTable");
+
+ //System.out.println("Setting Parent" + pt);
+ this._symbolTableType = type;
+ if(_symbolTableType!= COLLECT && _symbolTableType!= POLICYGROUP)
+ {
+ this._anchorData = pt.getAnchorData();
+
+ }
+
+ this._dataCollector = DataCollectorFactory.getDataCollector();
+ this._defaultQualifier=pt.getDefaultQualifier();
+ this.setParentSymbolTable(pt);
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "SPLSymbolTable");
+ }
+ public SPLSymbolTable()
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "SPLSymbolTable");
+ //System.out.println("creating SPLSymbolTable()");
+ _subSymbolTables = new ArrayList();
+ _symbolMap = new LinkedHashMap();
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "SPLSymbolTable");
+ }
+
+ public void addChildSymbolTable(SPLSymbolTable c)
+ {
+ // //System.out.println("Current sym table entries" + _symbolMap);
+ // //System.out.println("Adding child sym table" + c);
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "addChildSymbolTable");
+ _subSymbolTables.add(c);
+ c._parentTable=this;
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "addChildSymbolTable");
+ }
+
+ public SPLSymbolTable getParentSymbolTable()
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getParentSymbolTable");
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getParentSymbolTable");
+ return _parentTable;
+
+ }
+
+
+ public void insertVariableSymbol(String name,
+ TypeInfo type,
+ boolean isKey,
+ boolean isClassProp) throws SPLException
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertVariableSymbol");
+ // //System.out.println("Inserting Variable: " + name + type + val);
+ if(!_symbolMap.containsKey(name))
+ {
+
+ Symbol cimSym = new PropertySymbol(name,type,isKey,isClassProp);
+ _symbolMap.put(name, cimSym);
+ }
+ else
+ {
+ logger.severe(Thread.currentThread().getName()+" "+"Symbol: " + name + " already defined");
+ throw new SymbolAlreadyDefinedException("Symbol: " + name + " already defined");
+ }
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertVariableSymbol");
+ }
+
+ public void insertVariableSymbol(String name,
+ int type,
+ String referenceTypeName,
+ boolean isArray,
+ boolean isKey,
+ boolean isClassProp) throws SPLException
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertVariableSymbol");
+ // //System.out.println("Inserting Variable: " + name + type + val);
+ if(!_symbolMap.containsKey(name))
+ {
+ TypeInfo tp = new TypeInfo(type,referenceTypeName,isArray);
+ Symbol cimSym = new PropertySymbol(name,tp,isKey,isClassProp);
+ _symbolMap.put(name, cimSym);
+ }
+ else
+ {
+ logger.severe(Thread.currentThread().getName()+" "+"Symbol: " + name + " already defined");
+ throw new SymbolAlreadyDefinedException("Symbol: " + name + " already defined");
+ }
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertVariableSymbol");
+ }
+ public void insertMethodSymbol(String name,
+ TypeInfo retType,
+ boolean isReturnArray,
+ String returnReferenceName,
+ List argTypeList,
+ SPLSymbolTable argsSymbolTable) throws SymbolAlreadyDefinedException
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertMethodSymbol");
+
+ // //System.out.println("Inserting Method: " + name + retType + argTypeList);
+ if(!_symbolMap.containsKey(name))
+ {
+ /* String nName,
+ int retType,
+ boolean isReturnArray,
+ String returnReferenceType,
+ SPLSymbolTable argsTable)*/
+ Symbol cimSym = new MethodSymbol(name,
+ retType,
+ argTypeList,
+ argsSymbolTable);
+ _symbolMap.put(name, cimSym);
+ //System.out.println("method symbol added to symboltable "+name);
+ }
+ else
+ {
+ logger.severe(Thread.currentThread().getName()+" "+"Symbol: " + name + " already defined");
+ throw new SymbolAlreadyDefinedException("Symbol: " + name + " already defined");
+ }
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "insertMethodSymbol");
+
+ }
+
+ public void insertMacroSymbol(String name,
+ String retType,
+ boolean isArray,
+ ArrayList argTypeList,
+ MacroDefinition macroDef) throws SPLException
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertMacroSymbol");
+ int type = TypeConstants.getActualType(retType);
+ TypeInfo returnType = new TypeInfo(type,null,isArray);
+ //System.out.println("Inserting Method: " + name + retType + argTypeList);
+ if(!_symbolMap.containsKey(name))
+ {
+ Symbol cimSym = new MacroSymbol(name,returnType,argTypeList,macroDef);
+ _symbolMap.put(name, cimSym);
+ }
+ else
+ {
+ logger.severe(Thread.currentThread().getName()+" "+"Symbol: " + name + " already defined");
+ throw new SymbolAlreadyDefinedException("Symbol: " + name + " already defined");
+ }
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "insertMacroSymbol");
+ }
+
+ public Symbol getSymbol(String name) throws SPLException
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymbol");
+ name=name.trim();
+ //System.out.println("getSymbol "+name);
+ Symbol retSym = null;
+ if(_symbolMap.containsKey(name))
+ {
+ //System.out.println("_symbolMap contains "+name);
+ retSym = (Symbol)_symbolMap.get(name);
+ }
+ else
+ {
+ //System.out.println("_symbolMap does not contains "+name);
+ if(_parentTable != null)
+ {
+ //System.out.println("trying parent symboltable");
+ retSym = (Symbol)_parentTable.getSymbol(name);
+ }
+ }
+ if (retSym==null)
+ {
+ throw new SPLException("Symbol does not exist " + name);
+ }
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymbol");
+ return retSym;
+ }
+
+ public boolean symbolExists(String name, boolean recurse)
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "symbolExists");
+ boolean res = false;
+ if(_symbolMap.containsKey(name))
+ {
+ res = true;
+ }
+ else
+ {
+ if(_parentTable != null && recurse)
+ {
+ res = _parentTable.symbolExists(name, recurse);
+ }
+ }
+ //System.out.println("symbol exists ? "+name+" "+res);
+
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "symbolExists");
+ return res;
+ }
+
+
+ private void _populateAnchorClassSymbols(String className,
+ String qualifier,
+ List instanceInfoList)
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" " +
+ "populateAnchorElementSymbols");
+ Map sMap = null;
+ try
+ {
+ //System.out.println("populateAnchorElementSymbols ::
+ //_anchorElement,nameSpace :"+_anchorElement+" "+nameSpace);
+
+ if(_dataCollector == null)
+ {
+ _dataCollector = DataCollectorFactory.getDataCollector();
+ }
+
+ //System.out.println("trying to get class "+className+" "+qualifier);
+ //System.out.println("_dataCollector "+_dataCollector);
+ sMap = _dataCollector.getSymbolsForClass(className,qualifier);
+ //System.out.println("sMap "+sMap);
+ Iterator it = sMap.keySet().iterator();
+
+ while(it.hasNext())
+ {
+ String key = (String)it.next();
+ Symbol s = (Symbol)sMap.get(key);
+ Iterator instanceInfoListIt = instanceInfoList.iterator();
+ if(instanceInfoList != null && !instanceInfoList.isEmpty())
+ {
+ while(instanceInfoListIt.hasNext())
+ {
+ InstanceInfo instanceInfo = (InstanceInfo)instanceInfoListIt.next();
+ String instanceName = instanceInfo.getInstanceName();
+ _symbolMap.put(instanceName + "." + key,s);
+ //System.out.println("Symbol added to symbolmap : "+instanceName + "." + key);
+ }
+
+ }
+ else
+ {
+ _symbolMap.put(className + "." + key,s);
+ //System.out.println("Symbol added to symbolmap : "+className + "." + key);
+
+ }
+ }
+
+ }
+ catch (SPLException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ /* insertVariableSymbol(_anchorElement + ".intprop",TypeConstants.intType,false);
+ insertVariableSymbol(_anchorElement + ".intprop2",TypeConstants.intType,false);
+ insertVariableSymbol(_anchorElement + ".doubleprop",TypeConstants.doubleType,false);
+ insertVariableSymbol(_anchorElement + ".stringprop3",TypeConstants.stringType,false);*/
+
+
+ // TODO Auto-generated method stub
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "populateAnchorElementSymbols");
+
+ }
+
+
+ /*private void _populateCollectAnchorClassSymbols(String className,
+ String qualifier,
+ List instanceInfoList)
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" " +
+ "populateAnchorElementSymbols");
+ Map sMap = null;
+ try
+ {
+ //System.out.println("populateAnchorElementSymbols ::
+ //_anchorElement,nameSpace :"+_anchorElement+" "+nameSpace);
+
+ if(_dataCollector == null)
+ {
+ _dataCollector = DataCollectorFactory.getDataCollector();
+ }
+
+ sMap = _dataCollector.getSymbolsForClass(className,qualifier);
+ Iterator it = sMap.keySet().iterator();
+
+ while(it.hasNext())
+ {
+ String key = (String)it.next();
+ Symbol s = (Symbol)sMap.get(key);
+ Iterator instanceInfoListIt = instanceInfoList.iterator();
+ if(instanceInfoList != null && !instanceInfoList.isEmpty())
+ {
+ while(instanceInfoListIt.hasNext())
+ {
+ InstanceInfo instanceInfo = (InstanceInfo)instanceInfoListIt.next();
+ String instanceName = instanceInfo.getInstanceName();
+ _symbolMap.put(instanceName + "." + key,s);
+ //System.out.println("Symbol added to symbolmap : "+instanceName + "." + key);
+ }
+
+ }
+ else
+ {
+ _symbolMap.put(className + "." + key,s);
+ //System.out.println("Symbol added to symbolmap : "+className + "." + key);
+
+ }
+ }
+
+ }
+ catch (SPLException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "populateAnchorElementSymbols");
+
+ }*/
+
+
+
+ public void populateInstanceValuesForInstance(
+ String className,
+ String instanceName,
+ Object instance,
+ Map currentInstanceSymbols) throws SPLException
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()
+ +" "+ "populateSymbolTableWithInstanceValues");
+ //System.out.println("SPLSymbolTable::populateSymbolTableWithInstanceValues");
+ resetSymbolValues();
+
+ Iterator keyIt = currentInstanceSymbols.keySet().iterator();
+ while(keyIt.hasNext())
+ {
+
+ String currentKey = (String)keyIt.next();
+ String qualifiedKey = currentKey;
+ qualifiedKey = instanceName + "." + currentKey;
+
+ //System.out.println("currentKey "+currentKey);
+ PropertySymbol sym = (PropertySymbol)getSymbol(qualifiedKey);
+
+ Object value = (Object)currentInstanceSymbols.get(currentKey);
+ sym.setValue(value);
+ if(logger.isLoggable(Level.FINE))
+ {
+ logger.fine(Thread.currentThread().getName()+
+ " SPLSymbolTable setting symbol:"
+ +sym.getName()+" from:"+sym.getValue()+" to:"+value);
+ }
+
+
+ }
+ _insertInstanceObject(className, instanceName, instance);
+
+
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "populateSymbolTableWithInstanceValues");
+ }
+
+ /*public void populateInstanceValuesForCollect(
+ String className,
+ String instanceName,
+ Object instance,
+ Map currentInstanceSymbols) throws SPLException
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()
+ +" "+ "populateSymbolTableWithInstanceValues");
+ //System.out.println("SPLSymbolTable::populateSymbolTableWithInstanceValues");
+ resetSymbolValues();
+
+ Iterator keyIt = currentInstanceSymbols.keySet().iterator();
+ while(keyIt.hasNext())
+ {
+
+ String currentKey = (String)keyIt.next();
+ String qualifiedKey = currentKey;
+ qualifiedKey = instanceName + "." + currentKey;
+
+ //System.out.println("currentKey "+currentKey);
+ PropertySymbol sym = (PropertySymbol)getSymbol(qualifiedKey);
+
+ Object value = (Object)currentInstanceSymbols.get(currentKey);
+ sym.setValue(value);
+ if(logger.isLoggable(Level.FINE))
+ {
+ logger.fine(Thread.currentThread().getName()+
+ " SPLSymbolTable setting symbol:"
+ +sym.getName()+" from:"+sym.getValue()+" to:"+value);
+ }
+
+
+ }
+
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "populateSymbolTableWithInstanceValues");
+ }*/
+
+ private void _insertInstanceObject(String className,
+ String instanceName,
+ Object instance) throws SPLException
+ {
+ _anchorData.insertInstanceObject(className, instanceName, instance);
+
+ }
+
+
+ public void resetSymbolValues()
+ {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "resetSymbolValues");
+ //TBD
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "resetSymbolValues");
+ }
+
+
+ public void setParentSymbolTable(SPLSymbolTable table) {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setParentSymbolTable");
+ this._parentTable = table;
+ table._subSymbolTables.add(this);
+
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setParentSymbolTable");
+
+ }
+ public List getSubSymbolTables() {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSubSymbolTables");
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSubSymbolTables");
+
+ return _subSymbolTables;
+ }
+ public void setSubSymbolTables(List symbolTables) {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSubSymbolTables");
+ _subSymbolTables = symbolTables;
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSubSymbolTables");
+
+ }
+ public Map getSymbolMap() {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymbolMap");
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymbolMap");
+
+ return _symbolMap;
+
+
+ }
+ public void setSymbolMap(Map map) {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymbolMap");
+ _symbolMap = map;
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymbolMap");
+
+ }
+ public int getSymbolTableType() {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymbolTableType");
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymbolTableType");
+
+ return _symbolTableType;
+ }
+ public void setSymbolTableType(int tp) {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymbolTableType");
+ this._symbolTableType = tp;
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymbolTableType");
+ }
+
+
+// public DataCollector getDataCollector() {
+// logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getDataCollector");
+// logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getDataCollector");
+//
+// return _dataCollector;
+// }
+ public void setDataCollector(DataCollector dataCollector) {
+ logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setDataCollector");
+ if(dataCollector == null) {
+ this._dataCollector = DataCollectorFactory.getDataCollector();
+ } else {
+ this._dataCollector = dataCollector;
+ }
+
+ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setDataCollector");
+
+ }
+
+ public List getAnchorClassList()
+ {
+
+ List anchorClassList = _anchorData.getAnchorClassList();
+ return anchorClassList;
+ }
+
+ public String getQualifierForClass(String className)
+ {
+ String qualifier = _anchorData.getQualifierForClass(className);
+ return qualifier;
+ }
+
+ public List getInstanceInfoList(String className)
+ {
+ List instanceInfoList = _anchorData.getInstanceInfoList(className);
+ return instanceInfoList;
+ }
+
+ public Object getInstance(String instanceName)
+ {
+ Object instance = null;
+ instance = _anchorData.getInstance(instanceName);
+// if(instance ==null){
+//// SPLSymbolTable stab=this;
+////
+//// while(stab.getParentSymbolTable() != null){
+//// SPLSymbolTable parent=stab.getParentSymbolTable();
+//// instance = parent._anchorData.getInstance(instanceName);
+//// if(instance != null){
+//// break;
+//// }
+//// stab=stab.getParentSymbolTable();
+//// }
+//// logger.severe(Thread.currentThread().getName()+" "+"Did not find instance in Symbol Table: " + instanceName);
+//
+// }
+//
+ return instance;
+
+ }
+
+ public String getDefaultQualifier()
+ {
+ return _defaultQualifier;
+ }
+
+ public void setDefaultQualifier(String qualifier) {
+ _defaultQualifier = qualifier;
+ }
+
+
+}
Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/SPLSymbolTable.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/Symbol.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/Symbol.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/Symbol.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/Symbol.java Fri Jan 11 10:56:30 2008
@@ -1,39 +1,39 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Neeraj Joshi <jn...@us.ibm.com>
- *
- */
-
-
-
-package org.apache.imperius.spl.parser.compiler.symboltable;
-
-import org.apache.imperius.spl.parser.util.TypeInfo;
-
-
-
-public interface Symbol
-{
- TypeInfo getType();
- String getReferenceTypeName();
- Object getValue();
- boolean isArray();
- boolean isKey();
- boolean isClassSymbol();
-
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Neeraj Joshi <jn...@us.ibm.com>
+ *
+ */
+
+
+
+package org.apache.imperius.spl.parser.compiler.symboltable;
+
+import org.apache.imperius.spl.parser.util.TypeInfo;
+
+
+
+public interface Symbol
+{
+ TypeInfo getType();
+ String getReferenceTypeName();
+ Object getValue();
+ boolean isArray();
+ boolean isKey();
+ boolean isClassSymbol();
+
+
+}
Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/compiler/symboltable/Symbol.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/ClassDoesNotExistException.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/ClassDoesNotExistException.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/ClassDoesNotExistException.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/ClassDoesNotExistException.java Fri Jan 11 10:56:30 2008
@@ -1,39 +1,39 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Neeraj Joshi <jn...@us.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.parser.exceptions;
-
-
-
-public class ClassDoesNotExistException extends SPLException
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public ClassDoesNotExistException(String s)
- {
- super(s);
- // TODO Auto-generated constructor stub
- }
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Neeraj Joshi <jn...@us.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.parser.exceptions;
+
+
+
+public class ClassDoesNotExistException extends SPLException
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public ClassDoesNotExistException(String s)
+ {
+ super(s);
+ // TODO Auto-generated constructor stub
+ }
+
+}
Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/ClassDoesNotExistException.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalExpressionTypeException.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalExpressionTypeException.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalExpressionTypeException.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalExpressionTypeException.java Fri Jan 11 10:56:30 2008
@@ -1,37 +1,37 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Neeraj Joshi <jn...@us.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.parser.exceptions;
-
-
-
-public class IllegalExpressionTypeException extends SPLException
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public IllegalExpressionTypeException(String x)
- {
- super(x);
- }
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Neeraj Joshi <jn...@us.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.parser.exceptions;
+
+
+
+public class IllegalExpressionTypeException extends SPLException
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public IllegalExpressionTypeException(String x)
+ {
+ super(x);
+ }
+}
Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalExpressionTypeException.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalParameterTypeException.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalParameterTypeException.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalParameterTypeException.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalParameterTypeException.java Fri Jan 11 10:56:30 2008
@@ -1,39 +1,39 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Neeraj Joshi <jn...@us.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.parser.exceptions;
-
-
-
-public class IllegalParameterTypeException extends SPLException
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public IllegalParameterTypeException(String s)
- {
- super(s);
- // TODO Auto-generated constructor stub
- }
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Neeraj Joshi <jn...@us.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.parser.exceptions;
+
+
+
+public class IllegalParameterTypeException extends SPLException
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public IllegalParameterTypeException(String s)
+ {
+ super(s);
+ // TODO Auto-generated constructor stub
+ }
+
+}
Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalParameterTypeException.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalSymbolReferenceException.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalSymbolReferenceException.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalSymbolReferenceException.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalSymbolReferenceException.java Fri Jan 11 10:56:30 2008
@@ -1,36 +1,36 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Neeraj Joshi <jn...@us.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.parser.exceptions;
-
-
-
-public class IllegalSymbolReferenceException extends SPLException
-{
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public IllegalSymbolReferenceException(String x)
- {
- super(x);
- }
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Neeraj Joshi <jn...@us.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.parser.exceptions;
+
+
+
+public class IllegalSymbolReferenceException extends SPLException
+{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public IllegalSymbolReferenceException(String x)
+ {
+ super(x);
+ }
+}
Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/IllegalSymbolReferenceException.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/InstanceDoesNotExistException.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/InstanceDoesNotExistException.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/InstanceDoesNotExistException.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/InstanceDoesNotExistException.java Fri Jan 11 10:56:30 2008
@@ -1,39 +1,39 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <pr...@in.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.parser.exceptions;
-
-
-
-public class InstanceDoesNotExistException extends SPLException
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public InstanceDoesNotExistException(String s)
- {
- super(s);
- // TODO Auto-generated constructor stub
- }
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <pr...@in.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.parser.exceptions;
+
+
+
+public class InstanceDoesNotExistException extends SPLException
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public InstanceDoesNotExistException(String s)
+ {
+ super(s);
+ // TODO Auto-generated constructor stub
+ }
+
+}
Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/InstanceDoesNotExistException.java
------------------------------------------------------------------------------
svn:eol-style = native