Exemplo n.º 1
0
def p_attr_list_null(p):
    "attr : attr_type_multi ID '=' NULL"
    (attr, nullable, _) = p[1]
    p[0] = DefineAttribute(attr,
                           p[2],
                           Literal(NoneValue()),
                           True,
                           nullable=nullable)
    attach_lnr(p, 3)
Exemplo n.º 2
0
def p_attr_undef(p):
    "attr : attr_type ID '=' UNDEF"
    (attr, nullable) = p[1]
    p[0] = DefineAttribute(attr,
                           p[2],
                           None,
                           remove_default=True,
                           nullable=nullable)
    attach_lnr(p, 2)
Exemplo n.º 3
0
def p_attr_list_dict(p: YaccProduction) -> None:
    "attr : DICT ID '=' map_def"
    p[0] = DefineAttribute(TypeDeclaration(p[1]), p[2], p[4])
    attach_from_string(p, 2)
Exemplo n.º 4
0
def p_attr_dict(p: YaccProduction) -> None:
    "attr : DICT ID"
    p[0] = DefineAttribute(TypeDeclaration(p[1]), p[2], None)
    attach_from_string(p, 2)
Exemplo n.º 5
0
def p_attr_undef(p: YaccProduction) -> None:
    "attr : attr_type ID '=' UNDEF"
    p[0] = DefineAttribute(p[1], p[2], None, remove_default=True)
    attach_from_string(p, 2)
Exemplo n.º 6
0
def p_attr_cte(p: YaccProduction) -> None:
    """attr : attr_type ID '=' constant
    | attr_type ID '=' constant_list"""
    p[0] = DefineAttribute(p[1], p[2], p[4])
    attach_from_string(p, 2)
Exemplo n.º 7
0
def p_attr(p: YaccProduction) -> None:
    "attr : attr_type ID"
    p[0] = DefineAttribute(p[1], p[2], None)
    attach_from_string(p, 2)
Exemplo n.º 8
0
def p_attr_list_dict_null(p):
    "attr : DICT '?'  ID '=' NULL"
    p[0] = DefineAttribute("dict", p[3], Literal(NoneValue()), nullable=True)
    attach_lnr(p, 1)
Exemplo n.º 9
0
def p_attr_cte(p):
    "attr : attr_type ID '=' constant"
    (attr, nullable) = p[1]
    p[0] = DefineAttribute(attr, p[2], p[4], nullable=nullable)
    attach_lnr(p, 2)
Exemplo n.º 10
0
def p_attr_dict_nullable(p):
    "attr : DICT '?' ID"
    p[0] = DefineAttribute("dict", p[3], None, nullable=True)
    attach_lnr(p, 1)
Exemplo n.º 11
0
def p_attr_list_dict(p):
    "attr : DICT ID '=' map_def"
    p[0] = DefineAttribute("dict", p[2], p[4])
    attach_lnr(p, 1)
Exemplo n.º 12
0
def p_attr_dict(p):
    "attr : DICT ID"
    p[0] = DefineAttribute("dict", p[2], None)
    attach_lnr(p, 1)
Exemplo n.º 13
0
def p_attr_list_cte(p):
    "attr : attr_type_multi ID '=' constant_list"
    (attr, nullable, _) = p[1]
    p[0] = DefineAttribute(attr, p[2], p[4], True, nullable=nullable)
    attach_lnr(p, 3)
Exemplo n.º 14
0
def p_attr_list(p):
    "attr : attr_type_multi ID"
    (attr, nullable, location) = p[1]
    p[0] = DefineAttribute(attr, p[2], None, True, nullable=nullable)
    p[0].location = location
    p[0].namespace = namespace
Exemplo n.º 15
0
def p_attr_list_dict_nullable(p: YaccProduction) -> None:
    "attr : DICT '?'  ID '=' map_def"
    p[0] = DefineAttribute(TypeDeclaration(p[1], nullable=True), p[3], p[5])
    attach_from_string(p, 3)
Exemplo n.º 16
0
def p_attr_list_dict_nullable(p):
    "attr : DICT '?'  ID '=' map_def"
    p[0] = DefineAttribute("dict", p[3], p[5], nullable=True)
    attach_lnr(p, 1)
Exemplo n.º 17
0
def p_attr_list_dict_null(p: YaccProduction) -> None:
    "attr : DICT '?'  ID '=' NULL"
    p[0] = DefineAttribute(TypeDeclaration(p[1], nullable=True), p[3],
                           make_none(p, 5))
    attach_from_string(p, 3)
Exemplo n.º 18
0
def p_attr(p):
    "attr : attr_type ID"
    (attr, nullable) = p[1]
    p[0] = DefineAttribute(attr, p[2], None, nullable=nullable)
    attach_lnr(p, 2)