teaching machines

CS 330 Lecture 9 – A Calculator

February 13, 2015 by . Filed under cs330, lectures, spring 2015.

Agenda

TODO

Code

Basecalc.g

grammar Basecalc;

line
  : expr 
  | expr CAST DIGITS
  ;

expr
  :

LEFT_PARENTHESIS: '(';
RIGHT_PARENTHESIS: ')';
POWER: '^^';
MULTIPLICATIVE_OPERATOR: [*/%];
ADDITIVE_OPERATOR: [-+];
NOT: '~';
SHIFT: '<<' | '>>';
AND: '&';
XOR: '^';
OR: '|';
ASSIGNMENT: ':=';
CAST: '->';
LESS: '<';
GREATER: '>';
IDENTIFIER: '$' [a-z]+ [a-z_]*;
DIGITS: [0-9a-zA-Z]+;

Haiku

on being a witness
Judge, the court grammar!
answer -> YES | NO
Not KINDA SORTA