1
|
/**
|
2
|
*
|
3
|
* OOAS Compiler (Deprecated)
|
4
|
*
|
5
|
* Copyright 2015, Institute for Software Technology, Graz University of
|
6
|
* Technology. Portions are copyright 2015 by the AIT Austrian Institute
|
7
|
* of Technology. All rights reserved.
|
8
|
*
|
9
|
* SEE THE "LICENSE" FILE FOR THE TERMS UNDER WHICH THIS FILE IS PROVIDED.
|
10
|
*
|
11
|
* Please notice that this version of the OOAS compiler is considered de-
|
12
|
* precated. Only the Java version is maintained.
|
13
|
*
|
14
|
* Contributors:
|
15
|
* Willibald Krenn (TU Graz/AIT)
|
16
|
* Stefan Tiran (TU Graz/AIT)
|
17
|
*/
|
18
|
|
19
|
using System;
|
20
|
using System.Collections.Generic;
|
21
|
using System.Text;
|
22
|
using TUG.Mogentes.Codegen;
|
23
|
using TUG.Mogentes.Codegen.Prolog;
|
24
|
|
25
|
namespace TUG.Mogentes.Codegen.PrologSymbolic
|
26
|
{
|
27
|
class OoaPrologSymbolicType : OoaPrologType
|
28
|
{
|
29
|
new public class Factory : OoaPrologType.Factory
|
30
|
{
|
31
|
public override OoaPrologType create(OoaPrologIdentifier.Factory idFactory)
|
32
|
{ return new OoaPrologSymbolicType(idFactory); }
|
33
|
}
|
34
|
|
35
|
public override string GetInternalTypeDefinitions()
|
36
|
{
|
37
|
OoaCodeEmitter result = new OoaCodeEmitter();
|
38
|
|
39
|
result.AppendLine("type(bool, X) :- member(X, [true, false]).");
|
40
|
result.AppendLine("type(char, X) :- X in 0..255, labeling([],[X]).");
|
41
|
|
42
|
return result.ToString();
|
43
|
}
|
44
|
|
45
|
private OoaPrologSymbolicType(OoaPrologIdentifier.Factory idFactory)
|
46
|
: base(idFactory)
|
47
|
{
|
48
|
}
|
49
|
}
|
50
|
}
|