Class: Functions12

Six~ Functions12

Example 6/12: compile a little language into JavaScript functions.


new Functions12()

Source:

Extends

Methods


add()

add: '+' product; returns fct for composition

Inherited From:
Source:

assign()

assign: Name '=' sum; returns fct

Source:

cmp()

cmp: sum rel; returns fct

Source:

divide()

divide: '/' signed; returns fct for composition

Inherited From:
Source:

eq()

eq: '=' expr; returns fct for composition

Source:

ge()

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

Source:

gt()

gt: '>' expr; returns fct for composition

Source:

input()

input: 'input' [ Number ]; returns fct

Inherited From:
Source:

le()

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

Source:

list()

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

Inherited From:
Source:

loop()

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

Source:

lt()

lt: '<' expr; returns fct for composition

Source:

multiply()

multiply: '*' signed; returns fct for composition

Inherited From:
Source:

name()

name: Name; returns fct

Inherited From:
Source:

ne()

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

Source:

number()

number: Number; returns fct

Inherited From:
Source:

print()

print: 'print' sums; returns function

Source:

product()

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

Inherited From:
Source:

prog()

prog: stmts; returns executable

Source:

select()

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

Source:

signed()

signed: [ '-' ] term; returns fct

Inherited From:
Source:

stmts()

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

Source:

subtract()

subtract: '-' product; returns fct for composition

Inherited From:
Source:

sum()

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

Overrides:
Source:

sums()

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

Source:

term()

term: number | '(' sum ')';

Inherited From:
Source: