Search in sources :

Example 11 with OrdinalDescriptor

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(26);
    ConstantDescriptor upperBound = Constant();
    ordinal = factory.createSimpleOrdinalDescriptor(lowerBound, upperBound);
    return ordinal;
}
Also used : ConstantDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.constant.ConstantDescriptor) OrdinalDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.complex.OrdinalDescriptor)

Example 12 with OrdinalDescriptor

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(23);
    OrdinalDescriptor selectorType = RecordVariantSelector();
    Expect(13);
    List<ConstantDescriptor> caseConstants = RecordVariants();
    factory.assertLegalsCaseValues(selectorType, caseConstants);
}
Also used : ConstantDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.constant.ConstantDescriptor) OrdinalDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.complex.OrdinalDescriptor)

Example 13 with OrdinalDescriptor

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

the class FatalError method Ordinal.

OrdinalDescriptor Ordinal() {
    OrdinalDescriptor ordinal;
    ordinal = null;
    if (isSubrange()) {
        ordinal = SubrangeType();
    } else if (StartOf(1)) {
        TypeDescriptor typeDescriptor = Type();
        ordinal = factory.castTypeToOrdinalType(typeDescriptor);
    } else
        SynErr(66);
    return ordinal;
}
Also used : TypeDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor) OrdinalDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.complex.OrdinalDescriptor)

Aggregations

OrdinalDescriptor (cz.cuni.mff.d3s.trupple.parser.identifierstable.types.complex.OrdinalDescriptor)13 TypeDescriptor (cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor)5 ConstantDescriptor (cz.cuni.mff.d3s.trupple.parser.identifierstable.types.constant.ConstantDescriptor)4 ArrayList (java.util.ArrayList)2 List (java.util.List)2 LexicalException (cz.cuni.mff.d3s.trupple.parser.exceptions.LexicalException)1