Now builds all functions except those dependent on Features2d. Improved build detection if cmake is rerun
This commit is contained in:
@@ -44,10 +44,11 @@ def noutputs(args):
|
||||
return len(outputs(args))
|
||||
|
||||
def convertibleToInt(string):
|
||||
salt = '1+'
|
||||
try:
|
||||
int(string)
|
||||
exec(salt+string)
|
||||
return True
|
||||
except ValueError:
|
||||
except:
|
||||
return False
|
||||
|
||||
def capitalizeFirst(text):
|
||||
|
@@ -13,10 +13,8 @@ class MatlabWrapperGenerator(object):
|
||||
ns[name] = parser.parse(file)
|
||||
|
||||
# cleanify the parser output
|
||||
print ns['ml']
|
||||
parse_tree = ParseTree()
|
||||
parse_tree.build(ns)
|
||||
print parse_tree
|
||||
|
||||
# setup the template engine
|
||||
jtemplate = Environment(loader=PackageLoader('templates', ''), trim_blocks=True, lstrip_blocks=True)
|
||||
|
@@ -51,6 +51,13 @@ class Translator(object):
|
||||
# classes have 'class' prefixed on their name
|
||||
if 'class' in defn[0].split(' ') or 'struct' in defn[0].split(' '):
|
||||
return self.translateClass(defn)
|
||||
# --- operators! ---
|
||||
#TODO: implement operators: http://www.mathworks.com.au/help/matlab/matlab_oop/implementing-operators-for-your-class.html
|
||||
if 'operator' in defn[0]:
|
||||
return self.translateFunction(defn)
|
||||
# --- constant ---
|
||||
elif convertibleToInt(defn[1]):
|
||||
return self.translateConstant(defn)
|
||||
# --- function ---
|
||||
# functions either need to have input arguments, or not uppercase names
|
||||
elif defn[3] or not self.translateName(defn[0]).split('_')[0].isupper():
|
||||
|
Reference in New Issue
Block a user