Commit c2e5f245 authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

dummy testing of intention parsing

parent dbe2b6e2
......@@ -45,6 +45,7 @@ TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" | "/*" "*"+ [^/*] ~"*/"
EndOfLineComment = "//" {InputCharacter}* {LineTerminator}?
Identifier = [[:letter:]_]([[:letter:]_[:digit:]])*
StringLiteral = [:jletterdigit:]*
DecimalNumeral = 0 | {NonZeroDigit} {Digits}?
Digits = {Digit}+
......
import java.util.*;
aspect Intentions {
inh Decl ConcreteType.parentDecl();
coll Set Decl.allIntentions() [new HashSet()] with add;
ConcreteType contributes getIntentionString()
to Decl.allIntentions()
for parentDecl();
}
aspect Signature {
syn boolean Decl.isSampleDecl();
......@@ -14,7 +24,35 @@ aspect Signature {
inh Decl Signature.parentDecl();
inh Decl SignatureList.parentDecl();
/// TESTING
syn String Decl.getIntentionString() {
StringBuilder sb = new StringBuilder();
Iterator<String> iti = allIntentions().iterator();
while(iti.hasNext()) {
//Intention i = iti.next();
//sb.append("("+i.getKey()+" : "+i.getValue()+") ");
String i = iti.next();
sb.append(i);
}
return sb.toString();
}
syn String ConcreteType.getIntentionString() {
StringBuilder sb = new StringBuilder();
List<Intention> ints = getIntentionList();
for(Intention i : ints) {
sb.append("("+i.getKey()+" : "+i.getValue()+") ");
}
return sb.toString();
}
public void Decl.debugIntentions() {
System.out.println("Decl.intentions: " + getIntentionString());
}
// TESTING END
syn nta Signature Decl.getSignature() {
debugIntentions();
SignatureList sl = new SignatureList();
genSigLineForDecl(sl, true);
SignatureList fsl = new SignatureList();
......
typedef struct {
int val;
(foo:bar) int val;
} coord;
typedef int anInt;
typedef void avoid;
sample avoid doavoid;
sample (function:trigger)(foo:bar) avoid doavoid;
sample struct {
int x;
sample (a:b) struct {
(c:d)(e:f) int x;
sample reference;
} intAndRef;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment