image thumbnail
from toy compiler by Bill McKeeman
A toy compiler

tokens
% FILE:    tokens.m
% PURPOSE: List of token names for simple lexer

function names = tokens
  names = {
    'eof', ...
    'id',  ... xyz
    'int', ... 123
    'lp',  ...  (
    'rp',  ...  )
    'mul', ...  *
    'div', ...  /
    'vid', ...  \
    'add', ...  +
    'sub', ...  -
    'eq',  ...  =
    'semi' ...  ;
  };    

Contact us at files@mathworks.com