예제 #1
0
 def VisitConstant(self, o, **kwargs):
     return ast.ConstValue(value=o.value)
예제 #2
0
 def VisitConstant(self, o, **kwargs):
     new = ast.ConstValue(value=o.value)
     return copy_std(
         o,
         new,
     )
예제 #3
0
def p_rhs_term2(p):
    """ rhs_term : quantity """
    p[0] = ast.ConstValue(p[1])
예제 #4
0
def p_lhs_unit_expr(p):
    """ rhs_quantity_expr : LCURLYBRACKET quantity RCURLYBRACKET"""
    p[0] = ast.ConstValue( p[2] )
예제 #5
0
def p_rhs_term4(p):
    """ rhs_term : MINUSMINUS rhs_term """
    backend = p.parser.library_manager.backend
    neg_one = ast.ConstValue( backend.Quantity( -1.0, backend.Unit() ) )
    p[0] = ast.MulOp(neg_one, p[2] )