##\r
# Import Modules\r
#\r
+from __future__ import print_function\r
+from __future__ import absolute_import\r
import re\r
import Common.LongFilePathOs as os\r
import sys\r
\r
import antlr3\r
-from CLexer import CLexer\r
-from CParser import CParser\r
+from .CLexer import CLexer\r
+from .CParser import CParser\r
\r
-import FileProfile\r
-from CodeFragment import PP_Directive\r
-from ParserWarning import Warning\r
+from . import FileProfile\r
+from .CodeFragment import PP_Directive\r
+from .ParserWarning import Warning\r
\r
\r
##define T_CHAR_SPACE ' '\r
#\r
def PrintFragments(self):\r
\r
- print '################# ' + self.FileName + '#####################'\r
+ print('################# ' + self.FileName + '#####################')\r
\r
- print '/****************************************/'\r
- print '/*************** ASSIGNMENTS ***************/'\r
- print '/****************************************/'\r
+ print('/****************************************/')\r
+ print('/*************** ASSIGNMENTS ***************/')\r
+ print('/****************************************/')\r
for asign in FileProfile.AssignmentExpressionList:\r
- print str(asign.StartPos) + asign.Name + asign.Operator + asign.Value\r
+ print(str(asign.StartPos) + asign.Name + asign.Operator + asign.Value)\r
\r
- print '/****************************************/'\r
- print '/********* PREPROCESS DIRECTIVES ********/'\r
- print '/****************************************/'\r
+ print('/****************************************/')\r
+ print('/********* PREPROCESS DIRECTIVES ********/')\r
+ print('/****************************************/')\r
for pp in FileProfile.PPDirectiveList:\r
- print str(pp.StartPos) + pp.Content\r
+ print(str(pp.StartPos) + pp.Content)\r
\r
- print '/****************************************/'\r
- print '/********* VARIABLE DECLARATIONS ********/'\r
- print '/****************************************/'\r
+ print('/****************************************/')\r
+ print('/********* VARIABLE DECLARATIONS ********/')\r
+ print('/****************************************/')\r
for var in FileProfile.VariableDeclarationList:\r
- print str(var.StartPos) + var.Modifier + ' '+ var.Declarator\r
+ print(str(var.StartPos) + var.Modifier + ' '+ var.Declarator)\r
\r
- print '/****************************************/'\r
- print '/********* FUNCTION DEFINITIONS *********/'\r
- print '/****************************************/'\r
+ print('/****************************************/')\r
+ print('/********* FUNCTION DEFINITIONS *********/')\r
+ print('/****************************************/')\r
for func in FileProfile.FunctionDefinitionList:\r
- print str(func.StartPos) + func.Modifier + ' '+ func.Declarator + ' ' + str(func.NamePos)\r
+ print(str(func.StartPos) + func.Modifier + ' '+ func.Declarator + ' ' + str(func.NamePos))\r
\r
- print '/****************************************/'\r
- print '/************ ENUMERATIONS **************/'\r
- print '/****************************************/'\r
+ print('/****************************************/')\r
+ print('/************ ENUMERATIONS **************/')\r
+ print('/****************************************/')\r
for enum in FileProfile.EnumerationDefinitionList:\r
- print str(enum.StartPos) + enum.Content\r
+ print(str(enum.StartPos) + enum.Content)\r
\r
- print '/****************************************/'\r
- print '/*********** STRUCTS/UNIONS *************/'\r
- print '/****************************************/'\r
+ print('/****************************************/')\r
+ print('/*********** STRUCTS/UNIONS *************/')\r
+ print('/****************************************/')\r
for su in FileProfile.StructUnionDefinitionList:\r
- print str(su.StartPos) + su.Content\r
+ print(str(su.StartPos) + su.Content)\r
\r
- print '/****************************************/'\r
- print '/************** TYPEDEFS ****************/'\r
- print '/****************************************/'\r
+ print('/****************************************/')\r
+ print('/************** TYPEDEFS ****************/')\r
+ print('/****************************************/')\r
for typedef in FileProfile.TypedefDefinitionList:\r
- print str(typedef.StartPos) + typedef.ToType\r
+ print(str(typedef.StartPos) + typedef.ToType)\r
\r
##\r
#\r
#\r
if __name__ == "__main__":\r
\r
- print "For Test."\r
+ print("For Test.")\r