Search in sources :

Example 1 with TypeTypeDescriptor

use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeTypeDescriptor in project TrufflePascal by Aspect26.

the class IdentifiersTable method addBuiltinTypes.

protected void addBuiltinTypes() {
    typeDescriptors.put("integer", IntDescriptor.getInstance());
    typeDescriptors.put("shortint", IntDescriptor.getInstance());
    typeDescriptors.put("longint", LongDescriptor.getInstance());
    typeDescriptors.put("int64", LongDescriptor.getInstance());
    typeDescriptors.put("byte", IntDescriptor.getInstance());
    typeDescriptors.put("single", RealDescriptor.getInstance());
    typeDescriptors.put("real", RealDescriptor.getInstance());
    typeDescriptors.put("boolean", BooleanDescriptor.getInstance());
    typeDescriptors.put("char", CharDescriptor.getInstance());
    for (Map.Entry<String, TypeDescriptor> typeEntry : typeDescriptors.entrySet()) {
        identifiersMap.put(typeEntry.getKey(), new TypeTypeDescriptor(typeEntry.getValue()));
    }
}
Also used : TypeDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor) TypeTypeDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeTypeDescriptor) TypeTypeDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeTypeDescriptor) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with TypeTypeDescriptor

use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeTypeDescriptor in project TrufflePascal by Aspect26.

the class IdentifiersTable method addType.

public void addType(String identifier, TypeDescriptor typeDescriptor) throws LexicalException {
    this.registerNewIdentifier(identifier, new TypeTypeDescriptor(typeDescriptor));
    this.typeDescriptors.put(identifier, typeDescriptor);
}
Also used : TypeTypeDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeTypeDescriptor)

Aggregations

TypeTypeDescriptor (cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeTypeDescriptor)2 TypeDescriptor (cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1