def check(e): ## structures.check(e) ## enumerations.check(e) ## unions.check(e) # trailings(e.code) # columns(e.code) error = classes.c_error(e.parser.old_contents) errors.open(e, error) if (e.parser.windows_style): errors.add(e, error, errors.ERRORS_STYLE, "This file contains \\r at end of lines !\n") columns(e, error) trailings(e, error) errors.close(e, error) errors.commit(e, error) types.check(e) #print "types done" globals.check(e) #print "globals done" comments.check(e) #print "comments done" macros.check(e) #print "macros done" functions.check(e) #print "func done" prototypes.check(e) #print "proto done" contents.check(e)
def comment(e, z, i): error = classes.c_error(i) p = None errors.open(e, error) p = parse(e, z, error) if not p: errors.close(e, error) errors.commit(e, error) return errors.close(e, error) errors.commit(e, error)
def check(e): error = classes.c_error(e.parser.contents) lines = None errors.open(e, error) if error.code: lines = error.code.split("\n") #if len(lines) > 0: # errors.add(e, error, errors.ERRORS_FATAL, # "there are " + str(len(lines)) + " meaningless lines " \ # "of source code.\n") errors.close(e, error) errors.commit(e, error)
def macro(e, z, i): error = classes.c_error(i) p = None errors.open(e, error) p = parse(e, z, error) if not p: errors.close(e, error) errors.commit(e, error) return alignment(e, z, p, error) name(e, z, p, error) errors.close(e, error) errors.commit(e, error)
def globals(e, z, i): error = classes.c_error(i) p = None errors.open(e, error) p = parse(e, z, error) if not p: errors.close(e, error) errors.commit(e, error) return name(e, z, p, error) initialization(e, z, p, error) errors.close(e, error) errors.commit(e, error)
def header(e, z, i): error = classes.c_error(i) match = None errors.open(e, error) if not error.code: errors.add(e, error, errors.ERRORS_STYLE, "the file does not contains any header.\n") else: match = e_header.search(error.code) if not match: errors.add(e, error, errors.ERRORS_STYLE, "the file header is not properly formatted.\n") checker.columns(e, error) errors.close(e, error) errors.commit(e, error)
def function(e, z, i): error = classes.c_error(i) p = None errors.open(e, error) scope(e, z, error) p = functions_parser.parse(e, z, error) if not p: errors.close(e, error) errors.commit(e, error) return functions_checker.check(e, z, p, error) errors.close(e, error) errors.commit(e, error) error.name = None
def prototype(e, z, i): error = classes.c_error(i) p = None errors.open(e, error) p = parse(e, z, error) if not p: errors.close(e, error) errors.commit(e, error) return scope(e, z, p, error) arguments(e, z, p, error) alignment(e, z, p, error) errors.close(e, error) errors.commit(e, error)
def enumeration(e, z, i): error = classes.c_error(i) p = None errors.open(e, error) scope(e, z, error) checker.trailings(e, error) checker.columns(e, error) p = parse(e, z, error) if not p: errors.close(e, error) errors.commit(e, error) return values(e, z, p, error) errors.close(e, error) errors.commit(e, error)
def type(e, z, i): error = classes.c_error(i) p = None errors.open(e, error) scope(e, z, error) p = parse(e, z, error) if not p: errors.close(e, error) errors.commit(e, error) return if p.typedefed: name(e, z, p, error) fields(e, z, p, error) errors.close(e, error) errors.commit(e, error)
def structure(e, z, i): error = classes.c_error(i) p = None errors.open(e, error) scope(e, z, error) checker.trailings(e, error) checker.columns(e, error) p = parse(e, z, error) if not p: errors.close(e, error) errors.commit(e, error) return fields(e, z, p, error) alignment(e, z, p, error) errors.close(e, error) errors.commit(e, error)