use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor 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()));
}
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor in project TrufflePascal by Aspect26.
the class FatalError method VariableLineDeclaration.
void VariableLineDeclaration() {
List<String> identifiers = IdentifiersList();
Expect(25);
TypeDescriptor typeDescriptor = Type();
factory.registerVariables(identifiers, typeDescriptor);
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor in project TrufflePascal by Aspect26.
the class FatalError method RecordFieldList.
TypeDescriptor RecordFieldList() {
TypeDescriptor typeDescriptor;
if (la.kind == 1) {
RecordFixedPart();
if (recordVariantPartStarts()) {
Expect(8);
RecordVariantPart();
}
} else if (la.kind == 23) {
RecordVariantPart();
} else if (la.kind == 7 || la.kind == 8 || la.kind == 21) {
} else
SynErr(67);
if (la.kind == 8) {
Get();
}
typeDescriptor = factory.createRecordType();
return typeDescriptor;
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor in project TrufflePascal by Aspect26.
the class FatalError method VariableLineDeclaration.
void VariableLineDeclaration() {
List<String> identifiers = IdentifiersList();
Expect(24);
TypeDescriptor typeDescriptor = Type();
factory.registerVariables(identifiers, typeDescriptor);
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor in project TrufflePascal by Aspect26.
the class FatalError method RecordType.
TypeDescriptor RecordType() {
TypeDescriptor typeDescriptor;
Expect(20);
factory.startRecord();
typeDescriptor = RecordFieldList();
Expect(21);
factory.finishRecord();
return typeDescriptor;
}
Aggregations