Search in sources :

Example 6 with ConstantDescriptor

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

the class FatalError method RecordVariant.

List<ConstantDescriptor> RecordVariant() {
    List<ConstantDescriptor> caseConstants;
    caseConstants = CaseConstantList();
    Expect(25);
    Expect(6);
    TypeDescriptor type = RecordFieldList();
    Expect(7);
    return caseConstants;
}
Also used : TypeDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor) ConstantDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.constant.ConstantDescriptor)

Example 7 with ConstantDescriptor

use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.constant.ConstantDescriptor 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);
}
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 8 with ConstantDescriptor

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

the class FatalError method RecordVariant.

List<ConstantDescriptor> RecordVariant() {
    List<ConstantDescriptor> caseConstants;
    caseConstants = CaseConstantList();
    Expect(24);
    Expect(6);
    TypeDescriptor type = RecordFieldList();
    Expect(7);
    return caseConstants;
}
Also used : TypeDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor) ConstantDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.constant.ConstantDescriptor)

Example 9 with ConstantDescriptor

use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.constant.ConstantDescriptor 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 10 with ConstantDescriptor

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

the class FatalError method Constant.

ConstantDescriptor Constant() {
    ConstantDescriptor constant;
    constant = null;
    String sign = "";
    if (la.kind == 28 || la.kind == 29) {
        if (la.kind == 28) {
            Get();
        } else {
            Get();
            sign = t.val;
        }
    }
    if (la.kind == 3) {
        long value = UnsignedIntegerLiteral();
        constant = factory.createNumericConstant(sign, value);
    } else if (la.kind == 4) {
        double value = UnsignedDoubleLiteral();
        constant = factory.createDoubleConstant(sign, value);
    } else if (la.kind == 2) {
        String value = StringLiteral();
        constant = factory.createCharOrStringConstant(sign, value);
    } else if (la.kind == 64 || la.kind == 65) {
        boolean value = LogicLiteral();
        constant = factory.createBooleanConstant(sign, value);
    } else if (la.kind == 1) {
        Token identifier = IdentifierConstant();
        constant = factory.createConstantFromIdentifier(sign, identifier);
    } else
        SynErr(76);
    return constant;
}
Also used : ConstantDescriptor(cz.cuni.mff.d3s.trupple.parser.identifierstable.types.constant.ConstantDescriptor)

Aggregations

ConstantDescriptor (cz.cuni.mff.d3s.trupple.parser.identifierstable.types.constant.ConstantDescriptor)12 OrdinalDescriptor (cz.cuni.mff.d3s.trupple.parser.identifierstable.types.complex.OrdinalDescriptor)4 TypeDescriptor (cz.cuni.mff.d3s.trupple.parser.identifierstable.types.TypeDescriptor)2