Class: TCheck02

Seven~ TCheck02

Example 7/02: actions to type-check and compile int|float|string into functions.


new TCheck02()

Source:

Extends

Members


parser

For error messages

Source:

stack

For symbolic computing with types

Source:

symbols

Symbol table, maps names to types

Source:

Methods


_cast()

Converts fct:from into fct:to if needed

Source:

_type()

Returns type of name, message if undefined

Source:

_unq()

Removes quotes and backslash

Inherited From:
Overrides:
Source:

add()

add: '+' product; returns fct:string|int|float

Overrides:
Source:

assign()

assign: Name '=' sum; returns fct

Overrides:
Source:

cmp()

cmp: sum rel; returns fct

Overrides:
Source:

decl()

decl: type Name [{ ',' Name }];

Source:

divide()

divide: '/' signed; returns fct:float

Overrides:
Source:

eq()

eq: '=' expr; returns fct for composition

Inherited From:
Overrides:
Source:

float()

float: Float; returns fct:float

Source:

ge()

ge: '>=' expr; returns fct for composition

Inherited From:
Overrides:
Source:

gt()

gt: '>' expr; returns fct for composition

Inherited From:
Overrides:
Source:

input()

input: 'input' String String; returns fct.string

Overrides:
Source:

int()

int: Int; returns fct:int

Source:

le()

le: '<=' expr; returns fct for composition

Inherited From:
Overrides:
Source:

list()

list: sum [{ ',' sum }]; returns executable

Inherited From:
Overrides:
Source:

loop()

loop: 'while' cmp 'do' stmts 'od'; returns fct

Inherited From:
Overrides:
Source:

lt()

lt: '<' expr; returns fct for composition

Inherited From:
Overrides:
Source:

multiply()

multiply: '*' signed; returns fct:int|float

Overrides:
Source:

name()

name: Name; returns fct:_type(name)

Overrides:
Source:

ne()

ne: '<>' expr; returns fct for composition

Inherited From:
Overrides:
Source:

number()

number: Number; returns fct

Inherited From:
Overrides:
Source:

print()

print: 'print' sums; returns fct, string arguments only

Overrides:
Source:

printAny()

printAny: 'print' sums; returns fct

Source:

product()

product: signed [{ multiply | divide }]; returns fct

Inherited From:
Overrides:
Source:

prog()

prog: [{ decl ';' }] stmts; returns executable

Overrides:
Source:

select()

select: 'if' cmp 'then' stmts [ 'else' stmts ] 'fi'; returns fct

Inherited From:
Overrides:
Source:

signed()

signed: [ '-' ] term; returns fct:term

Overrides:
Source:

stmts()

stmts: stmt [{ ';' stmt }]; returns fct

Inherited From:
Overrides:
Source:

string()

string: String; returns fct:string

Overrides:
Source:

stringEq()

stringEq: '=' stringSum; returns fct for composition

Inherited From:
Overrides:
Source:

stringGe()

stringGe: '>=' stringSum; returns fct for composition

Inherited From:
Overrides:
Source:

stringGt()

stringGt: '>' stringSum; returns fct for composition

Inherited From:
Overrides:
Source:

stringLe()

stringLe: '<=' stringSum; returns fct for composition

Inherited From:
Overrides:
Source:

stringLt()

stringLt: '<' stringSum; returns fct for composition

Inherited From:
Overrides:
Source:

stringNe()

stringNe: '<>' stringSum; returns fct for composition

Inherited From:
Overrides:
Source:

stringSum()

stringSum: stringTerm [{ stringTerm }]; returns fct

Inherited From:
Overrides:
Source:

stringTerm()

stringTerm: string | name | input | 'string' term;

Inherited From:
Overrides:
Source:

subtract()

subtract: '-' product; returns fct:int|float

Overrides:
Source:

sum()

sum: product [{ add | subtract }]; returns fct

Inherited From:
Overrides:
Source:

sums()

sums: sum [{ ',' sum }]; returns list of functions

Inherited From:
Overrides:
Source:

term()

term: int | float | string | name | input | 'int' term | 'float' term | 'string' term | '(' sum ')'; returns fct:term

Overrides:
Source: