exprs.sa
Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
---------------------------> Sather 1.1 source file <--------------------------
-- Copyright (C) International Computer Science Institute, 1995. COPYRIGHT --
-- NOTICE: This code is provided "AS IS" WITHOUT ANY WARRANTY and is subject --
-- to the terms of the SATHER LIBRARY GENERAL PUBLIC LICENSE contained in --
-- the file "Doc/License" of the Sather distribution. The license is also --
-- available from ICSI, 1947 Center St., Suite 600, Berkeley CA 94704, USA. --
--------> Please email comments to sather-bugs@icsi.berkeley.edu. <----------
-- $AS_EXPR: Supertype of all expression nodes.
-- AS_EXPR: Implementation to be included by $AS_EXPR nodes.
-- AS_SELF_EXPR, AS_CALL_EXPR, AS_VOID_EXPR, AS_IS_VOID_EXPR, AS_ARRAY_EXPR,
-- AS_CREATE_EXPR, AS_BOUND_CREATE_EXPR, AS_UNDERSCORE_ARG, AS_AND_EXPR,
-- AS_OR_EXPR, AS_EXCEPT_EXPR, AS_NEW_EXPR, AS_INITIAL_EXPR,
-- AS_BREAK_EXPR, AS_RESULT_EXPR, AS_BOOL_LIT_EXPR, AS_CHAR_LIT_EXPR,
-- AS_STR_LIT_EXPR, AS_INT_LIT_EXPR, AS_FLT_LIT_EXPR, AS_HERE_EXPR,
-- AS_WHERE_EXPR, AS_NEAR_EXPR, AS_FAR_EXPR, AS_AT_EXPR, AS_ANY_EXPR,
-- AS_CLUSTER_EXPR, AS_CLUSTER_SIZE_EXPR, AS_COHORT_EXPR
--
abstract class $AS_EXPR < $AS_NODE, $NEXT{$AS_EXPR}
abstract class $AS_EXPR < $AS_NODE, $NEXT{$AS_EXPR} is
-- Supertype of all expression nodes.
end;
class AS_EXPR < $AS_EXPR
class AS_EXPR < $AS_EXPR is
-- Supertype of all expression nodes.
include AS_NODE;
include NEXT{$AS_EXPR};
end;
class AS_SELF_EXPR < $AS_EXPR
class AS_SELF_EXPR < $AS_EXPR is
-- A "self" expression.
include AS_EXPR;
end;
class AS_CALL_EXPR < $AS_EXPR
class AS_CALL_EXPR < $AS_EXPR is
-- Expressions which directly make a call. The parser should convert
-- sugar expressions into these as well (except for /= which should
-- be converted into an "=" expression and a call on "not").
include AS_EXPR;
attr ob:$AS_EXPR; -- The expr the call is made on, if any.
attr tp:AS_TYPE_SPEC; -- The class the call is made on, if any.
attr name:IDENT; -- The name of the call.
attr args:$AS_EXPR; -- The arguments, if any.
attr modes: AS_ARG_MODE; -- Modes of these arguments (if present)
attr is_array:BOOL; -- True if this is a call with square
-- brackets. "a(1,2)[3,4]" gets turned into 2 AS_CALL_EXPR
-- objects, one for a(1,2), and one for [3,4].
attr flip:BOOL; -- True if need to flip order of evaluation
-- of arguments because orginated in a ">" or "<=" sugar expr.
args_size:INT is
if void(args) then return 0-- AS_CALL_EXPR::args
else return args.size-- AS_CALL_EXPR::args
end
end;
end;
class AS_VOID_EXPR < $AS_EXPR
class AS_VOID_EXPR < $AS_EXPR is
-- The void expression.
include AS_EXPR;
end;
class AS_IS_VOID_EXPR < $AS_EXPR
class AS_IS_VOID_EXPR < $AS_EXPR is
-- The void expression.
include AS_EXPR;
attr arg:$AS_EXPR; -- The argument to test.
end;
class AS_ARRAY_EXPR < $AS_EXPR
class AS_ARRAY_EXPR < $AS_EXPR is
-- array expressions.
include AS_EXPR;
attr elts:$AS_EXPR; -- The elements.
elts_size:INT is
if void(elts) then return 0-- AS_ARRAY_EXPR::elts
else return elts.size-- AS_ARRAY_EXPR::elts
end
end;
end;
class AS_CREATE_EXPR < $AS_EXPR
class AS_CREATE_EXPR < $AS_EXPR is
-- Reference and value object constructor expressions.
include AS_EXPR;
attr tp:AS_TYPE_SPEC; -- The type, if any.
attr elts:$AS_EXPR; -- The arguments, if any.
attr modes:AS_ARG_MODE; -- Modes of the arguments
elts_size:INT is
if void(elts) then return 0-- AS_CREATE_EXPR::elts
else return elts.size-- AS_CREATE_EXPR::elts
end
end;
end;
class AS_BOUND_CREATE_EXPR < $AS_EXPR
class AS_BOUND_CREATE_EXPR < $AS_EXPR is
-- Bound object constructor expressions.
include AS_EXPR;
attr call:AS_CALL_EXPR; -- The call.
attr is_iter:BOOL; -- True for iter creation.
attr ret:AS_TYPE_SPEC; -- Return type, void if none specified.
end;
class AS_UNDERSCORE_ARG < $AS_EXPR
class AS_UNDERSCORE_ARG < $AS_EXPR is
-- An underscore argument in a bound routine or iter creation
-- expression.
include AS_EXPR;
attr tp:AS_TYPE_SPEC; -- Type if specified.
end;
class AS_AND_EXPR < $AS_EXPR
class AS_AND_EXPR < $AS_EXPR is
-- "and" expressions.
include AS_EXPR;
attr e1,e2:$AS_EXPR; -- The two expressions.
end;
class AS_OR_EXPR < $AS_EXPR
class AS_OR_EXPR < $AS_EXPR is
-- "or" expressions.
include AS_EXPR;
attr e1,e2:$AS_EXPR; -- The two expressions.
end;
class AS_EXCEPT_EXPR < $AS_EXPR
class AS_EXCEPT_EXPR < $AS_EXPR is
-- "exception" expressions.
include AS_EXPR;
end;
class AS_NEW_EXPR < $AS_EXPR
class AS_NEW_EXPR < $AS_EXPR is
-- "new" expressions.
include AS_EXPR;
attr arg:$AS_EXPR; -- The argument, if any
end;
class AS_INITIAL_EXPR < $AS_EXPR
class AS_INITIAL_EXPR < $AS_EXPR is
-- "initial" expressions.
include AS_EXPR;
attr e:$AS_EXPR; -- The expression to pre-evaluate.
end;
class AS_BREAK_EXPR < $AS_EXPR
class AS_BREAK_EXPR < $AS_EXPR is
-- "break!" expressions.
include AS_EXPR;
end;
class AS_RESULT_EXPR < $AS_EXPR
class AS_RESULT_EXPR < $AS_EXPR is
-- "result" expressions.
include AS_EXPR;
end;
class AS_BOOL_LIT_EXPR < $AS_EXPR
class AS_BOOL_LIT_EXPR < $AS_EXPR is
-- A boolean literal expression.
include AS_EXPR;
attr val:BOOL; -- The value.
end;
class AS_CHAR_LIT_EXPR < $AS_EXPR
class AS_CHAR_LIT_EXPR < $AS_EXPR is
-- A character literal expression.
include AS_EXPR;
attr val:INT; -- Integer value of char.
end;
class AS_STR_LIT_EXPR < $AS_EXPR
class AS_STR_LIT_EXPR < $AS_EXPR is
-- A string literal expression.
include AS_EXPR;
attr s:STR; -- String form of the literal.
end;
class AS_INT_LIT_EXPR < $AS_EXPR
class AS_INT_LIT_EXPR < $AS_EXPR is
-- An integer literal expression.
include AS_EXPR;
attr val:INTI; -- Integer value of the expression.
attr is_inti:BOOL; -- Is an infinite precision literal.
end;
class AS_FLT_LIT_EXPR < $AS_EXPR
class AS_FLT_LIT_EXPR < $AS_EXPR is
-- A floating point literal expression.
include AS_EXPR;
const flt, fltd, fltx, fltdx, flti; -- INT::plus INT::plus INT::plus INT::plus
attr val:RAT; -- Rational with value.
attr tp:INT; -- One of the five types of float.
end;
class AS_HERE_EXPR < $AS_EXPR
class AS_HERE_EXPR < $AS_EXPR is
-- A "here" expression.
-- (pSather construct).
include AS_EXPR;
end;
class AS_ANY_EXPR < $AS_EXPR
class AS_ANY_EXPR < $AS_EXPR is
-- An "any" expression.
-- (pSather construct).
include AS_EXPR;
end;
class AS_CLUSTER_EXPR < $AS_EXPR
class AS_CLUSTER_EXPR < $AS_EXPR is
-- An "clusters" expression.
-- (pSather construct).
include AS_EXPR;
end;
class AS_CLUSTER_SIZE_EXPR < $AS_EXPR
class AS_CLUSTER_SIZE_EXPR < $AS_EXPR is
-- A "cluster_size" expression.
-- (pSather construct).
include AS_EXPR;
end;
class AS_COHORT_EXPR < $AS_EXPR
class AS_COHORT_EXPR < $AS_EXPR is
-- An "cohort" expression.
-- (pSather construct).
include AS_EXPR;
attr name_after_pSather_trafo:IDENT;
end;
class AS_WHERE_EXPR < $AS_EXPR
class AS_WHERE_EXPR < $AS_EXPR is
-- A "where" expression.
-- (pSather construct).
include AS_EXPR;
attr e: $AS_EXPR;
end;
class AS_NEAR_EXPR < $AS_EXPR
class AS_NEAR_EXPR < $AS_EXPR is
-- A "near" expression.
-- (pSather construct).
include AS_EXPR;
attr e: $AS_EXPR;
end;
class AS_FAR_EXPR < $AS_EXPR
class AS_FAR_EXPR < $AS_EXPR is
-- A "far" expression.
-- (pSather construct).
include AS_EXPR;
attr e: $AS_EXPR;
end;
class AS_AT_EXPR < $AS_EXPR
class AS_AT_EXPR < $AS_EXPR is
-- A '@' expression.
-- (pSather construct).
include AS_EXPR;
attr e, at: $AS_EXPR;
end;