ConstantExpression

Handles the Python interpretation of a constant-expression. See ISO/IEC 14882:1998(E)

class cpip.core.ConstantExpression.ConstantExpression(theTokTypeS)

Class that interpret a stream of pre-processing tokens (cpip.core.PpToken.PpToken objects) and evaluate it as a constant expression.

evaluate()

Evaluates the constant expression and returns 0 or 1.

translateTokensToString()

Returns a string to be evaluated as a constant-expression.

ISO/IEC ISO/IEC 14882:1998(E) 16.1 Conditional inclusion sub-section 4 i.e. 16.1-4

All remaining identifiers and keywords 137) , except for true and false, are replaced with the pp-number 0

exception cpip.core.ConstantExpression.ExceptionConditionalExpression

Exception when conditional expression e.g. ... ? ... : ... fails to evaluate.

exception cpip.core.ConstantExpression.ExceptionConditionalExpressionInit

Exception when initialising a ConstantExpression class.

exception cpip.core.ConstantExpression.ExceptionConstantExpression

Simple specialisation of an exception class for the ConstantExpression classes.

exception cpip.core.ConstantExpression.ExceptionEvaluateExpression

Exception when conditional expression e.g. 1 < 2 fails to evaluate.