Permalink
Browse files

Merge branch 'smartmeter' of https://github.com/mbeddr/mbeddr.core in…

…to smartmeter
  • Loading branch information...
2 parents 79cc7ad + 4ec98af commit a45304a136c8ccccd43c79ba9948c673ad7eefb6 Stephan Eberle committed Apr 18, 2012
@@ -2361,7 +2361,7 @@
<node role="initializer" roleId="tpee.1068431790190" type="tpee.GenericNewExpression" typeId="tpee.1145552977093" id="5989577250191116614">
<node role="creator" roleId="tpee.1145553007750" type="tp25.SNodeCreator" typeId="tp25.1180636770613" id="5989577250191116615">
<node role="createdType" roleId="tp25.1180636770616" type="tp25.SNodeType" typeId="tp25.1138055754698" id="5989577250191116616">
- <link role="concept" roleId="tp25.1138405853777" targetNodeId="mj1l.8463282783691618445" resolveInfo="Int64tType" />
+ <link role="concept" roleId="tp25.1138405853777" targetNodeId="mj1l.8463282783691618456" resolveInfo="UnsignedInt64tType" />
</node>
</node>
</node>

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -4,8 +4,14 @@
#define hexWithBracket (0x244)
#define intWithBracket (244)
+#define hexWithBracketU (0x0020u)
#define StringValue ImAString
#define MUL(i, j) (i*j)
-#define ASSERT(x) /* no assertion (x is a logical expression) */
+#define ASSERT(x) /* no assertion (x is a logical expression) */
+
+
+//
+#define var(x) unsigned int x;
+var(a)
@@ -1,7 +0,0 @@
-typedef int aaa, bbb, ccc;
-typedef aaa aaaAAA;
-typedef int ar[15], arr[9][6];
-typedef char c, *cp, **cpp, *cpar[100], **cpparr[100][2];
-
-
-
@@ -32,7 +32,7 @@
<property name="name" nameId="tpck.1169194664001" value="ExtTest" />
<property name="isTest" nameId="51wr.3431613015799084476" value="true" />
<node role="referencedModules" roleId="51wr.5046689135693761559" type="51wr.ModuleRef" typeId="51wr.7717755763392524107" id="7916254422482546575">
- <link role="module" roleId="51wr.7717755763392524108" targetNodeId="ojhx.5853785011256671940" resolveInfo="defineTestHeader" />
+ <link role="module" roleId="51wr.7717755763392524108" targetNodeId="ojhx.~defineTestHeader" resolveInfo="defineTestHeader" />
</node>
<node role="referencedModules" roleId="51wr.5046689135693761559" type="51wr.ModuleRef" typeId="51wr.7717755763392524107" id="8484631292796338414">
<link role="module" roleId="51wr.7717755763392524108" targetNodeId="7646082028326282928" resolveInfo="LinkableTest" />
@@ -41,7 +41,7 @@
<link role="module" roleId="51wr.7717755763392524108" targetNodeId="3134547887598558629" resolveInfo="Driver" />
</node>
<node role="referencedModules" roleId="51wr.5046689135693761559" type="51wr.ModuleRef" typeId="51wr.7717755763392524107" id="8486231617255524105">
- <link role="module" roleId="51wr.7717755763392524108" targetNodeId="qa83.5853785011256671746" resolveInfo="HelperFunctions" />
+ <link role="module" roleId="51wr.7717755763392524108" targetNodeId="qa83.~HelperFunctions" resolveInfo="HelperFunctions" />
</node>
<node role="linkables" roleId="51wr.4809476668198796998" type="51wr.Linkable" typeId="51wr.4809476668198796988" id="1995004963226621635">
<property name="name" nameId="51wr.4809476668198808306" value="HelperFunctions.o" />
@@ -62,11 +62,16 @@
<property name="name" nameId="tpck.1169194664001" value="testLinkable" />
<property name="exported" nameId="x27k.1317894735999272944" value="true" />
<node role="body" roleId="yz9a.6275792049641586525" type="c4fa.StatementList" typeId="c4fa.4185783222026475861" id="7646082028326282930">
+ <node role="statements" roleId="c4fa.4185783222026475862" type="c4fa.ExpressionStatement" typeId="c4fa.7254843406768833938" id="7351208613149358155">
+ <node role="expr" roleId="c4fa.7254843406768833939" type="mj1l.HexNumberLiteral" typeId="mj1l.1054289341113450444" id="7351208613149358156">
+ <property name="value" nameId="mj1l.1054289341113450445" value="234u" />
+ </node>
+ </node>
<node role="statements" roleId="c4fa.4185783222026475862" type="c4fa.LocalVariableDeclaration" typeId="c4fa.4185783222026475238" id="8484631292796338399">
<property name="name" nameId="tpck.1169194664001" value="i8" />
<node role="type" roleId="mj1l.318113533128716676" type="mj1l.Int8tType" typeId="mj1l.8463282783691618426" id="1995004963226621628" />
<node role="init" roleId="c4fa.4185783222026502647" type="x27k.FunctionCall" typeId="x27k.5950410542643524492" id="1995004963226621630">
- <link role="function" roleId="x27k.5950410542643524493" targetNodeId="qa83.5853785011256671750" resolveInfo="add" />
+ <link role="function" roleId="x27k.5950410542643524493" targetNodeId="qa83.~add" resolveInfo="add" />
<node role="actuals" roleId="x27k.5950410542643524495" type="mj1l.NumberLiteral" typeId="mj1l.8860443239512128103" id="1995004963226621631">
<property name="value" nameId="mj1l.8860443239512128104" value="5" />
</node>
@@ -89,7 +94,7 @@
<node role="statements" roleId="c4fa.4185783222026475862" type="yz9a.AssertStatement" typeId="yz9a.6275792049641587287" id="2066825338495731173">
<node role="expr" roleId="yz9a.6275792049641587288" type="mj1l.EqualsExpression" typeId="mj1l.8860443239512129322" id="2066825338495731178">
<node role="left" roleId="mj1l.8860443239512128064" type="x27k.GlobalConstantRef" typeId="x27k.3788988821852026523" id="7916254422482546574">
- <link role="constant" roleId="x27k.3788988821852026524" targetNodeId="ojhx.5853785011256671942" resolveInfo="IntValue" />
+ <link role="constant" roleId="x27k.3788988821852026524" targetNodeId="ojhx.~IntValue" resolveInfo="IntValue" />
</node>
<node role="right" roleId="mj1l.8860443239512128065" type="mj1l.NumberLiteral" typeId="mj1l.8860443239512128103" id="8486231617255524541">
<property name="value" nameId="mj1l.8860443239512128104" value="3" />
@@ -100,10 +105,10 @@
<node role="type" roleId="mj1l.318113533128716676" type="mj1l.VoidType" typeId="mj1l.7892328519581699353" id="5708867820622915283" />
</node>
<node role="imports" roleId="x27k.1317894735999304826" type="x27k.ModuleImport" typeId="x27k.1317894735999299713" id="8486231617255524104">
- <link role="module" roleId="x27k.1317894735999299714" targetNodeId="qa83.5853785011256671746" resolveInfo="HelperFunctions" />
+ <link role="module" roleId="x27k.1317894735999299714" targetNodeId="qa83.~HelperFunctions" resolveInfo="HelperFunctions" />
</node>
<node role="imports" roleId="x27k.1317894735999304826" type="x27k.ModuleImport" typeId="x27k.1317894735999299713" id="7916254422482546572">
- <link role="module" roleId="x27k.1317894735999299714" targetNodeId="ojhx.5853785011256671940" resolveInfo="defineTestHeader" />
+ <link role="module" roleId="x27k.1317894735999299714" targetNodeId="ojhx.~defineTestHeader" resolveInfo="defineTestHeader" />
</node>
</root>
<root id="3134547887598558629">
@@ -9210,8 +9210,6 @@
</node>
</node>
</node>
- <node role="statement" roleId="tpee.1068581517665" type="tpee.Statement" typeId="tpee.1068580123157" id="5444603835251556743" />
- <node role="statement" roleId="tpee.1068581517665" type="tpee.Statement" typeId="tpee.1068580123157" id="5444603835251556695" />
</node>
</node>
<node role="testMethods" roleId="tp5g.1217501895093" type="tp5g.SimpleNodeTest" typeId="tp5g.1225978065297" id="453449934281253150">
@@ -9322,6 +9320,56 @@
</node>
</node>
</node>
+ <node role="statement" roleId="tpee.1068581517665" type="tpee.Statement" typeId="tpee.1068580123157" id="7351208613149434124" />
+ <node role="statement" roleId="tpee.1068581517665" type="tpee.LocalVariableDeclarationStatement" typeId="tpee.1068581242864" id="7351208613149434126">
+ <node role="localVariableDeclaration" roleId="tpee.1068581242865" type="tpee.LocalVariableDeclaration" typeId="tpee.1068581242863" id="7351208613149434127">
+ <property name="name" nameId="tpck.1169194664001" value="hexWithBracketU" />
+ <node role="type" roleId="tpee.5680397130376446158" type="tp25.SNodeType" typeId="tp25.1138055754698" id="7351208613149434128">
+ <link role="concept" roleId="tp25.1138405853777" targetNodeId="x27k.3788988821851860886" resolveInfo="GlobalConstantDeclaration" />
+ </node>
+ <node role="initializer" roleId="tpee.1068431790190" type="tpee.CastExpression" typeId="tpee.1070534934090" id="7351208613149434129">
+ <node role="expression" roleId="tpee.1070534934092" type="tpee.StaticMethodCall" typeId="tpee.1081236700937" id="7351208613149434130">
+ <link role="baseMethodDeclaration" roleId="tpee.1068499141037" targetNodeId="8xka.6054853792531328577" resolveInfo="checkContentExists" />
+ <link role="classConcept" roleId="tpee.1144433194310" targetNodeId="8xka.2497083023867879381" resolveInfo="CheckModuleContentHelper" />
+ <node role="actualArgument" roleId="tpee.1068499141038" type="tpee.StringLiteral" typeId="tpee.1070475926800" id="7351208613149434131">
+ <property name="value" nameId="tpee.1070475926801" value="hexWithBracketU" />
+ </node>
+ <node role="actualArgument" roleId="tpee.1068499141038" type="tp25.ConceptRefExpression" typeId="tp25.1172424058054" id="7351208613149434132">
+ <link role="conceptDeclaration" roleId="tp25.1172424100906" targetNodeId="x27k.3788988821851860886" resolveInfo="GlobalConstantDeclaration" />
+ </node>
+ <node role="actualArgument" roleId="tpee.1068499141038" type="tpee.LocalVariableReference" typeId="tpee.1068581242866" id="7351208613149434133">
+ <link role="variableDeclaration" roleId="tpee.1068581517664" targetNodeId="453449934281253169" resolveInfo="externalModule" />
+ </node>
+ </node>
+ <node role="type" roleId="tpee.1070534934091" type="tp25.SNodeType" typeId="tp25.1138055754698" id="7351208613149434134">
+ <link role="concept" roleId="tp25.1138405853777" targetNodeId="x27k.3788988821851860886" resolveInfo="GlobalConstantDeclaration" />
+ </node>
+ </node>
+ </node>
+ </node>
+ <node role="statement" roleId="tpee.1068581517665" type="tpe3.AssertInNotNull" typeId="tpe3.7080278351417106679" id="7351208613149434135">
+ <node role="expression" roleId="tpe3.7080278351417106681" type="tpee.LocalVariableReference" typeId="tpee.1068581242866" id="7351208613149434136">
+ <link role="variableDeclaration" roleId="tpee.1068581517664" targetNodeId="7351208613149434127" resolveInfo="hexWithBracketU" />
+ </node>
+ </node>
+ <node role="statement" roleId="tpee.1068581517665" type="tpe3.AssertTrue" typeId="tpe3.1171981022339" id="7351208613149434137">
+ <node role="condition" roleId="tpe3.1171981057159" type="tpee.DotExpression" typeId="tpee.1197027756228" id="7351208613149434138">
+ <node role="operand" roleId="tpee.1197027771414" type="tpee.DotExpression" typeId="tpee.1197027756228" id="7351208613149434139">
+ <node role="operand" roleId="tpee.1197027771414" type="tpee.LocalVariableReference" typeId="tpee.1068581242866" id="7351208613149434140">
+ <link role="variableDeclaration" roleId="tpee.1068581517664" targetNodeId="7351208613149434127" resolveInfo="hexWithBracketU" />
+ </node>
+ <node role="operation" roleId="tpee.1197027833540" type="tp25.SLinkAccess" typeId="tp25.1138056143562" id="7351208613149434141">
+ <link role="link" roleId="tp25.1138056516764" targetNodeId="x27k.3788988821851871048" />
+ </node>
+ </node>
+ <node role="operation" roleId="tpee.1197027833540" type="tp25.Node_IsInstanceOfOperation" typeId="tp25.1139621453865" id="7351208613149434142">
+ <node role="conceptArgument" roleId="tp25.1177027386292" type="tp25.RefConcept_Reference" typeId="tp25.1177026924588" id="7351208613149434143">
+ <link role="conceptDeclaration" roleId="tp25.1177026940964" targetNodeId="mj1l.1054289341113450444" resolveInfo="HexNumberLiteral" />
+ </node>
+ </node>
+ </node>
+ </node>
+ <node role="statement" roleId="tpee.1068581517665" type="tpee.Statement" typeId="tpee.1068580123157" id="7351208613149434125" />
<node role="statement" roleId="tpee.1068581517665" type="tpee.Statement" typeId="tpee.1068580123157" id="5444603835251579518" />
<node role="statement" roleId="tpee.1068581517665" type="tpee.LocalVariableDeclarationStatement" typeId="tpee.1068581242864" id="5444603835251579500">
<node role="localVariableDeclaration" roleId="tpee.1068581242865" type="tpee.LocalVariableDeclaration" typeId="tpee.1068581242863" id="5444603835251579501">
@@ -4798,6 +4798,39 @@
</node>
</node>
</node>
+ <node role="statements" roleId="c4fa.4185783222026475862" type="c4fa.Statement" typeId="c4fa.4185783222026464515" id="7351208613149391821" />
+ <node role="statements" roleId="c4fa.4185783222026475862" type="c4fa.LocalVariableDeclaration" typeId="c4fa.4185783222026475238" id="7351208613149391824">
+ <property name="name" nameId="tpck.1169194664001" value="u8Hex" />
+ <node role="type" roleId="mj1l.318113533128716676" type="mj1l.UnsignedInt8tType" typeId="mj1l.8463282783691618461" id="7351208613149391825" />
+ <node role="init" roleId="c4fa.4185783222026502647" type="mj1l.HexNumberLiteral" typeId="mj1l.1054289341113450444" id="7351208613149391827">
+ <property name="value" nameId="mj1l.1054289341113450445" value="20u" />
+ </node>
+ </node>
+ <node role="statements" roleId="c4fa.4185783222026475862" type="c4fa.LocalVariableDeclaration" typeId="c4fa.4185783222026475238" id="7351208613149397742">
+ <property name="name" nameId="tpck.1169194664001" value="u8Hex2" />
+ <node role="type" roleId="mj1l.318113533128716676" type="mj1l.UnsignedInt8tType" typeId="mj1l.8463282783691618461" id="7351208613149397743" />
+ <node role="init" roleId="c4fa.4185783222026502647" type="mj1l.HexNumberLiteral" typeId="mj1l.1054289341113450444" id="7351208613149422821">
+ <property name="value" nameId="mj1l.1054289341113450445" value="FFu" />
+ </node>
+ </node>
+ <node role="statements" roleId="c4fa.4185783222026475862" type="c4fa.LocalVariableDeclaration" typeId="c4fa.4185783222026475238" id="7351208613149423476">
+ <property name="name" nameId="tpck.1169194664001" value="u8Hex3" />
+ <node role="type" roleId="mj1l.318113533128716676" type="mj1l.UnsignedInt8tType" typeId="mj1l.8463282783691618461" id="7351208613149423477" />
+ <node role="init" roleId="c4fa.4185783222026502647" type="mj1l.HexNumberLiteral" typeId="mj1l.1054289341113450444" id="7351208613149423478">
+ <property name="value" nameId="mj1l.1054289341113450445" value="Ffu" />
+ </node>
+ </node>
+ <node role="statements" roleId="c4fa.4185783222026475862" type="c4fa.LocalVariableDeclaration" typeId="c4fa.4185783222026475238" id="7351208613149423479">
+ <property name="name" nameId="tpck.1169194664001" value="u8Hex4" />
+ <node role="type" roleId="mj1l.318113533128716676" type="mj1l.UnsignedInt8tType" typeId="mj1l.8463282783691618461" id="7351208613149423480" />
+ <node role="init" roleId="c4fa.4185783222026502647" type="mj1l.HexNumberLiteral" typeId="mj1l.1054289341113450444" id="7351208613149423481">
+ <property name="value" nameId="mj1l.1054289341113450445" value="01FFu" />
+ <node role="smodelAttribute" roleId="tpck.5169995583184591170" type="tp5g.NodePropertiesContainer" typeId="tp5g.1215507532627" id="7351208613149429130">
+ <node role="properties" roleId="tp5g.1215507909023" type="tp5g.NodeErrorPropety" typeId="tp5g.1215507671101" id="7351208613149429131" />
+ </node>
+ </node>
+ </node>
+ <node role="statements" roleId="c4fa.4185783222026475862" type="c4fa.Statement" typeId="c4fa.4185783222026464515" id="7351208613149397741" />
</node>
<node role="statements" roleId="c4fa.4185783222026475862" type="c4fa.Statement" typeId="c4fa.4185783222026464515" id="2028647161260686124" />
</node>
@@ -2,8 +2,10 @@
import junit.framework.TestCase;
+import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
+import org.eclipse.cdt.core.dom.ast.IASTComment;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
@@ -39,21 +41,38 @@ public void testBasicTest() throws CoreException {
-
- content.append("int8_t UnaryOperatorsTest_test_testUnaryOperatorOnFunction();");
+
+
+ content.append("//some comment\n");
+ content.append("#ifdef SYMBOL\n");
+ content.append("int a=10;\n");
+ content.append("#endif\n");
+ content.append("/* some comment 2 */\n");
+
+
HashMap<String, String> options = new HashMap<String, String>();
ScannerInfo scannerInfo = new ScannerInfo(options);
+ scannerInfo.getDefinedSymbols().put("SYMBOL", "SYMBOL");
+// IASTTranslationUnit astTranslationUnit = GCCLanguage.getDefault()
+// .getASTTranslationUnit(
+// FileContent.create("someFile.h", content.toString()
+// .toCharArray()), scannerInfo,
+// IncludeFileContentProvider.getEmptyFilesProvider(),
+// null, 0, new DefaultLogService());
+
IASTTranslationUnit astTranslationUnit = GCCLanguage.getDefault()
- .getASTTranslationUnit(
- FileContent.create("someFile.h", content.toString()
- .toCharArray()), scannerInfo,
- IncludeFileContentProvider.getEmptyFilesProvider(),
- null, 0, new DefaultLogService());
+ .getASTTranslationUnit(
+ FileContent.create("someFile.h", content.toString()
+ .toCharArray()), scannerInfo,
+ IncludeFileContentProvider.getEmptyFilesProvider(),
+ null, 0, new DefaultLogService());
- astTranslationUnit.accept(new ASTVisitor(true) {
+
+
+ ASTVisitor astVisitor = new ASTVisitor(true) {
public int visit(IASTTranslationUnit x) {
System.err.println(x.toString());
return PROCESS_CONTINUE;
@@ -63,6 +82,11 @@ public int visit(IASTName x) {
System.err.println(x.toString());
return PROCESS_CONTINUE;
}
+
+ public int visit(IASTComment comment) {
+ System.err.println(comment.getComment());
+ return PROCESS_CONTINUE;
+ }
public int visit(IASTDeclaration x) {
System.err.println(x.toString());
@@ -148,7 +172,9 @@ public int visit(ICASTDesignator x) {
System.err.println(x.toString());
return PROCESS_CONTINUE;
}
- });
+ };
+
+ astTranslationUnit.accept(astVisitor);
// astTranslationUnit.accept(new ASTVisitor(true) {
//

0 comments on commit a45304a

Please sign in to comment.