diff --git a/compiler/2014/LabCommScanner.flex b/compiler/2014/LabCommScanner.flex index a0e2efa50ac1ce4fe7f95da1ae55a7332968d4c9..6d4f7c1a001a24e179d38c62a10ffc657b8fc791 100644 --- a/compiler/2014/LabCommScanner.flex +++ b/compiler/2014/LabCommScanner.flex @@ -45,6 +45,7 @@ TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" | "/*" "*"+ [^/*] ~"*/" EndOfLineComment = "//" {InputCharacter}* {LineTerminator}? Identifier = [[:letter:]_]([[:letter:]_[:digit:]])* +StringLiteral = [:jletterdigit:]* DecimalNumeral = 0 | {NonZeroDigit} {Digits}? Digits = {Digit}+ diff --git a/compiler/2014/Signature.jrag b/compiler/2014/Signature.jrag index fb911b61ddd9623106abf65fd1350b5933d5b8ab..1c1c820a2725ad9dc4adab14fbcaac55e7b90e38 100644 --- a/compiler/2014/Signature.jrag +++ b/compiler/2014/Signature.jrag @@ -1,5 +1,15 @@ 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(); diff --git a/examples/user_types/test.lc b/examples/user_types/test.lc index 75497b4df01e761d47efba7dd95cc7bb1611fcf9..a0ad6026cf06eab514cf776c168fae1401035762 100644 --- a/examples/user_types/test.lc +++ b/examples/user_types/test.lc @@ -1,14 +1,14 @@ 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;