Navigation
Synopsis code models are abstract representations of source code
Description You can use any of Rascal's Values to represent facts about source code. For example, AlgebraicDataType can be used to define abstract syntax trees and Relation are used to represent call graphs. We consistently use Location to refer to source code artifacts, either physically (|file:///tmp/HelloWorld.java|) or logically (|java+class://java/lang/Object|).

Specifically we have standardized a set of models to represent source code which are ready for computing metrics: m3. This M3 model consists of:
  • an open (extensible) set of Relations between source code artifacts.
  • a number of extensible AlgebraicDataType for representing abstract syntax trees.
The core language independent model can be found here: m3

Extensions for representing facts about specific languages:
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.