aboutsummaryrefslogtreecommitdiffstats
path: root/tests/other-systems/sablecc
diff options
context:
space:
mode:
authorwisberg <wisberg>2002-12-16 18:51:06 +0000
committerwisberg <wisberg>2002-12-16 18:51:06 +0000
commit144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch)
treeb12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/other-systems/sablecc
parentfafae443719b26159ab2d7dac1c9b46b5e00b671 (diff)
downloadaspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz
aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip
initial version
Diffstat (limited to 'tests/other-systems/sablecc')
-rw-r--r--tests/other-systems/sablecc/src/LexerAspect.java12
-rw-r--r--tests/other-systems/sablecc/src/NodeAspect.java21
-rw-r--r--tests/other-systems/sablecc/src/NodesAspect.java71
-rw-r--r--tests/other-systems/sablecc/src/ParserAspect.java18
4 files changed, 122 insertions, 0 deletions
diff --git a/tests/other-systems/sablecc/src/LexerAspect.java b/tests/other-systems/sablecc/src/LexerAspect.java
new file mode 100644
index 000000000..7b04f3e08
--- /dev/null
+++ b/tests/other-systems/sablecc/src/LexerAspect.java
@@ -0,0 +1,12 @@
+import org.sablecc.sablecc.lexer.*;
+import org.sablecc.sablecc.node.*;
+
+public aspect LexerAspect {
+
+ pointcut callstoSets():
+ call(void set*(Object)) && target(Token);
+
+ before () : callstoSets() {}
+ void around () : callstoSets() { proceed(); }
+ after () : callstoSets() {}
+}
diff --git a/tests/other-systems/sablecc/src/NodeAspect.java b/tests/other-systems/sablecc/src/NodeAspect.java
new file mode 100644
index 000000000..e43069ad4
--- /dev/null
+++ b/tests/other-systems/sablecc/src/NodeAspect.java
@@ -0,0 +1,21 @@
+import org.sablecc.sablecc.node.*;
+import org.sablecc.sablecc.analysis.Analysis;
+
+public aspect NodeAspect {
+
+ pointcut removes(): call(void removeChild(Node)) && target(Node);
+ pointcut callstoSets(): call(void set*(Analysis,Object)) && target(Node);
+ pointcut callstoGets(): call(void get*(Analysis)) && target(Node);
+
+ before() : removes() {}
+ void around() : removes() { proceed(); }
+ after () : removes() {}
+
+ before() : callstoSets() {}
+ void around() : callstoSets() { proceed(); }
+ after () : callstoSets() {}
+
+ before() : callstoGets() {}
+ void around() : callstoGets() { proceed(); }
+ after () : callstoGets() {}
+}
diff --git a/tests/other-systems/sablecc/src/NodesAspect.java b/tests/other-systems/sablecc/src/NodesAspect.java
new file mode 100644
index 000000000..b2c8eb403
--- /dev/null
+++ b/tests/other-systems/sablecc/src/NodesAspect.java
@@ -0,0 +1,71 @@
+import org.sablecc.sablecc.node.*;
+import org.sablecc.sablecc.analysis.Analysis;
+import org.sablecc.sablecc.node.Package; // avoid name conflicts with java.lang.Package
+
+public aspect NodesAspect {
+
+ pointcut bangAlt(): target(Node) && !target(Alt) && call(* *(..));
+ pointcut bangAltName(): target(Node) && !target(AltName) && call(* *(..));
+ pointcut bangAltNameOpt(): target(Node) && !target(AltNameOpt) && call(* *(..));
+ pointcut bangAlts(): target(Node) && !target(Alts) && call(* *(..));
+ pointcut bangAltsTail(): target(Node) && !target(AltsTail) && call(* *(..));
+ pointcut bangAltsTails(): target(Node) && !target(AltsTails) && call(* *(..));
+ pointcut bangBasic(): target(Node) && !target(Basic) && call(* *(..));
+ pointcut bangBinOp(): target(Node) && !target(BinOp) && call(* *(..));
+ pointcut bangConcat(): target(Node) && !target(Concat) && call(* *(..));
+ pointcut bangElem(): target(Node) && !target(Elem) && call(* *(..));
+ pointcut bangElemName(): target(Node) && !target(ElemName) && call(* *(..));
+ pointcut bangElemNameOpt(): target(Node) && !target(ElemNameOpt) && call(* *(..));
+ pointcut bangElems(): target(Node) && !target(Elems) && call(* *(..));
+ pointcut bangGrammar(): target(Node) && !target(Grammar) && call(* *(..));
+ pointcut bangHelperDef(): target(Node) && !target(HelperDef) && call(* *(..));
+ pointcut bangHelperDefs(): target(Node) && !target(HelperDefs) && call(* *(..));
+ pointcut bangHelpers(): target(Node) && !target(Helpers) && call(* *(..));
+ pointcut bangHelpersOpt(): target(Node) && !target(HelpersOpt) && call(* *(..));
+ pointcut bangIdList(): target(Node) && !target(IdList) && call(* *(..));
+ pointcut bangIdListOpt(): target(Node) && !target(IdListOpt) && call(* *(..));
+ pointcut bangIdListTail(): target(Node) && !target(IdListTail) && call(* *(..));
+ pointcut bangIdListTails(): target(Node) && !target(IdListTails) && call(* *(..));
+ pointcut bangIgnTokens(): target(Node) && !target(IgnTokens) && call(* *(..));
+ pointcut bangIgnTokensOpt(): target(Node) && !target(IgnTokensOpt) && call(* *(..));
+ pointcut bangLookAhead(): target(Node) && !target(LookAhead) && call(* *(..));
+ pointcut bangLookAheadOpt(): target(Node) && !target(LookAheadOpt) && call(* *(..));
+ pointcut bangPackage(): target(Node) && !target(Package) && call(* *(..));
+ pointcut bangPackageOpt(): target(Node) && !target(PackageOpt) && call(* *(..));
+ pointcut bangPChar(): target(Node) && !target(PChar) && call(* *(..));
+ pointcut bangPkgId(): target(Node) && !target(PkgId) && call(* *(..));
+ pointcut bangPkgName(): target(Node) && !target(PkgName) && call(* *(..));
+ pointcut bangPkgNameOpt(): target(Node) && !target(PkgNameOpt) && call(* *(..));
+ pointcut bangPkgNameTail(): target(Node) && !target(PkgNameTail) && call(* *(..));
+ pointcut bangPkgNameTails(): target(Node) && !target(PkgNameTails) && call(* *(..));
+ pointcut bangProd(): target(Node) && !target(Prod) && call(* *(..));
+ pointcut bangProds(): target(Node) && !target(Prods) && call(* *(..));
+ pointcut bangProductions(): target(Node) && !target(Productions) && call(* *(..));
+ pointcut bangProductionsOpt(): target(Node) && !target(ProductionsOpt) && call(* *(..));
+ pointcut bangPSet(): target(Node) && !target(PSet) && call(* *(..));
+ pointcut bangRegExp(): target(Node) && !target(RegExp) && call(* *(..));
+ pointcut bangRegExpTail(): target(Node) && !target(RegExpTail) && call(* *(..));
+ pointcut bangRegExpTails(): target(Node) && !target(RegExpTails) && call(* *(..));
+ pointcut bangSpecifier(): target(Node) && !target(Specifier) && call(* *(..));
+ pointcut bangSpecifierOpt(): target(Node) && !target(SpecifierOpt) && call(* *(..));
+ pointcut bangStart(): target(Node) && !target(Start) && call(* *(..));
+ pointcut bangStateList(): target(Node) && !target(StateList) && call(* *(..));
+ pointcut bangStateListOpt(): target(Node) && !target(StateListOpt) && call(* *(..));
+ pointcut bangStateListTail(): target(Node) && !target(StateListTail) && call(* *(..));
+ pointcut bangStateListTails(): target(Node) && !target(StateListTails) && call(* *(..));
+ pointcut bangStates(): target(Node) && !target(States) && call(* *(..));
+ pointcut bangStatesOpt(): target(Node) && !target(StatesOpt) && call(* *(..));
+ pointcut bangToken(): target(Node) && !target(Token) && call(* *(..));
+ pointcut bangTokenDef(): target(Node) && !target(TokenDef) && call(* *(..));
+ pointcut bangTokenDefs(): target(Node) && !target(TokenDefs) && call(* *(..));
+ pointcut bangTokens(): target(Node) && !target(Tokens) && call(* *(..));
+ pointcut bangTokensOpt(): target(Node) && !target(TokensOpt) && call(* *(..));
+ pointcut bangTransition(): target(Node) && !target(Transition) && call(* *(..));
+ pointcut bangTransitionOpt(): target(Node) && !target(TransitionOpt) && call(* *(..));
+ pointcut bangUnExp(): target(Node) && !target(UnExp) && call(* *(..));
+ pointcut bangUnExps(): target(Node) && !target(UnExps) && call(* *(..));
+ pointcut bangUnOp(): target(Node) && !target(UnOp) && call(* *(..));
+ pointcut bangUnOpOpt(): target(Node) && !target(UnOpOpt) && call(* *(..));
+}
+
+
diff --git a/tests/other-systems/sablecc/src/ParserAspect.java b/tests/other-systems/sablecc/src/ParserAspect.java
new file mode 100644
index 000000000..cbb8334a5
--- /dev/null
+++ b/tests/other-systems/sablecc/src/ParserAspect.java
@@ -0,0 +1,18 @@
+import org.sablecc.sablecc.node.*;
+import org.sablecc.sablecc.analysis.*;
+import org.sablecc.sablecc.parser.*;
+
+public aspect ParserAspect {
+
+ pointcut pushes(): call(void push(int,Object)) && target(Parser);
+ pointcut callstoSets(): call(void set*(Object)) && target(Node);
+
+ before () : pushes() {}
+ void around () : pushes() { proceed(); }
+
+ before () : callstoSets() {}
+ void around () : callstoSets() { proceed(); }
+
+ after () : callstoSets() {}
+ after () : pushes() {}
+}