calc_def - | Expr '+' Expr | Expr '-' Expr | 'n' | '|' Expr...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
%{ #include <stdio.h> int yylex(void); void yyerror(char *); %} %% List : List Expr ';' {printf("parsed expresion\n");} | Expr ';' {printf("parsed expresion\n");} ; Expr : Expr '*' Expr | Expr 'mod' Expr
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: | Expr '+' Expr | Expr '-' Expr | 'n' | '|' Expr '|' | '(' Expr ')' ; %% void yyerror(char *s) { fprintf(stderr, &quot;%s\n&quot;, s); return; } int main(void) { yyparse(); return 0; }...
View Full Document

This note was uploaded on 02/19/2012 for the course ENGR 361 taught by Professor Drexel during the Spring '12 term at Bloomsburg.

Ask a homework question - tutors are online