@Override public DataType getDataType() { return DataType.getDataType(field.getDataType().toUpperCase()); }
@Override public DataType getDataType() { return DataType.getDataType(field.getDataType().toUpperCase()); }
@Override public DataType getDataType() { // TODO Fix conversion between datatypes return DataType.getDataType(field.getDataType().toString().replace('_', '-')); }
@Override public DataType getDataType() { // TODO Fix conversion between datatypes return DataType.getDataType(field.getDataType().toString().replace('_', '-')); }
@Override public Variable defineVariable(JPNode defAST, JPNode idAST, int dataType, boolean parameter) { assert dataType != ProParserTokenTypes.CLASS; Variable v = defineVariable(defAST, idAST, parameter); v.setDataType(DataType.getDataType(dataType)); return v; }
@Override public Variable defineVariable(JPNode defAST, JPNode idAST, int dataType, boolean parameter) { assert dataType != ProParserTokenTypes.CLASS; Variable v = defineVariable(defAST, idAST, parameter); v.setDataType(DataType.getDataType(dataType)); return v; }
throw new IOException("Invalid file format: " + line); Field f = new Field(line.substring(1, ch1), currTable); f.setDataType(DataType.getDataType(line.substring(ch1 + 1, ch2).toUpperCase())); if (f.getDataType() == null) throw new IOException("Unknown datatype: " + line.substring(ch1 + 1, ch2));
throw new IOException("Invalid file format: " + line); Field f = new Field(line.substring(1, ch1), currTable); f.setDataType(DataType.getDataType(line.substring(ch1 + 1, ch2).toUpperCase())); if (f.getDataType() == null) throw new IOException("Unknown datatype: " + line.substring(ch1 + 1, ch2));
/** * Called for a parameter with no identifier. You may have a parameter that has no name, which means that it is a * formal argument that is unused in the function/method. (Also possible in some calls to specify {ID AS datatype}.) * However, we *do* need to have a WIP Symbol that can be assigned to the Parameter object, get any EXTENT assigned to * it, etc. * * @param typeNode The node of the datatype, might be a CLASS node. */ @Override public void paramNoName(JPNode typeNode) { LOG.trace("Entering paramNoName {}", typeNode); Variable variable = new Variable("", currentScope); currSymbol = variable; if (typeNode.getType() == ProParserTokenTypes.CLASS) typeNode = typeNode.nextNode(); if (typeNode.getType() == ProParserTokenTypes.TYPE_NAME) { variable.setDataType(DataType.getDataType(ProParserTokenTypes.CLASS)); variable.setClassName(typeNode); } else { variable.setDataType(DataType.getDataType(typeNode.getType())); } }
/** * Called for a parameter with no identifier. You may have a parameter that has no name, which means that it is a * formal argument that is unused in the function/method. (Also possible in some calls to specify {ID AS datatype}.) * However, we *do* need to have a WIP Symbol that can be assigned to the Parameter object, get any EXTENT assigned to * it, etc. * * @param typeNode The node of the datatype, might be a CLASS node. */ @Override public void paramNoName(JPNode typeNode) { LOG.trace("Entering paramNoName {}", typeNode); Variable variable = new Variable("", currentScope); currSymbol = variable; if (typeNode.getType() == ProParserTokenTypes.CLASS) typeNode = typeNode.nextNode(); if (typeNode.getType() == ProParserTokenTypes.TYPE_NAME) { variable.setDataType(DataType.getDataType(ProParserTokenTypes.CLASS)); variable.setClassName(typeNode); } else { variable.setDataType(DataType.getDataType(typeNode.getType())); } }
/** The tree parser calls this at an AS node */ @Override public void defAs(JPNode asNode) { LOG.trace("Entering defAs {}", asNode); currSymbol.setAsNode(asNode); Primative primative = (Primative) currSymbol; JPNode typeNode = asNode.nextNode(); if (typeNode.getType() == ProParserTokenTypes.CLASS) typeNode = typeNode.nextNode(); if (typeNode.getType() == ProParserTokenTypes.TYPE_NAME) { primative.setDataType(DataType.getDataType(ProParserTokenTypes.CLASS)); primative.setClassName(typeNode); } else { primative.setDataType(DataType.getDataType(typeNode.getType())); } assert primative.getDataType() != null : "Failed to set datatype at " + asNode.getFilename() + " line " + asNode.getLine(); }
/** The tree parser calls this at an AS node */ @Override public void defAs(JPNode asNode) { LOG.trace("Entering defAs {}", asNode); currSymbol.setAsNode(asNode); Primative primative = (Primative) currSymbol; JPNode typeNode = asNode.nextNode(); if (typeNode.getType() == ProParserTokenTypes.CLASS) typeNode = typeNode.nextNode(); if (typeNode.getType() == ProParserTokenTypes.TYPE_NAME) { primative.setDataType(DataType.getDataType(ProParserTokenTypes.CLASS)); primative.setClassName(typeNode); } else { primative.setDataType(DataType.getDataType(typeNode.getType())); } assert primative.getDataType() != null : "Failed to set datatype at " + asNode.getFilename() + " line " + asNode.getLine(); }