Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
D
DecafPlus
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Tianqi Yang
  • DecafPlus
  • Repository

Switch branch/tag
  • DecafPlus
  • src
  • decaf
  • error
  • BinaryOperatorNotFoundError.java
Find file
BlameHistoryPermalink
  • Tianqi Yang's avatar
    feat(operator): allow operator overloading for binary/unary/print op · 3b7bf68e
    Tianqi Yang authored Jan 12, 2019
    Add support for operator overloading:
    - Binary operator:
    	+ : add
    	- : sub
    	* : mul
    	/ : div
    	% : mod
    	&&: and
    	||: or
    	==: eq
    	!=: ne
    	< : lt
    	> : gt
    	<=: le
    	>=: ge
    - Unary operator:
    	- : neg
    	! : not
    - print function
    
    Binary operator overloading:
    - Try to find op and rop, if ambiguous then issue an error
    
    Modify AST:
    - Add member callExpr to some of the nodes to store operator function
    
    Add errors:
    - BinaryOperatorAmbiguousError:
    	Ambiguous candidates for binary operator
    - BinaryOperatorNotFoundError
    	No method match the binary operator
    - UnaryOperatorNotFoundError
    	No method match the unary operator
    3b7bf68e
BinaryOperatorNotFoundError.java 1.26 KB
EditWeb IDE
×

Replace BinaryOperatorNotFoundError.java

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.