Parsing

ratus.parse

class ratus.parse.BinaryOp(op_type: ratus.parse.BinaryOpType, left: ratus.parse.Expression, right: ratus.parse.Expression)[source]

Binary operation.

Binary operations have a type that maps them to the operation that is being performed and left and right operands upon which the operation is performed.

class ratus.parse.BinaryOpType[source]

Binary operation type.

class ratus.parse.Expression[source]

Base representation of an expression.

class ratus.parse.Float(value: float)[source]

Float literal.

class ratus.parse.Function(name: str, args: List[ratus.parse.Expression])[source]

Function call.

Functions have a name which is used to look them up in the executor and a list of arguments that the function should be called with.

class ratus.parse.Integer(value: int)[source]

Integer literal.

class ratus.parse.Literal[source]

Literal value.

exception ratus.parse.ParserError[source]

Exception raised when there is an error parsing.

class ratus.parse.String(value: str)[source]

String literal.

class ratus.parse.UnaryOp(op_type: ratus.parse.UnaryOpType, operand: ratus.parse.Expression)[source]

Unary operation.

Unary operations have a type and a single operand upon which the action is performed.

class ratus.parse.UnaryOpType[source]

Unary operation type.