public class Translator extends Printer
Modifier and Type | Field and Description |
---|---|
(package private) static Trees |
algebraic_operators |
(package private) static SymbolTable |
data_constructors
binds a data constructor name to its type
|
(package private) static Trees |
functions |
(package private) static SymbolTable |
global_datatype_env
type environment that binds datatype names to types
|
(package private) static SymbolTable |
global_functions
binds a UDF name to its plan
|
(package private) static SymbolTable |
global_macros
binds a macro name to its body
|
(package private) static SymbolTable |
global_type_env
type environment that binds global variables to types
|
(package private) static SymbolTable |
global_vars
binds macro names to MRQL expressions (used for 'name = expr;' syntax)
|
(package private) static Tree |
identity |
(package private) static Trees |
impure_functions
expressions with impure functions cannot factored out
|
(package private) static Trees |
monoids
An aggeregation must be based on a commutative monoid (plus,zero) with a unit:
name(type,plus,zero,unit)
plus: function from (b,b) to b, zero: b, unit: function from a to b
|
(package private) static Trees |
plan_names |
(package private) static Trees |
plans_with_distributed_lambdas |
(package private) static Trees |
repeat_variables |
(package private) static SymbolTable |
st
used in pattern compilation and variable renaming
|
(package private) static SymbolTable |
type_env
type environment that binds local variables to types
|
(package private) static SymbolTable |
type_names
used in typedefs
|
Constructor and Description |
---|
Translator() |
Modifier and Type | Method and Description |
---|---|
static boolean |
alpha_equivalent(Tree x,
Tree y)
return true if x is equal to y modulo variable substitution
|
static boolean |
alpha_equivalent(Tree x,
Tree y,
SymbolTable st)
return true if x is equal to y modulo variable substitution
|
static boolean |
collection_type(Tree tp)
is this type a collection type?
|
(package private) static void |
error(String msg) |
static Trees |
free_variables(Tree e,
Trees exclude)
return the list of free variables in e that are not in exclude list
|
(package private) static void |
global_reset() |
(package private) static Tree |
identity() |
static boolean |
is_collection(String x)
is this type a collection type?
|
static boolean |
is_persistent_collection(String x)
is this type a collection type for values stored in HDFS?
|
(package private) static boolean |
is_pure(Tree expr)
is this expression pure? (does it contain calls to impure functions?)
|
static Tree |
new_var()
generates new variable names
|
static int |
occurences(Tree x,
Tree e)
count the occurences of x in e
|
(package private) static Trees |
pattern_variables(Tree pattern)
return the variables of a pattern
|
static String |
persistent_collection(String x)
make this collection type a persistent type that is stored in HDFS
|
(package private) static void |
print_aggregates() |
static String |
reify(Tree e)
convert Tree constructions to code that construct these Trees (used in the Compiler)
|
static String |
reify(Trees ts)
convert Tree constructions to code that construct these Trees (used in the Compiler)
|
(package private) static void |
reset() |
static Trees |
subst_list(Tree from_expr,
Tree to_expr,
Trees el)
replace all occurences of from_expr in el with to_expr
|
static Tree |
subst_var(Tree var,
Tree to_expr,
Tree expr)
replace all occurences of var in expr with to_expr only if to_expr is pure or it is used once only
|
static Tree |
subst(Tree from_expr,
Tree to_expr,
Tree expr)
replace all occurences of from_expr in expr with to_expr
|
static Tree |
template(Tree s)
used in the MRQL parser to handle templates
|
static void |
top_level(Tree expr)
the MRQL top-level interfacse to evaluate a single MRQL expression or command
|
static String |
transient_collection(String x)
make this collection type a transient type stored in memory
|
static Tree |
translate_select(Tree e)
translate a simplified select MRQL query to an algebraic form
|
static Trees |
union(Trees xs,
Trees ys) |
print_plan, print_query, print_type, print, reify
static Trees functions
static SymbolTable type_env
static SymbolTable global_type_env
static SymbolTable global_datatype_env
static SymbolTable st
static SymbolTable global_vars
static SymbolTable global_functions
static SymbolTable global_macros
static SymbolTable type_names
static SymbolTable data_constructors
static Trees repeat_variables
static Trees impure_functions
static final Tree identity
static Trees monoids
static Trees plans_with_distributed_lambdas
static Trees algebraic_operators
static Trees plan_names
static void reset()
static void global_reset()
static void error(String msg)
static Tree identity()
public static boolean is_collection(String x)
public static boolean collection_type(Tree tp)
public static boolean is_persistent_collection(String x)
public static String persistent_collection(String x)
public static String transient_collection(String x)
static void print_aggregates()
public static Tree new_var()
static boolean is_pure(Tree expr)
public static Tree subst(Tree from_expr, Tree to_expr, Tree expr)
from_expr
- targetto_expr
- replacementexpr
- inputpublic static Trees subst_list(Tree from_expr, Tree to_expr, Trees el)
from_expr
- targetto_expr
- replacementel
- list of input expressionspublic static Tree subst_var(Tree var, Tree to_expr, Tree expr)
var
- targetto_expr
- replacementexpr
- inputpublic static String reify(Tree e)
public static String reify(Trees ts)
public static Trees free_variables(Tree e, Trees exclude)
public static boolean alpha_equivalent(Tree x, Tree y, SymbolTable st)
public static boolean alpha_equivalent(Tree x, Tree y)
public static Tree translate_select(Tree e)
public static void top_level(Tree expr)
Copyright © 2013 The Apache Software Foundation. All rights reserved.