use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.complex.OrdinalDescriptor in project TrufflePascal by Aspect26.
the class FatalError method SubrangeType.
OrdinalDescriptor SubrangeType() {
OrdinalDescriptor ordinal;
ConstantDescriptor lowerBound = Constant();
Expect(25);
ConstantDescriptor upperBound = Constant();
ordinal = factory.createSimpleOrdinalDescriptor(lowerBound, upperBound);
return ordinal;
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.complex.OrdinalDescriptor in project TrufflePascal by Aspect26.
the class FatalError method Type.
TypeDescriptor Type() {
TypeDescriptor typeDescriptor;
typeDescriptor = null;
if (isSubrange()) {
typeDescriptor = SubrangeType();
} else if (la.kind == 1) {
Get();
typeDescriptor = factory.getTypeDescriptor(t);
} else if (la.kind == 6) {
typeDescriptor = EnumDefinition();
} else if (la.kind == 16 || la.kind == 17) {
List<OrdinalDescriptor> ordinalDimensions = ArrayDefinition();
while (continuesArray()) {
Expect(14);
List<OrdinalDescriptor> additionalDimensions = ArrayDefinition();
ordinalDimensions.addAll(additionalDimensions);
}
Expect(14);
Expect(1);
typeDescriptor = factory.createArray(ordinalDimensions, t);
} else if (la.kind == 15) {
Get();
Expect(14);
OrdinalDescriptor ordinal = Ordinal();
typeDescriptor = factory.createSetType(ordinal);
} else if (la.kind == 20) {
typeDescriptor = FileType();
} else if (la.kind == 21) {
typeDescriptor = RecordType();
} else if (la.kind == 23) {
typeDescriptor = PointerType();
} else
SynErr(73);
return typeDescriptor;
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.complex.OrdinalDescriptor in project TrufflePascal by Aspect26.
the class FatalError method ArrayDefinition.
List<OrdinalDescriptor> ArrayDefinition() {
List<OrdinalDescriptor> ordinalDimensions;
if (la.kind == 16) {
Get();
}
Expect(17);
ordinalDimensions = new ArrayList<>();
Expect(18);
OrdinalDescriptor ordinalDescriptor = null;
ordinalDescriptor = Ordinal();
ordinalDimensions.add(ordinalDescriptor);
while (la.kind == 10) {
Get();
ordinalDescriptor = Ordinal();
ordinalDimensions.add(ordinalDescriptor);
}
Expect(19);
return ordinalDimensions;
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.complex.OrdinalDescriptor in project TrufflePascal by Aspect26.
the class FatalError method RecordVariantSelector.
OrdinalDescriptor RecordVariantSelector() {
OrdinalDescriptor selectorDescriptor;
Token tagToken = null;
if (isVariantSelectorTag()) {
Expect(1);
tagToken = t;
Expect(25);
}
Expect(1);
if (tagToken != null)
factory.registerRecordVariantTagVariable(tagToken, t);
selectorDescriptor = factory.castTypeToOrdinalType(factory.getTypeDescriptor(t));
return selectorDescriptor;
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.complex.OrdinalDescriptor in project TrufflePascal by Aspect26.
the class FatalError method RecordVariantPart.
void RecordVariantPart() {
Expect(24);
OrdinalDescriptor selectorType = RecordVariantSelector();
Expect(14);
List<ConstantDescriptor> caseConstants = RecordVariants();
factory.assertLegalsCaseValues(selectorType, caseConstants);
}
Aggregations