Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- expr : expr '+' ident | ident
- void ShiftIdent() {
- current_token++;
- }
- void ShiftPlus() {
- current_token++;
- }
- void ShiftExpr() {
- switch(current_token->type) {
- case ident:
- ShiftIdent();
- break;
- default:
- error();
- }
- while(true) {
- switch(current_token->type) {
- case '+':
- ShiftPlus();
- ShiftIdent();
- break;
- default:
- return;
- };
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement