use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.constant.ConstantDescriptor in project TrufflePascal by Aspect26.
the class FatalError method CaseConstantList.
List<ConstantDescriptor> CaseConstantList() {
List<ConstantDescriptor> caseConstants;
caseConstants = new ArrayList<>();
ConstantDescriptor constant = Constant();
caseConstants.add(constant);
while (la.kind == 10) {
Get();
constant = Constant();
caseConstants.add(constant);
}
return caseConstants;
}
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 == 27 || la.kind == 28) {
if (la.kind == 27) {
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 == 1) {
Token identifier = IdentifierConstant();
constant = factory.createConstantFromIdentifier(sign, identifier);
} else
SynErr(68);
return constant;
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.constant.ConstantDescriptor in project TrufflePascal by Aspect26.
the class FatalError method CaseConstantList.
List<ConstantDescriptor> CaseConstantList() {
List<ConstantDescriptor> caseConstants;
caseConstants = new ArrayList<>();
ConstantDescriptor constant = Constant();
caseConstants.add(constant);
while (la.kind == 10) {
Get();
constant = Constant();
caseConstants.add(constant);
}
return caseConstants;
}
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(25);
ConstantDescriptor upperBound = Constant();
ordinal = factory.createSimpleOrdinalDescriptor(lowerBound, upperBound);
return ordinal;
}
use of cz.cuni.mff.d3s.trupple.parser.identifierstable.types.constant.ConstantDescriptor in project TrufflePascal by Aspect26.
the class FatalError method ConstantDefinition.
void ConstantDefinition() {
Expect(1);
Token identifier = t;
Expect(13);
ConstantDescriptor constant = Constant();
factory.registerConstant(identifier, constant);
}
Aggregations