[comp.lang.c] wanted: WSN to YACC converter

anita@tnoibbc.UUCP (Anita Eijs) (02/08/90)

I am looking for a program that converts WSN (Wirth Syntax Notation)
into (LEX and) YACC-source.

Some WSN-examples, which should be converted to yacc-sentences, are :
	WSN				YACC
	===				=====
	stmt-list = stmt { stmt } .	stmt_list:
						stmt
						| stmt_list stmt ;

	par-list = { par } .		par_list:
						/* empty */
						| par_list par ;

	sign = [ plus | minus ]	.	sign:	/* empty */
						| plus
						| minus ;

	boolean = ( true | false ) .	boolean:
						true
						| false ;

	compound-stmt =			compound_stmt:
		begin { stmt } end ';'.		begin stmt_list_0 end semi ;
					stmt_list_0: /* empty */
						| stmt_list_0 stmt ;

Some WSN-examples, which should be converted to lex-sentences, are :
	WSN				LEX
	===				===
	greater = '>' .			">"	return(GREATER);
	if = 'if' .			"if"	return(IF);
where GREATER and IF are defines.
	
It also should convert complex WSN-sentences like :
	function-call = ( built-in-function | defined-function )
		[ '(' parameter { ',' parameter } ')' ] ';' .

Please let me know by e-mail.

Thanks in advance.
-- 
Anita Eijs : TNO - IBBC                     USENET : anita@tnoibbc
           : PO-box 49                      UUCP   : ..!hp4nl!tnoibbc!anita
           : 2600 AA  Delft                 DOMAIN : anita@tnoibbc.ibbc.tno.nl
           : the Netherlands                FAX    : +31 15 620304