use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor in project TrufflePascal by Aspect26.
the class RecordValue method initValues.
private void initValues(FrameDescriptor frameDescriptor, Map<String, TypeDescriptor> types) {
for (FrameSlot slot : frameDescriptor.getSlots()) {
TypeDescriptor slotsType = types.get(slot.getIdentifier().toString());
this.initValue(slot, slotsType);
}
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor in project TrufflePascal by Aspect26.
the class IdentifiersTable method setSubroutineRootNode.
public void setSubroutineRootNode(String identifier, PascalRootNode rootNode) throws LexicalException {
TypeDescriptor descriptor = this.identifiersMap.get(identifier);
if (descriptor == null) {
throw new UnknownIdentifierException(identifier);
}
((SubroutineDescriptor) descriptor).setRootNode(rootNode);
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor in project TrufflePascal by Aspect26.
the class IdentifiersTable method forwardFunction.
public void forwardFunction(String identifier, List<FormalParameter> formalParameters, TypeDescriptor returnTypeDescriptor) throws LexicalException {
TypeDescriptor typeDescriptor = new FunctionDescriptor(formalParameters, returnTypeDescriptor);
this.registerNewIdentifier(identifier, typeDescriptor);
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor in project TrufflePascal by Aspect26.
the class InNode method verifyChildrenNodeTypes.
@Override
public boolean verifyChildrenNodeTypes() {
if (!(getRightNode().getType() instanceof SetDescriptor)) {
return false;
}
TypeDescriptor valueType = getLeftNode().getType();
SetDescriptor set = (SetDescriptor) getRightNode().getType();
return set.getInnerType() == valueType || valueType.convertibleTo(set.getInnerType());
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor in project TrufflePascal by Aspect26.
the class LexicalScope method generateInitializationNodes.
List<StatementNode> generateInitializationNodes(VirtualFrame frame) {
List<StatementNode> initializationNodes = new ArrayList<>();
for (Map.Entry<String, TypeDescriptor> entry : this.localIdentifiers.getAllIdentifiers().entrySet()) {
String identifier = entry.getKey();
TypeDescriptor typeDescriptor = entry.getValue();
StatementNode initializationNode = createInitializationNode(identifier, typeDescriptor, frame);
if (initializationNode != null) {
initializationNodes.add(initializationNode);
}
}
return initializationNodes;
}
Aggregations