ParseCpp#
- class mkShapesRDF.lib.parse_cpp.ParseCpp[source][source]#
Bases:
objectA utility class to parse C++ expression, replace variables and format back to a C++ expression.
Methods
RVecExpression(_type)Creates a string for RVec with the specified _type
format(parsedS)Format back a parsed C++ expression to a string.
listOfVariables(parsedS)Return the list of variables in a parsed C++ expression.
parse(string)Parse a C++ expression and return a list of strings containing the expression split by the delimiters.
replace(parsedS, orig, new)Replace a variable in a parsed C++ expression.
- delimiters = [' ', '(', ')', '+', '-', '>', '<', '=', '&&', '/', '*', '.', ',', '!', '[', ']', '||']#
delimeters is a list of strings that are used to split the expression.
- static parse(string)[source][source]#
Parse a C++ expression and return a list of strings containing the expression split by the delimiters.
- Parameters:
- string
str C++ expression to be parsed
- string
- Returns:
- list of str
list of variables and delimiter that compose the expression
- static format(parsedS)[source][source]#
Format back a parsed C++ expression to a string.
- Parameters:
- parsedSlist of str
list of variables and delimiters that compose the expression
- Returns:
strformatted C++ expression