Advertisement
Guest User

Untitled

a guest
Feb 1st, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. expr : expr '+' ident | ident
  2.  
  3. void ShiftIdent() {
  4. current_token++;
  5. }
  6.  
  7. void ShiftPlus() {
  8. current_token++;
  9. }
  10.  
  11. void ShiftExpr() {
  12. switch(current_token->type) {
  13. case ident:
  14. ShiftIdent();
  15. break;
  16. default:
  17. error();
  18. }
  19. while(true) {
  20. switch(current_token->type) {
  21. case '+':
  22. ShiftPlus();
  23. ShiftIdent();
  24. break;
  25. default:
  26. return;
  27. };
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement