/* makeWEAVE definitions for a parser for simple formatted
 * PASCAL code. (preBISON file of makeWEAVE)
 */


%token SEMI
%token BEG
%token END
%token MATH
%token SIMP
%token OPEN
%token CLOSE
%token ALPHA
%token OMEGA
%token UNTIL
%token INTRO
%token PROC
%token COLON
%token ELSE

%{
#define YYDEBUG 1
%}

%%

stmt_list	: stmt
		| stmt_list SEMI stmt 	{$1 + $2 + force + $3}
		| SEMI 			{"Hallo" + null}
		| stmt_list SEMI  	{ $1 + $2}
;


stmt		: BEG stmt_list END  	{$1 + indent + "[3]" + force + $2 +
						outdent + force + $3 }
		| math
;

math		: MATH
		| math math
		| SIMP
		| OPEN math CLOSE
;

stmt		: ALPHA math OMEGA stmt 	{$1 + " " + $2 + " " + $3 +
					indent + "[2]" +
					force + $4 + outdent }
;

stmt		: BEG stmt_list UNTIL math  	{$1 + indent +"[1]" + force +
					$2 + outdent + force + $3 + $4 }
;

proc		: proc INTRO math SEMI 	{$1 + $2 + $3 + $4 + force}
		| proc stmt		{$1 + $2 + force}
		| PROC
;

stmt		: INTRO math SEMI 	{$1 + $2 + $3 + force}
;


