Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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)
Exemplo n.º 5
0
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)
Exemplo n.º 6
0
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)
Exemplo n.º 7
0
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)
Exemplo n.º 8
0
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)
Exemplo n.º 9
0
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)
Exemplo n.º 10
0
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)
Exemplo n.º 11
0
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
Exemplo n.º 12
0
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)
Exemplo n.º 13
0
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)
Exemplo n.º 14
0
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)
Exemplo n.º 15
0
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)
Exemplo n.º 16
0
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)
Exemplo n.º 17
0
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)
Exemplo n.º 18
0
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)