new ArrayList<CodeAddition>());
}
codeAdditions.get(defineConstruct.file).add(addition);
- } else { // No declaration needed but should add forward declaration
+ } else { // No declaration needed but should add forward declaration in
+ // Class
// Last generate the definition
newCode = new ArrayList<String>();
- newCode.addAll(CodeVariables.generateInterfaceWrapperDeclaration(_semantics, construct));
+ if (_semantics.getOption("CLASS") == null) {
+ newCode.addAll(CodeVariables
+ .generateInterfaceWrapperDeclaration(_semantics,
+ construct));
+ }
newCode.addAll(CodeVariables.generateInterfaceWrapperDefinition(
_semantics, construct));
lineNum = construct.beginLineNum;
codeAdditions.get(construct.file).add(addition);
}
+ /**
+ private void ClassEnd2Code(ClassEndConstruct construct) {
+ int lineNum = construct.beginLineNum;
+ ArrayList<String> newCode = CodeVariables.generateStaticVarDefine(_semantics,
+ _semantics.getGlobalConstruct());
+
+ CodeAddition addition = new CodeAddition(lineNum, newCode);
+ if (!codeAdditions.containsKey(construct.file)) {
+ codeAdditions.put(construct.file, new ArrayList<CodeAddition>());
+ }
+ codeAdditions.get(construct.file).add(addition);
+ }
+ */
+
private void EntryPoint2Code(EntryPointConstruct construct) {
int lineNum = construct.beginLineNum;
ArrayList<String> newCode = new ArrayList<String>();
EntryPoint2Code((EntryPointConstruct) construct);
}
}
+
+// ClassEndConstruct endConstruct = _semantics.getClassEndConstruct();
+// if (endConstruct != null) {
+// ClassEnd2Code(endConstruct);
+// }
+
// Sort code additions
HashSet<String> headers = CodeVariables.getAllHeaders(_semantics);
ArrayList<String> headerCode = new ArrayList<String>(headers.size());
public static void main(String[] argvs) {
String homeDir = Environment.HOME_DIRECTORY;
File[] srcFiles = {
-// new File(homeDir
-// + "/benchmark/linuxrwlocks/linuxrwlocks.c") };
- // new File(homeDir
- // +
- // "/benchmark/cliffc-hashtable/simplified_cliffc_hashtable.h"),
- // };
- new File(homeDir + "/benchmark/ms-queue/my_queue.c"),
- new File(homeDir + "/benchmark/ms-queue/main.c"),
- new File(homeDir + "/benchmark/ms-queue/my_queue.h") };
-
-// new File(homeDir + "/benchmark/read-copy-update/rcu.cc") };
-
-// new File(homeDir + "/benchmark/chase-lev-deque-bugfix/deque.c"),
-// new File(homeDir + "/benchmark/chase-lev-deque-bugfix/main.c"),
-// new File(homeDir + "/benchmark/chase-lev-deque-bugfix/deque.h") };
-
+ // new File(homeDir
+ // + "/benchmark/linuxrwlocks/linuxrwlocks.c") };
+ // new File(homeDir
+ // +
+ // "/benchmark/cliffc-hashtable/simplified_cliffc_hashtable.h"),
+ // };
+ // new File(homeDir + "/benchmark/ms-queue/my_queue.c"),
+ // new File(homeDir + "/benchmark/ms-queue/main.c"),
+ // new File(homeDir + "/benchmark/ms-queue/my_queue.h") };
+
+ // new File(homeDir + "/benchmark/read-copy-update/rcu.cc") };
+
+ // new File(homeDir +
+ // "/benchmark/chase-lev-deque-bugfix/deque.c"),
+ // new File(homeDir +
+ // "/benchmark/chase-lev-deque-bugfix/main.c"),
+ // new File(homeDir +
+ // "/benchmark/chase-lev-deque-bugfix/deque.h") };
+
+ new File(homeDir + "/benchmark/mcs-lock/mcs-lock.cc"),
+ new File(homeDir + "/benchmark/mcs-lock/mcs-lock.h") };
+
CodeGenerator gen = new CodeGenerator(srcFiles);
gen.generateCode();
}