@Override public Variable lookupVariable(String name) { Variable var = super.lookupVariable(name); if (var != null) { return var; } ITypeInfo info = typeInfo; while (info != null) { if (info.hasProperty(name)) { return new Variable(name, this); } info = refSession.getTypeInfo(info.getParentTypeName()); } return null; }
public void injectTypeInfo(ITypeInfo unit) { if ((unit == null) || Strings.isNullOrEmpty(unit.getTypeName())) return; typeInfoMap.put(unit.getTypeName(), unit); }
@Override FieldType isTableDef(String inName) { // First look through the standard way FieldType ft = super.isTableDef(inName); if (ft != null) { return ft; } // Then look through rcode ITypeInfo info = typeInfo; while (info != null) { if (info.hasBuffer(inName)) { return FieldType.TTABLE; } info = getSession().getTypeInfo(info.getParentTypeName()); } return null; }
@Override public TableBuffer lookupTempTable(String name) { TableBuffer buff = super.lookupTempTable(name); if (buff != null) { return buff; } ITypeInfo info = typeInfo; while (info != null) { if (info.hasTempTable(name)) { return new TableBuffer(name, this, new RCodeTTWrapper(info.getTempTable(name))); } info = refSession.getTypeInfo(info.getParentTypeName()); } return null; }
@Override public TableBuffer lookupBuffer(String name) { TableBuffer buff = super.lookupBuffer(name); if (buff != null) { return buff; } ITypeInfo info = typeInfo; while (info != null) { if (info.hasBuffer(name)) { IBufferElement elem = info.getBuffer(name); ITable tbl = null; if (!Strings.isNullOrEmpty(elem.getDatabaseName())) { tbl = refSession.getSchema().lookupTable(elem.getDatabaseName(), elem.getTableName()); } else { tbl = lookupTempTable(elem.getTableName()).getTable(); } if (tbl == null) { // Defaults to fake temp-table tbl = new Table(name, IConstants.ST_TTABLE); } return new TableBuffer(name, this, tbl); } info = refSession.getTypeInfo(info.getParentTypeName()); } return null; }
/** * methodOrFunc should only be called for the "unit" scope, since it is the only one that would ever contain methods * or user functions. */ @Override int isMethodOrFunction(String name) { String lname = name.toLowerCase(); // Methods take precedent over built-in functions. The compiler (10.2b) // does not seem to try recognize by function/method signature. ITypeInfo info = typeInfo; while (info != null) { if (info.hasMethod(name)) { return ABLNodeType.LOCAL_METHOD_REF.getType(); } info = getSession().getTypeInfo(info.getParentTypeName()); } if (functionSet.contains(lname)) return ABLNodeType.USER_FUNC.getType(); return 0; }
if (info != null) { numClasses.incrementAndGet(); numMethods.addAndGet(info.getMethods().size()); numProperties.addAndGet(info.getProperties().size()); proparseSession.injectTypeInfo(info);
private final void parseHierarchy(ITypeInfo info) { LOG.info("Injecting type info '{}'", info); proparseSession.injectTypeInfo(info); if (info.getParentTypeName() != null) { File rcd = getRCode(info.getParentTypeName()); if (rcd != null) { ITypeInfo inf = parseRCode(rcd); if (inf != null) { parseHierarchy(inf); } } } for (String str : info.getInterfaces()) { File rcd = getRCode(str); if (rcd != null) { ITypeInfo inf = parseRCode(rcd); if (inf != null) { parseHierarchy(inf); } } } }
private static final ITypeInfo getProgressLangObject() { ITypeInfo info = new TypeInfoV11(PROGRESS_LANG_OBJECT, null, null, 0); info.getMethods().add(new MethodElementV11("Clone", EnumSet.of(AccessType.PUBLIC), 0, DataType.CLASS.getNum(), PROGRESS_LANG_OBJECT, 0, EMPTY_PARAMETERS)); info.getMethods().add( new MethodElementV11("Equals", EnumSet.of(AccessType.PUBLIC), 0, DataType.LOGICAL.getNum(), "", 0, new IParameter[] { new MethodParameterV11(0, "otherObj", 2, MethodParameterV11.PARAMETER_INPUT, 0, DataType.CLASS.getNum(), PROGRESS_LANG_OBJECT, 0)})); info.getMethods().add(new MethodElementV11("GetClass", EnumSet.of(AccessType.PUBLIC), 0, DataType.CLASS.getNum(), "Progress.Lang.Class", 0, EMPTY_PARAMETERS)); info.getMethods().add(new MethodElementV11("ToString", EnumSet.of(AccessType.PUBLIC), 0, DataType.CHARACTER.getNum(), "", 0, EMPTY_PARAMETERS)); return info; } }
@Override public TableBuffer lookupTempTable(String name) { TableBuffer buff = super.lookupTempTable(name); if (buff != null) { return buff; } ITypeInfo info = typeInfo; while (info != null) { if (info.hasTempTable(name)) { return new TableBuffer(name, this, new RCodeTTWrapper(info.getTempTable(name))); } info = refSession.getTypeInfo(info.getParentTypeName()); } return null; }
@Override public TableBuffer lookupBuffer(String name) { TableBuffer buff = super.lookupBuffer(name); if (buff != null) { return buff; } ITypeInfo info = typeInfo; while (info != null) { if (info.hasBuffer(name)) { IBufferElement elem = info.getBuffer(name); ITable tbl = null; if (!Strings.isNullOrEmpty(elem.getDatabaseName())) { tbl = refSession.getSchema().lookupTable(elem.getDatabaseName(), elem.getTableName()); } else { tbl = lookupTempTable(elem.getTableName()).getTable(); } if (tbl == null) { // Defaults to fake temp-table tbl = new Table(name, IConstants.ST_TTABLE); } return new TableBuffer(name, this, tbl); } info = refSession.getTypeInfo(info.getParentTypeName()); } return null; }
/** * methodOrFunc should only be called for the "unit" scope, since it is the only one that would ever contain methods * or user functions. */ @Override int isMethodOrFunction(String name) { String lname = name.toLowerCase(); // Methods take precedent over built-in functions. The compiler (10.2b) // does not seem to try recognize by function/method signature. ITypeInfo info = typeInfo; while (info != null) { if (info.hasMethod(name)) { return ABLNodeType.LOCAL_METHOD_REF.getType(); } info = getSession().getTypeInfo(info.getParentTypeName()); } if (functionSet.contains(lname)) return ABLNodeType.USER_FUNC.getType(); return 0; }
private static final ITypeInfo getProgressLangObject() { ITypeInfo info = new TypeInfoV11(PROGRESS_LANG_OBJECT, null, null, 0); info.getMethods().add(new MethodElementV11("Clone", EnumSet.of(AccessType.PUBLIC), 0, DataType.CLASS.getNum(), PROGRESS_LANG_OBJECT, 0, EMPTY_PARAMETERS)); info.getMethods().add( new MethodElementV11("Equals", EnumSet.of(AccessType.PUBLIC), 0, DataType.LOGICAL.getNum(), "", 0, new IParameter[] { new MethodParameterV11(0, "otherObj", 2, MethodParameterV11.PARAMETER_INPUT, 0, DataType.CLASS.getNum(), PROGRESS_LANG_OBJECT, 0)})); info.getMethods().add(new MethodElementV11("GetClass", EnumSet.of(AccessType.PUBLIC), 0, DataType.CLASS.getNum(), "Progress.Lang.Class", 0, EMPTY_PARAMETERS)); info.getMethods().add(new MethodElementV11("ToString", EnumSet.of(AccessType.PUBLIC), 0, DataType.CHARACTER.getNum(), "", 0, EMPTY_PARAMETERS)); return info; } }
@Override boolean isVariable(String name) { // First look through the standard way if (super.isVariable(name)) return true; // Then look through rcode ITypeInfo info = typeInfo; while (info != null) { if (info.hasProperty(name)) { return true; } info = getSession().getTypeInfo(info.getParentTypeName()); } return false; }
@Override FieldType isTableDef(String inName) { // First look through the standard way FieldType ft = super.isTableDef(inName); if (ft != null) { return ft; } // Then look through rcode ITypeInfo info = typeInfo; while (info != null) { if (info.hasBuffer(inName)) { return FieldType.TTABLE; } info = getSession().getTypeInfo(info.getParentTypeName()); } return null; }
public void injectTypeInfo(ITypeInfo unit) { if ((unit == null) || Strings.isNullOrEmpty(unit.getTypeName())) return; typeInfoMap.put(unit.getTypeName(), unit); }
@Override boolean isVariable(String name) { // First look through the standard way if (super.isVariable(name)) return true; // Then look through rcode ITypeInfo info = typeInfo; while (info != null) { if (info.hasProperty(name)) { return true; } info = getSession().getTypeInfo(info.getParentTypeName()); } return false; }
@Override public Variable lookupVariable(String name) { Variable var = super.lookupVariable(name); if (var != null) { return var; } ITypeInfo info = typeInfo; while (info != null) { if (info.hasProperty(name)) { return new Variable(name, this); } info = refSession.getTypeInfo(info.getParentTypeName()); } return null; }