Skip to content

Instantly share code, notes, and snippets.

@MohamedIBrahim
Created October 24, 2011 08:58
Show Gist options
  • Select an option

  • Save MohamedIBrahim/1308626 to your computer and use it in GitHub Desktop.

Select an option

Save MohamedIBrahim/1308626 to your computer and use it in GitHub Desktop.
Simple Parse and Translate an Expression
{ Parse and Translate an Expression }
procedure Expression;
begin
Term;
EmitLn('MOVE D0,D1');
case Look of
'+': Add;
'-': Subtract;
else Expected('Addop');
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment