Guest User

Untitled

a guest
Apr 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. assignment_statement
  2. : _ID
  3. {
  4. if( ($$ = lookup_id((char *)$1, GLOBAL_VAR|LOCAL_VAR|PARAMETER)) == -1 )
  5. syyerror("invalid lvalue in assignment");
  6. assign_type = $$;
  7. }
  8. numeric _SEMICOLON
  9.  
  10. ;
  11.  
  12. numeric
  13. : _ASSIGN num_exp
  14. {
  15. if(!check_types(assign_type, $2))
  16. syyerror("incompatible types in assignment");
  17. }
  18. | numeric _ASSIGN num_exp
  19. {
  20. if(!check_types(assign_type, $3))
  21. syyerror("incompatible types in assignment");
  22. }
  23. ;
Add Comment
Please, Sign In to add comment