class documentation

A lambda calculus expression parser.

Method __init__ to their types.
Method __repr__ Undocumented
Method assertNextToken Undocumented
Method assertToken Undocumented
Method attempt_adjuncts Undocumented
Method attempt_ApplicationExpression Attempt to make an application expression. The next tokens are a list of arguments in parens, then the argument expression is a function being applied to the arguments. Otherwise, return the argument expression.
Method attempt_BooleanExpression Attempt to make a boolean expression. If the next token is a boolean operator, then a BooleanExpression will be returned. Otherwise, the parameter will be returned.
Method attempt_EqualityExpression Attempt to make an equality expression. If the next token is an equality operator, then an EqualityExpression will be returned. Otherwise, the parameter will be returned.
Method get_all_symbols This method exists to be overridden
Method get_BooleanExpression_factory This method serves as a hook for other logic parsers that have different boolean operators
Method get_next_token_variable Undocumented
Method get_QuantifiedExpression_factory This method serves as a hook for other logic parsers that have different quantifiers
Method handle This method is intended to be overridden for logics that use different operators or expressions
Method handle_lambda Undocumented
Method handle_negation Undocumented
Method handle_open Undocumented
Method handle_quant Undocumented
Method handle_variable Undocumented
Method has_priority Undocumented
Method inRange Return TRUE if the given location is within the buffer
Method isvariable Undocumented
Method make_ApplicationExpression Undocumented
Method make_BooleanExpression Undocumented
Method make_EqualityExpression This method serves as a hook for other logic parsers that have different equality expression classes
Method make_LambdaExpression Undocumented
Method make_NegatedExpression Undocumented
Method make_QuanifiedExpression Undocumented
Method make_VariableExpression Undocumented
Method parse Parse the expression.
Method process Split the data into tokens
Method process_next_expression Parse the next complete expression from the stream and return it.
Method process_quoted_token Undocumented
Method token Get the next waiting token. If a location is given, then return the token at currentIndex+location without advancing currentIndex; setting it gives lookahead/lookback capability.
Instance Variable operator_precedence Undocumented
Instance Variable quote_chars Undocumented
Instance Variable right_associated_operations Undocumented
Instance Variable type_check A list of tuples of quote characters. The 4-tuple is comprised of the start character, the end character, the escape character, and a boolean indicating whether the quotes should be included in the result...
Instance Variable _buffer Undocumented
Instance Variable _currentIndex Undocumented
def __init__(self, type_check=False): (source)

to their types.

Parameters
type_checkbool should type checking be performed?
def __repr__(self): (source)

Undocumented

def assertNextToken(self, expected): (source)

Undocumented

def assertToken(self, tok, expected): (source)

Undocumented

def attempt_adjuncts(self, expression, context): (source)
def attempt_ApplicationExpression(self, expression, context): (source)

Attempt to make an application expression. The next tokens are a list of arguments in parens, then the argument expression is a function being applied to the arguments. Otherwise, return the argument expression.

def attempt_BooleanExpression(self, expression, context): (source)

Attempt to make a boolean expression. If the next token is a boolean operator, then a BooleanExpression will be returned. Otherwise, the parameter will be returned.

def attempt_EqualityExpression(self, expression, context): (source)

Attempt to make an equality expression. If the next token is an equality operator, then an EqualityExpression will be returned. Otherwise, the parameter will be returned.

def get_all_symbols(self): (source)

This method exists to be overridden

def get_BooleanExpression_factory(self, tok): (source)

This method serves as a hook for other logic parsers that have different boolean operators

def get_next_token_variable(self, description): (source)

Undocumented

def get_QuantifiedExpression_factory(self, tok): (source)

This method serves as a hook for other logic parsers that have different quantifiers

def handle(self, tok, context): (source)

This method is intended to be overridden for logics that use different operators or expressions

def handle_lambda(self, tok, context): (source)

Undocumented

def handle_negation(self, tok, context): (source)

Undocumented

def handle_open(self, tok, context): (source)

Undocumented

def handle_quant(self, tok, context): (source)

Undocumented

def handle_variable(self, tok, context): (source)

Undocumented

def has_priority(self, operation, context): (source)

Undocumented

def inRange(self, location): (source)

Return TRUE if the given location is within the buffer

def isvariable(self, tok): (source)

Undocumented

def make_ApplicationExpression(self, function, argument): (source)

Undocumented

def make_BooleanExpression(self, factory, first, second): (source)
def make_EqualityExpression(self, first, second): (source)

This method serves as a hook for other logic parsers that have different equality expression classes

def make_LambdaExpression(self, variable, term): (source)

Undocumented

def make_NegatedExpression(self, expression): (source)

Undocumented

def make_QuanifiedExpression(self, factory, variable, term): (source)

Undocumented

def make_VariableExpression(self, name): (source)
def parse(self, data, signature=None): (source)

Parse the expression.

strings :returns: a parsed Expression

Parameters
datastr for the input to be parsed
signaturedict<str, str> that maps variable names to type
def process(self, data): (source)

Split the data into tokens

def process_next_expression(self, context): (source)

Parse the next complete expression from the stream and return it.

def process_quoted_token(self, data_idx, data): (source)

Undocumented

def token(self, location=None): (source)

Get the next waiting token. If a location is given, then return the token at currentIndex+location without advancing currentIndex; setting it gives lookahead/lookback capability.

quote_chars: list = (source)

Undocumented

right_associated_operations = (source)

Undocumented

type_check = (source)

A list of tuples of quote characters. The 4-tuple is comprised of the start character, the end character, the escape character, and a boolean indicating whether the quotes should be included in the result. Quotes are used to signify that a token should be treated as atomic, ignoring any special characters within the token. The escape character allows the quote end character to be used within the quote. If True, the boolean indicates that the final token should contain the quote and escape characters. This method exists to be overridden

_buffer: list = (source)

Undocumented

_currentIndex: int = (source)

Undocumented