-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADTsbase replaced with ADTsCore - Only contains neccessary ADT featur…
…es for RelationTerm so far. RelationTerm now compiling.
- Loading branch information
Showing
6 changed files
with
49 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
""" This module contains the basic components of an Abstract Term for constructing an ADT | ||
""" | ||
|
||
module ADTsCore | ||
|
||
using MLStyle | ||
|
||
export AbstractTerm | ||
|
||
""" AbstractTerm | ||
The super type for all ADT types. This abstract type exists so that we can write generic methods that work on any term in any of the domain specific syntaxes. | ||
For example, serializing to a Dictionary uses some reflection snippet that works for arbitrary types, but we only want to apply it to things that should be serialized like a Term. | ||
""" | ||
abstract type AbstractTerm end | ||
|
||
""" Header | ||
1. Marks the header of our UWDModel. Provides basic metadata. | ||
2. amr_to_string() allows us to represent the header as a string. | ||
""" | ||
|
||
@as_record struct Header <: AbstractTerm | ||
name::String | ||
schema::String | ||
description::String | ||
schema_name::String | ||
model_version::String | ||
end | ||
|
||
function amr_to_string(amr) | ||
@match amr begin | ||
Header(name, s, d, sn, mv) => "\"\"\"\nASKE Model Representation: $name$mv :: $sn \n $s\n\n$d\n\"\"\"" | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters