Artifact 876c3d55fc142609af493afb0b2acf46e7fdc7154c17d490e76f5f0049989765:


% ----- A simple DEMO of MINI -------
%       Use after IN "/utah/psl/mini.build"

MINI 'ROOT;                         % starts the mini parser generator
 
ROOT: STMT* / 'QUIT ;         % Define ROOT

STMT: ID '= EXP @; +(SETQ #2  #1) 
      .(PRINT #1)  .(NEXT!-TOK) ;    % Define STMT

EXP:  TERM < '+ EXP +(PLUS #2 #1) /  
             '- EXP +(DIFFERENCE #2 #1)>;

TERM: NUM / ID /  '( EXP ') ;

FIN

% To run it, use

% INVOKE 'ROOT;


END;



REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]