yapps Package

yapps Package

yappsrt Module

exception pymappu.yapps.yappsrt.NoMoreTokens

Bases: exceptions.Exception

Another exception object, for when we run out of tokens

class pymappu.yapps.yappsrt.Parser(scanner)
class pymappu.yapps.yappsrt.Scanner(patterns, ignore, input)

Patterns is [(terminal,regex)...] Ignore is [terminal,...]; Input is a string

scan(restrict)

Should scan another token and add it to the list, self.tokens, and add the restriction to self.restrictions

token(i, restrict=0)

Get the i'th token, and if i is one past the end, then scan for another token; restrict is a list of tokens that are allowed, or 0 for any token.

exception pymappu.yapps.yappsrt.SyntaxError(pos=-1, msg='Bad Token')

Bases: exceptions.Exception

When we run into an unexpected token, this is the exception to use

pymappu.yapps.yappsrt.print_error(input, err, scanner)

This is a really dumb long function to print error messages nicely.

pymappu.yapps.yappsrt.wrap_error_reporter(parser, rule)

Table Of Contents

Previous topic

pymappu Package

This Page