Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
LabComm
Commits
c2e5f245
Commit
c2e5f245
authored
10 years ago
by
Sven Gestegård Robertz
Browse files
Options
Downloads
Patches
Plain Diff
dummy testing of intention parsing
parent
dbe2b6e2
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
compiler/2014/LabCommScanner.flex
+1
-0
1 addition, 0 deletions
compiler/2014/LabCommScanner.flex
compiler/2014/Signature.jrag
+38
-0
38 additions, 0 deletions
compiler/2014/Signature.jrag
examples/user_types/test.lc
+4
-4
4 additions, 4 deletions
examples/user_types/test.lc
with
43 additions
and
4 deletions
compiler/2014/LabCommScanner.flex
+
1
−
0
View file @
c2e5f245
...
...
@@ -45,6 +45,7 @@ TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" | "/*" "*"+ [^/*] ~"*/"
EndOfLineComment = "//" {InputCharacter}* {LineTerminator}?
Identifier = [[:letter:]_]([[:letter:]_[:digit:]])*
StringLiteral = [:jletterdigit:]*
DecimalNumeral = 0 | {NonZeroDigit} {Digits}?
Digits = {Digit}+
...
...
This diff is collapsed.
Click to expand it.
compiler/2014/Signature.jrag
+
38
−
0
View file @
c2e5f245
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();
...
...
This diff is collapsed.
Click to expand it.
examples/user_types/test.lc
+
4
−
4
View file @
c2e5f245
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;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment