#include <AST.hxx>
Public Member Functions | |
| AST_LOCATION_TYPE | endLoc () |
| bool | isGlobal () |
| bool | isFnxn () |
| size_t | nBits () |
| bool | isLiteral () |
| bool | isTopLevelForm () |
| bool | isIdentType (IdentType idt) |
| bool | leadsToTopLevelForm () |
| void | clearTypes () |
| void | disown (size_t s) |
| The only place this is called is in the parser, and there only to strip documentation strings. That is actually a bad thing to do, since we want to preserve them in the AST, and a literal value really ought to be a perfectly legal (if useless) expression. We should attempt to comment out the body of stripDocString() and see if everything still works. If so, both this and stripDocString() should be removed. | |
| std::string | atKwd () const |
| std::string | old_atKwd () const |
| void | getIds (std::ostream &errStream, std::vector< boost::shared_ptr< AST > > &ids, bool getPattern=false) |
| Append all ident ASTs from a Binding-pattern to the ids vector. | |
| boost::shared_ptr< Type > | getType () |
| Utility function to call symType->getType(). | |
| boost::shared_ptr< const Type > | getType () const |
| Utility function to call symType->getType(). | |
| boost::shared_ptr< AST > | getCtr () |
| boost::shared_ptr< AST > | Use () |
| Given a defining occurrence, return a new AST for a use occurrence. | |
| AST (boost::shared_ptr< AST > ast, bool shallowCopyChildren=true) | |
| Copy constructor -- make an exact (except ID) shallow copy. | |
| boost::shared_ptr< AST > | getTrueCopy () |
| Make an exact copy, deep, including symbolDef, type, etc. | |
| boost::shared_ptr< AST > | getDeepCopy () |
| Make an exact deep copy. | |
| void | rename (boost::shared_ptr< AST > from, std::string newName) |
| std::string | asString () const |
| Return pretty-printed representation of this AST in the form of a string. | |
| std::string | asString (PrettyPrintFlags flags) const |
| boost::shared_ptr< AST > | getID () |
| Get the unique identifier for this AST. | |
| boost::shared_ptr< AST > | getInstanceMethod (std::string name) |
| From a definstance AST, get the definition corresponding to the method `name'. | |
| bool | isUnionLeg () |
| Return true IFF this is a AST corresponds to a union leg. | |
| bool | isTcMethod () |
| Return true IFF this AST is a type class method name identifier. | |
| int | precedence () const |
| void | PrettyPrint (std::ostream &out, PrettyPrintFlags flags=pp_FinalNewline) const |
Pretty print this AST to out, annotating each with its type if showTypes is true, and appending a final end of line of endline is true. | |
| void | PrettyPrint (sherpa::INOstream &out, PrettyPrintFlags flags=pp_FinalNewline) const |
| void | PrettyPrint (bool decorated) const |
| top-level wrapper for the pretty printer | |
| AST (const AstType at=at_Null) | |
| AST (const AstType at, const AST_TOKEN_TYPE &tok) | |
| AST (const AstType at, const AST_LOCATION_TYPE &loc) | |
| AST (const AstType at, const AST_LOCATION_TYPE &loc, AST_SMART_PTR< AST > child1) | |
| AST (const AstType at, const AST_LOCATION_TYPE &loc, AST_SMART_PTR< AST > child1, AST_SMART_PTR< AST > child2) | |
| AST (const AstType at, const AST_LOCATION_TYPE &loc, AST_SMART_PTR< AST > child1, AST_SMART_PTR< AST > child2, AST_SMART_PTR< AST > child3) | |
| AST (const AstType at, const AST_LOCATION_TYPE &loc, AST_SMART_PTR< AST > child1, AST_SMART_PTR< AST > child2, AST_SMART_PTR< AST > child3, AST_SMART_PTR< AST > child4) | |
| AST (const AstType at, const AST_LOCATION_TYPE &loc, AST_SMART_PTR< AST > child1, AST_SMART_PTR< AST > child2, AST_SMART_PTR< AST > child3, AST_SMART_PTR< AST > child4, AST_SMART_PTR< AST > child5) | |
| AST (const AstType at, const AST_LOCATION_TYPE &loc, AST_SMART_PTR< AST > child1, AST_SMART_PTR< AST > child2, AST_SMART_PTR< AST > child3, AST_SMART_PTR< AST > child4, AST_SMART_PTR< AST > child5, AST_SMART_PTR< AST > child6) | |
| AST (const AstType at, const AST_LOCATION_TYPE &loc, AST_SMART_PTR< AST > child1, AST_SMART_PTR< AST > child2, AST_SMART_PTR< AST > child3, AST_SMART_PTR< AST > child4, AST_SMART_PTR< AST > child5, AST_SMART_PTR< AST > child6, AST_SMART_PTR< AST > child7) | |
| AST (const AstType at, const AST_LOCATION_TYPE &loc, AST_SMART_PTR< AST > child1, AST_SMART_PTR< AST > child2, AST_SMART_PTR< AST > child3, AST_SMART_PTR< AST > child4, AST_SMART_PTR< AST > child5, AST_SMART_PTR< AST > child6, AST_SMART_PTR< AST > child7, AST_SMART_PTR< AST > child8) | |
| ~AST () | |
| const AST_SMART_PTR< AST > | child (size_t i) const |
| AST_SMART_PTR< AST > & | child (size_t i) |
| void | addChild (AST_SMART_PTR< AST > cld) |
| ::std::string | getTokenString () |
| void | addChildrenFrom (AST_SMART_PTR< AST > other) |
| const char * | tagName () const |
| const char * | nodeName () const |
| const char * | printName () const |
| bool | isMemberOfType (AstType) const |
| bool | isValid () const |
Static Public Member Functions | |
| static boost::shared_ptr< AST > | makeBoolLit (const sherpa::LToken &tok) |
| static boost::shared_ptr< AST > | makeIntLit (const sherpa::LToken &tok) |
| static boost::shared_ptr< AST > | makeStringLit (const sherpa::LToken &tok) |
| static boost::shared_ptr< AST > | makeCharLit (const sherpa::LToken &tok) |
| static boost::shared_ptr< AST > | makeFloatLit (const sherpa::LToken &tok) |
| static boost::shared_ptr< AST > | genIdent (const char *pfx="tmp", const bool isTV=false) |
| static boost::shared_ptr< AST > | genSym (boost::shared_ptr< AST > lhs, const char *pfx="tmp", const bool isTV=false) |
| static boost::shared_ptr< AST > | make (boost::shared_ptr< AST > ast, bool shallowCopyChildren=true) |
| static AST_SMART_PTR< AST > | make (const AstType at=at_Null) |
| static AST_SMART_PTR< AST > | make (const AstType at, const AST_TOKEN_TYPE &tok) |
| static AST_SMART_PTR< AST > | make (const AstType at, const AST_LOCATION_TYPE &loc) |
| static AST_SMART_PTR< AST > | make (const AstType at, const AST_LOCATION_TYPE &loc, AST_SMART_PTR< AST > child1) |
| static AST_SMART_PTR< AST > | make (const AstType at, const AST_LOCATION_TYPE &loc, const AST_SMART_PTR< AST > child1, const AST_SMART_PTR< AST > child2) |
| static AST_SMART_PTR< AST > | make (const AstType at, const AST_LOCATION_TYPE &loc, const AST_SMART_PTR< AST > child1, const AST_SMART_PTR< AST > child2, const AST_SMART_PTR< AST > child3) |
| static AST_SMART_PTR< AST > | make (const AstType at, const AST_LOCATION_TYPE &loc, const AST_SMART_PTR< AST > child1, const AST_SMART_PTR< AST > child2, const AST_SMART_PTR< AST > child3, const AST_SMART_PTR< AST > child4) |
| static AST_SMART_PTR< AST > | make (const AstType at, const AST_LOCATION_TYPE &loc, const AST_SMART_PTR< AST > child1, const AST_SMART_PTR< AST > child2, const AST_SMART_PTR< AST > child3, const AST_SMART_PTR< AST > child4, const AST_SMART_PTR< AST > child5) |
| static AST_SMART_PTR< AST > | make (const AstType at, const AST_LOCATION_TYPE &loc, const AST_SMART_PTR< AST > child1, const AST_SMART_PTR< AST > child2, const AST_SMART_PTR< AST > child3, const AST_SMART_PTR< AST > child4, const AST_SMART_PTR< AST > child5, const AST_SMART_PTR< AST > child6) |
| static AST_SMART_PTR< AST > | make (const AstType at, const AST_LOCATION_TYPE &loc, const AST_SMART_PTR< AST > child1, const AST_SMART_PTR< AST > child2, const AST_SMART_PTR< AST > child3, const AST_SMART_PTR< AST > child4, const AST_SMART_PTR< AST > child5, const AST_SMART_PTR< AST > child6, const AST_SMART_PTR< AST > child7) |
| static AST_SMART_PTR< AST > | make (const AstType at, const AST_LOCATION_TYPE &loc, const AST_SMART_PTR< AST > child1, const AST_SMART_PTR< AST > child2, const AST_SMART_PTR< AST > child3, const AST_SMART_PTR< AST > child4, const AST_SMART_PTR< AST > child5, const AST_SMART_PTR< AST > child6, const AST_SMART_PTR< AST > child7, const AST_SMART_PTR< AST > child8) |
| static const char * | tagName (const AstType at) |
| static const char * | nodeName (const AstType at) |
| static const char * | printName (const AstType at) |
Data Fields | |
| AstType | astType |
| ::std::string | s |
| AST_LOCATION_TYPE | loc |
| ::std::vector< AST_SMART_PTR< AST > > | children |
| unsigned long long | ID |
| LitValue | litValue |
| unsigned long | litBase |
| IdentType | identType |
| AstFlags | flags |
| PrintFlags | printVariant |
| boost::shared_ptr< TypeScheme > | scheme |
| boost::shared_ptr< Type > | symType |
| boost::shared_ptr< AST > | symbolDef |
| bool | isDecl |
| boost::shared_ptr< AST > | defn |
| boost::shared_ptr< AST > | decl |
| FQName | fqn |
| std::string | externalName |
| EnvSet | envs |
| boost::shared_ptr< AST > | defForm |
| Pointer to defining form. | |
| boost::shared_ptr< AST > | defbps |
| boost::shared_ptr< Type > | tagType |
| If this is a union, tagType is the type of the tag. | |
| size_t | field_bits |
| size_t | unin_discm |
| size_t | total_fill |
| boost::shared_ptr< TypeScheme > | stSigma |
| boost::shared_ptr< AST > | stCtr |
| boost::shared_ptr< AST > | tvarLB |
| boost::shared_ptr< AST > | parentLB |
Definition at line 774 of file AST.hxx.
| AST::AST | ( | boost::shared_ptr< AST > | ast, | |
| bool | shallowCopyChildren = true | |||
| ) |
| AST::AST | ( | const AstType | at = at_Null |
) |
Definition at line 58 of file AST.cxx.
References astType, decl, defbps, defForm, defn, field_bits, flags, boost::GC_NULL, ID, id_unresolved, identType, isDecl, NO_FLAGS, parentLB, pf_NONE, printVariant, scheme, symbolDef, symType, tagType, total_fill, tvarLB, and unin_discm.
| AST::AST | ( | const AstType | at, | |
| const AST_TOKEN_TYPE & | tok | |||
| ) |
Definition at line 82 of file AST.cxx.
References astType, decl, defbps, defForm, defn, field_bits, flags, boost::GC_NULL, ID, id_unresolved, identType, isDecl, loc, NO_FLAGS, parentLB, pf_NONE, printVariant, s, scheme, symbolDef, symType, tagType, total_fill, tvarLB, and unin_discm.
| AST::AST | ( | const AstType | at, | |
| const AST_LOCATION_TYPE & | loc | |||
| ) |
Definition at line 108 of file AST.cxx.
References astType, decl, defbps, defForm, defn, field_bits, flags, boost::GC_NULL, ID, id_unresolved, identType, isDecl, loc, NO_FLAGS, parentLB, pf_NONE, printVariant, scheme, symbolDef, symType, tagType, total_fill, tvarLB, and unin_discm.
| AST::AST | ( | const AstType | at, | |
| const AST_LOCATION_TYPE & | loc, | |||
| AST_SMART_PTR< AST > | child1, | |||
| AST_SMART_PTR< AST > | child2 | |||
| ) |
| AST::AST | ( | const AstType | at, | |
| const AST_LOCATION_TYPE & | loc, | |||
| AST_SMART_PTR< AST > | child1, | |||
| AST_SMART_PTR< AST > | child2, | |||
| AST_SMART_PTR< AST > | child3 | |||
| ) |
| AST::AST | ( | const AstType | at, | |
| const AST_LOCATION_TYPE & | loc, | |||
| AST_SMART_PTR< AST > | child1, | |||
| AST_SMART_PTR< AST > | child2, | |||
| AST_SMART_PTR< AST > | child3, | |||
| AST_SMART_PTR< AST > | child4 | |||
| ) |
| AST::AST | ( | const AstType | at, | |
| const AST_LOCATION_TYPE & | loc, | |||
| AST_SMART_PTR< AST > | child1, | |||
| AST_SMART_PTR< AST > | child2, | |||
| AST_SMART_PTR< AST > | child3, | |||
| AST_SMART_PTR< AST > | child4, | |||
| AST_SMART_PTR< AST > | child5 | |||
| ) |
| AST::AST | ( | const AstType | at, | |
| const AST_LOCATION_TYPE & | loc, | |||
| AST_SMART_PTR< AST > | child1, | |||
| AST_SMART_PTR< AST > | child2, | |||
| AST_SMART_PTR< AST > | child3, | |||
| AST_SMART_PTR< AST > | child4, | |||
| AST_SMART_PTR< AST > | child5, | |||
| AST_SMART_PTR< AST > | child6 | |||
| ) |
| AST::AST | ( | const AstType | at, | |
| const AST_LOCATION_TYPE & | loc, | |||
| AST_SMART_PTR< AST > | child1, | |||
| AST_SMART_PTR< AST > | child2, | |||
| AST_SMART_PTR< AST > | child3, | |||
| AST_SMART_PTR< AST > | child4, | |||
| AST_SMART_PTR< AST > | child5, | |||
| AST_SMART_PTR< AST > | child6, | |||
| AST_SMART_PTR< AST > | child7 | |||
| ) |
| AST::AST | ( | const AstType | at, | |
| const AST_LOCATION_TYPE & | loc, | |||
| AST_SMART_PTR< AST > | child1, | |||
| AST_SMART_PTR< AST > | child2, | |||
| AST_SMART_PTR< AST > | child3, | |||
| AST_SMART_PTR< AST > | child4, | |||
| AST_SMART_PTR< AST > | child5, | |||
| AST_SMART_PTR< AST > | child6, | |||
| AST_SMART_PTR< AST > | child7, | |||
| AST_SMART_PTR< AST > | child8 | |||
| ) |
| void AST::addChild | ( | AST_SMART_PTR< AST > | cld | ) |
Referenced by addChildrenFrom(), cl_convert_ast(), cl_heapify(), cl_rewrite_captured_idents(), FixDefs(), and trulyHoist().
| void AST::addChildrenFrom | ( | AST_SMART_PTR< AST > | other | ) | [inline] |
| std::string AST::asString | ( | PrettyPrintFlags | flags | ) | const |
| std::string AST::asString | ( | ) | const |
Return pretty-printed representation of this AST in the form of a string.
Definition at line 101 of file ASTaux.cxx.
References pp_NONE, and PrettyPrint().
Referenced by add_todo(), polyinst(), reRandT(), and Specialize().
| std::string AST::atKwd | ( | ) | const |
For each AST type, return an associated keyword name.
In most cases, the keyword name is simply the ast name. Later versions of astmaker actually emit a string translator, and names can now be assigned in the .ast file. We are in the process of switching over to that.
Definition at line 164 of file ASTimpl.cxx.
References assert(), old_atKwd(), printName(), and s.
Referenced by polyinst().
| AST_SMART_PTR<AST>& AST::child | ( | size_t | i | ) | [inline] |
| const AST_SMART_PTR<AST> AST::child | ( | size_t | i | ) | const [inline] |
Definition at line 1253 of file AST.hxx.
References children.
Referenced by cl_convert_ast(), cl_heapify(), clearTypes(), collectHeapifiedArgs(), getCtr(), getDeepCopy(), getID(), getInstanceMethod(), getTrueCopy(), and isValid().
| void AST::clearTypes | ( | ) |
Definition at line 733 of file ASTimpl.cxx.
References child(), children, boost::GC_NULL, scheme, and symType.
| void AST::disown | ( | size_t | s | ) |
The only place this is called is in the parser, and there only to strip documentation strings. That is actually a bad thing to do, since we want to preserve them in the AST, and a literal value really ought to be a perfectly legal (if useless) expression. We should attempt to comment out the body of stripDocString() and see if everything still works. If so, both this and stripDocString() should be removed.
Remove child n from this AST.
Definition at line 681 of file ASTimpl.cxx.
References children.
| AST_LOCATION_TYPE AST::endLoc | ( | ) | [inline] |
| shared_ptr< AST > AST::genIdent | ( | const char * | pfx = "tmp", |
|
| const bool | isTV = false | |||
| ) | [static] |
Generate an identifier AST with a newly generated internal name. This will not have any particular type assigned to it, and is intended to be used in the front end passes before the type checker is involved.
Definition at line 70 of file ASTaux.cxx.
| static boost::shared_ptr<AST> AST::genSym | ( | boost::shared_ptr< AST > | lhs, | |
| const char * | pfx = "tmp", |
|||
| const bool | isTV = false | |||
| ) | [static] |
Generate an at_ident AST providing a temporary symbol that is type-compatible with the type of the passed AST lhs.
Referenced by addLB(), cl_convert_ast(), cl_HoistInstLam(), FixDefs(), hoist(), and ssa().
| shared_ptr< AST > AST::getCtr | ( | ) |
Given a union constructor of the form Ctr or union-name.Ctr, returns Ctr.
Definition at line 822 of file ASTimpl.cxx.
References assert(), astType, at_fqCtr, at_ident, child(), and boost::GC_NULL.
| shared_ptr< AST > AST::getDeepCopy | ( | ) |
Make an exact deep copy.
This function clears fields such as symbolDef, type, etc. This is because (1) we don't need them since new ASTs are almost immediately subject to resolver and type check. (2) We sometimes start from a copy of an AST and use it in a way that the original symbolDef/type are no longer valid, so we clear these fields preemptively.
Definition at line 190 of file ASTaux.cxx.
References child(), children, envs, boost::GC_NULL, and make().
Referenced by Use().
| shared_ptr< AST > AST::getID | ( | ) |
Get the unique identifier for this AST.
Definition at line 763 of file ASTimpl.cxx.
References astType, at_declstruct, at_declunion, at_defexception, at_define, at_defstruct, at_deftypeclass, at_defunion, at_letbinding, at_loopbinding, at_proclaim, at_recdef, child(), and boost::GC_NULL.
Referenced by proclaimsAboveDefs(), removeAndReRandT(), and Specialize().
| void AST::getIds | ( | std::ostream & | errStream, | |
| std::vector< boost::shared_ptr< AST > > & | ids, | |||
| bool | getPattern = false | |||
| ) |
Append all ident ASTs from a Binding-pattern to the ids vector.
if getPattern is true, it adds the identPattern ASTs instead of ident ASTs
| shared_ptr< AST > AST::getInstanceMethod | ( | std::string | name | ) |
From a definstance AST, get the definition corresponding to the method `name'.
Definition at line 787 of file ASTimpl.cxx.
References assert(), astType, at_definstance, child(), and boost::GC_NULL.
| shared_ptr< AST > AST::getTrueCopy | ( | ) |
Make an exact copy, deep, including symbolDef, type, etc.
Definition at line 179 of file ASTaux.cxx.
| shared_ptr< const Type > AST::getType | ( | ) | const |
Utility function to call symType->getType().
Definition at line 64 of file ASTaux.cxx.
References symType.
| shared_ptr< Type > AST::getType | ( | ) |
Utility function to call symType->getType().
Definition at line 58 of file ASTaux.cxx.
References symType.
| bool AST::isFnxn | ( | ) |
| bool AST::isGlobal | ( | ) | [inline] |
Definition at line 807 of file AST.hxx.
References flags, and ID_IS_GLOBAL.
Referenced by AlphaRename(), fixWithFqns(), and polyinst().
| bool AST::isIdentType | ( | IdentType | idt | ) |
Definition at line 872 of file ASTimpl.cxx.
References id_interface, id_method, id_object, id_struct, id_tcmethod, id_tvar, id_ucon, id_ucon0, id_union, id_value, idc_apply, idc_ctor, idc_type, idc_uctor, idc_usesel_lhs, idc_value, and identType.
Referenced by isTcMethod(), isUnionLeg(), and Use().
| bool AST::isLiteral | ( | ) |
Definition at line 856 of file ASTimpl.cxx.
References astType, at_boolLiteral, at_charLiteral, at_floatLiteral, at_intLiteral, and at_stringLiteral.
| bool AST::isMemberOfType | ( | AstType | ) | const |
| bool AST::isTcMethod | ( | ) |
Return true IFF this AST is a type class method name identifier.
Definition at line 813 of file ASTimpl.cxx.
References astType, at_ident, id_tcmethod, and isIdentType().
| bool AST::isTopLevelForm | ( | ) |
Definition at line 687 of file ASTimpl.cxx.
References astType, at_declare, at_declstruct, at_declunion, at_defexception, at_define, at_defstruct, at_defunion, at_importAs, at_proclaim, at_provide, and at_recdef.
| bool AST::isUnionLeg | ( | ) |
Return true IFF this is a AST corresponds to a union leg.
Definition at line 806 of file ASTimpl.cxx.
References assert(), astType, at_ident, idc_uctor, and isIdentType().
Referenced by polyinst(), and Specialize().
| bool AST::isValid | ( | ) | const |
Definition at line 1580 of file AST.cxx.
References agt__AnonGroup0, agt_category, agt_definition, agt_expr, agt_expr_or_define, agt_fielditem, agt_openclosed, agt_ow, agt_qtype, agt_tvar, agt_type, agt_ucon, agt_uselhs, agt_var, astChNumError(), astChTypeError(), astType, at_allocREF, at_and, at_AnyGroup, at_apply, at_argVec, at_array, at_array_nth, at_array_ref_nth, at_arrayRefType, at_arrayType, at_begin, at_bitfieldType, at_bitsizeof, at_boolLiteral, at_boxedCat, at_boxedType, at_byRefType, at_charLiteral, at_cond, at_cond_leg, at_cond_legs, at_condelse, at_constraints, at_constructor, at_constructors, at_constType, at_container, at_copyREF, at_declare, at_declares, at_declrepr, at_declstruct, at_declunion, at_defexception, at_define, at_definstance, at_defobject, at_defrepr, at_defstruct, at_deftypeclass, at_defunion, at_deref, at_docString, at_dummyType, at_dup, at_exceptionType, at_field, at_fields, at_fieldType, at_fill, at_floatLiteral, at_fn, at_fnargVec, at_fqCtr, at_frameBindings, at_ident, at_identList, at_identPattern, at_if, at_ifident, at_ifsel, at_import, at_importAs, at_inner_ref, at_interface, at_intLiteral, at_labeledBlock, at_lambda, at_let, at_letbinding, at_letbindings, at_letGather, at_letrec, at_letStar, at_localFrame, at_loop, at_loopbinding, at_loopbindings, at_looptest, at_MakeVector, at_methdecl, at_method_decl, at_method_decls, at_methType, at_mixfix, at_mkArrayRef, at_mkClosure, at_module, at_mutableType, at_nth, at_Null, at_object_apply, at_oc_closed, at_oc_open, at_opaqueCat, at_or, at_otherwise, at_primaryType, at_proclaim, at_provide, at_qualType, at_recdef, at_reprctr, at_reprctrs, at_reprrepr, at_return_from, at_sel_ctr, at_select, at_setbang, at_setClosure, at_sizeof, at_stringLiteral, at_struct_apply, at_suspend, at_tcapp, at_tcdecls, at_tcmethod_binding, at_tcmethods, at_throw, at_try, at_tvlist, at_tyfn, at_typeAnnotation, at_typeapp, at_ucon_apply, at_unboxedCat, at_unboxedType, at_unit, at_unless, at_usesel, at_usw_leg, at_usw_legs, at_uswitch, at_vector, at_vector_nth, at_vectorType, at_when, child(), children, and ISSET.
| bool AST::leadsToTopLevelForm | ( | ) |
Definition at line 709 of file ASTimpl.cxx.
References astType, at_declare, at_declstruct, at_declunion, at_defexception, at_define, at_defstruct, at_defunion, at_importAs, at_interface, at_module, at_proclaim, at_provide, and at_recdef.
| static AST_SMART_PTR<AST> AST::make | ( | const AstType | at, | |
| const AST_LOCATION_TYPE & | loc, | |||
| const AST_SMART_PTR< AST > | child1, | |||
| const AST_SMART_PTR< AST > | child2, | |||
| const AST_SMART_PTR< AST > | child3, | |||
| const AST_SMART_PTR< AST > | child4, | |||
| const AST_SMART_PTR< AST > | child5, | |||
| const AST_SMART_PTR< AST > | child6, | |||
| const AST_SMART_PTR< AST > | child7, | |||
| const AST_SMART_PTR< AST > | child8 | |||
| ) | [inline, static] |
| static AST_SMART_PTR<AST> AST::make | ( | const AstType | at, | |
| const AST_LOCATION_TYPE & | loc, | |||
| const AST_SMART_PTR< AST > | child1, | |||
| const AST_SMART_PTR< AST > | child2, | |||
| const AST_SMART_PTR< AST > | child3, | |||
| const AST_SMART_PTR< AST > | child4, | |||
| const AST_SMART_PTR< AST > | child5, | |||
| const AST_SMART_PTR< AST > | child6, | |||
| const AST_SMART_PTR< AST > | child7 | |||
| ) | [inline, static] |
| static AST_SMART_PTR<AST> AST::make | ( | const AstType | at, | |
| const AST_LOCATION_TYPE & | loc, | |||
| const AST_SMART_PTR< AST > | child1, | |||
| const AST_SMART_PTR< AST > | child2, | |||
| const AST_SMART_PTR< AST > | child3, | |||
| const AST_SMART_PTR< AST > | child4, | |||
| const AST_SMART_PTR< AST > | child5, | |||
| const AST_SMART_PTR< AST > | child6 | |||
| ) | [inline, static] |
| static boost::shared_ptr<AST> AST::make | ( | boost::shared_ptr< AST > | ast, | |
| bool | shallowCopyChildren = true | |||
| ) | [inline, static] |
Definition at line 1018 of file AST.hxx.
References AST().
Referenced by addLB(), beginSimp(), buildNewDeclaration(), cl_convert_ast(), cl_heapify(), cl_HoistInstLam(), cl_rewrite_captured_idents(), CleanMixFix(), EmitGlobalInitializers(), genIdent(), getClenvUse(), getDeepCopy(), getTrueCopy(), insertMethDecls(), LetWrap(), makeBoolLit(), makeCharLit(), makeFloatLit(), makeIntLit(), makeLetGather(), makeStringLit(), newGrandLet(), propagate_type_annotations(), reduce(), reprXform(), resolve(), ssa(), toc(), and typeInfer().
| shared_ptr< AST > AST::makeBoolLit | ( | const sherpa::LToken & | tok | ) | [static] |
Definition at line 60 of file ASTimpl.cxx.
References at_boolLiteral, lt_bool, make(), sherpa::LToken::str, and tok.
| shared_ptr< AST > AST::makeCharLit | ( | const sherpa::LToken & | tok | ) | [static] |
Definition at line 73 of file ASTimpl.cxx.
References at_charLiteral, LitValue::DecodeCharacter(), lt_char, make(), sherpa::LToken::str, and tok.
| shared_ptr< AST > AST::makeFloatLit | ( | const sherpa::LToken & | tok | ) | [static] |
Definition at line 143 of file ASTimpl.cxx.
References at_floatLiteral, lt_float, make(), sherpa::LToken::str, and tok.
| shared_ptr< AST > AST::makeIntLit | ( | const sherpa::LToken & | tok | ) | [static] |
This needs to use bignum representation, because host integer and target integer sizes may not agree.
Definition at line 90 of file ASTimpl.cxx.
References at_intLiteral, lt_int, make(), sherpa::LToken::str, and tok.
| shared_ptr< AST > AST::makeStringLit | ( | const sherpa::LToken & | tok | ) | [static] |
Definition at line 154 of file ASTimpl.cxx.
References at_stringLiteral, lt_string, make(), sherpa::LToken::str, and tok.
Referenced by buildLinkedAST().
| size_t AST::nBits | ( | ) |
| const char* AST::nodeName | ( | ) | const [inline] |
| const char * AST::nodeName | ( | const AstType | at | ) | [static] |
Definition at line 742 of file AST.cxx.
References agt__AnonGroup0, agt_category, agt_CompilationUnit, agt_definition, agt_eform, agt_expr, agt_expr_or_define, agt_fielditem, agt_if_definition, agt_literal, agt_openclosed, agt_ow, agt_qtype, agt_tc_definition, agt_tvar, agt_type, agt_type_definition, agt_ucon, agt_uselhs, agt_value_definition, agt_var, at_allocREF, at_and, at_AnyGroup, at_apply, at_argVec, at_array, at_array_nth, at_array_ref_nth, at_arrayRefType, at_arrayType, at_begin, at_bitfieldType, at_bitsizeof, at_boolLiteral, at_boxedCat, at_boxedType, at_byRefType, at_charLiteral, at_cond, at_cond_leg, at_cond_legs, at_condelse, at_constraints, at_constructor, at_constructors, at_constType, at_container, at_copyREF, at_declare, at_declares, at_declrepr, at_declstruct, at_declunion, at_defexception, at_define, at_definstance, at_defobject, at_defrepr, at_defstruct, at_deftypeclass, at_defunion, at_deref, at_docString, at_dummyType, at_dup, at_exceptionType, at_field, at_fields, at_fieldType, at_fill, at_floatLiteral, at_fn, at_fnargVec, at_fqCtr, at_frameBindings, at_ident, at_identList, at_identPattern, at_if, at_ifident, at_ifsel, at_import, at_importAs, at_inner_ref, at_interface, at_intLiteral, at_labeledBlock, at_lambda, at_let, at_letbinding, at_letbindings, at_letGather, at_letrec, at_letStar, at_localFrame, at_loop, at_loopbinding, at_loopbindings, at_looptest, at_MakeVector, at_methdecl, at_method_decl, at_method_decls, at_methType, at_mixfix, at_mkArrayRef, at_mkClosure, at_module, at_mutableType, at_nth, at_Null, at_object_apply, at_oc_closed, at_oc_open, at_opaqueCat, at_or, at_otherwise, at_primaryType, at_proclaim, at_provide, at_qualType, at_recdef, at_reprctr, at_reprctrs, at_reprrepr, at_return_from, at_sel_ctr, at_select, at_setbang, at_setClosure, at_sizeof, at_stringLiteral, at_struct_apply, at_suspend, at_tcapp, at_tcdecls, at_tcmethod_binding, at_tcmethods, at_throw, at_try, at_tvlist, at_tyfn, at_typeAnnotation, at_typeapp, at_ucon_apply, at_unboxedCat, at_unboxedType, at_unit, at_unless, at_usesel, at_usw_leg, at_usw_legs, at_uswitch, at_vector, at_vector_nth, at_vectorType, and at_when.
| std::string AST::old_atKwd | ( | ) | const |
Definition at line 176 of file ASTimpl.cxx.
References agt_category, agt_CompilationUnit, agt_definition, agt_eform, agt_expr, agt_expr_or_define, agt_fielditem, agt_if_definition, agt_literal, agt_openclosed, agt_ow, agt_qtype, agt_tc_definition, agt_tvar, agt_type, agt_type_definition, agt_ucon, agt_uselhs, agt_value_definition, agt_var, assert(), astType, at_allocREF, at_and, at_AnyGroup, at_apply, at_argVec, at_array, at_array_nth, at_array_ref_nth, at_arrayRefType, at_arrayType, at_begin, at_bitfieldType, at_bitsizeof, at_boolLiteral, at_boxedCat, at_boxedType, at_byRefType, at_charLiteral, at_cond, at_cond_leg, at_cond_legs, at_condelse, at_constraints, at_constructor, at_constructors, at_constType, at_container, at_copyREF, at_declare, at_declares, at_declrepr, at_declstruct, at_declunion, at_defexception, at_define, at_definstance, at_defobject, at_defrepr, at_defstruct, at_deftypeclass, at_defunion, at_deref, at_docString, at_dummyType, at_dup, at_exceptionType, at_field, at_fields, at_fieldType, at_fill, at_floatLiteral, at_fn, at_fnargVec, at_fqCtr, at_frameBindings, at_ident, at_identList, at_identPattern, at_if, at_ifident, at_ifsel, at_import, at_importAs, at_inner_ref, at_interface, at_intLiteral, at_labeledBlock, at_lambda, at_let, at_letbinding, at_letbindings, at_letGather, at_letrec, at_letStar, at_localFrame, at_loop, at_loopbinding, at_loopbindings, at_looptest, at_MakeVector, at_methdecl, at_method_decl, at_method_decls, at_methType, at_mixfix, at_mkArrayRef, at_mkClosure, at_module, at_mutableType, at_Null, at_object_apply, at_oc_closed, at_oc_open, at_opaqueCat, at_or, at_otherwise, at_primaryType, at_proclaim, at_provide, at_qualType, at_recdef, at_reprctr, at_reprctrs, at_reprrepr, at_return_from, at_sel_ctr, at_select, at_setbang, at_setClosure, at_sizeof, at_stringLiteral, at_struct_apply, at_suspend, at_tcapp, at_tcdecls, at_tcmethod_binding, at_tcmethods, at_throw, at_try, at_tvlist, at_tyfn, at_typeAnnotation, at_typeapp, at_ucon_apply, at_unboxedCat, at_unboxedType, at_unit, at_unless, at_usesel, at_usw_leg, at_usw_legs, at_uswitch, at_vector, at_vector_nth, at_vectorType, and at_when.
Referenced by atKwd().
| int AST::precedence | ( | ) | const |
Definition at line 901 of file ASTimpl.cxx.
References astType, at_arrayType, at_boxedType, at_constType, at_exceptionType, at_ident, at_mutableType, at_primaryType, at_select, at_typeapp, at_usesel, and at_vectorType.
| void AST::PrettyPrint | ( | bool | decorated | ) | const |
top-level wrapper for the pretty printer
Definition at line 1230 of file BitC-pp.cxx.
References blk_BitcP(), flags, and pp_ShowTypes.
| void AST::PrettyPrint | ( | sherpa::INOstream & | out, | |
| PrettyPrintFlags | flags = pp_FinalNewline | |||
| ) | const |
| void AST::PrettyPrint | ( | std::ostream & | out, | |
| PrettyPrintFlags | flags = pp_FinalNewline | |||
| ) | const |
Pretty print this AST to out, annotating each with its type if showTypes is true, and appending a final end of line of endline is true.
Definition at line 1212 of file BitC-pp.cxx.
References blk_BitcP(), flags, and pp_FinalNewline.
Referenced by asString(), and cl_convert_ast().
| const char* AST::printName | ( | ) | const [inline] |
| const char * AST::printName | ( | const AstType | at | ) | [static] |
Definition at line 1067 of file AST.cxx.
References agt__AnonGroup0, agt_category, agt_CompilationUnit, agt_definition, agt_eform, agt_expr, agt_expr_or_define, agt_fielditem, agt_if_definition, agt_literal, agt_openclosed, agt_ow, agt_qtype, agt_tc_definition, agt_tvar, agt_type, agt_type_definition, agt_ucon, agt_uselhs, agt_value_definition, agt_var, at_allocREF, at_and, at_AnyGroup, at_apply, at_argVec, at_array, at_array_nth, at_array_ref_nth, at_arrayRefType, at_arrayType, at_begin, at_bitfieldType, at_bitsizeof, at_boolLiteral, at_boxedCat, at_boxedType, at_byRefType, at_charLiteral, at_cond, at_cond_leg, at_cond_legs, at_condelse, at_constraints, at_constructor, at_constructors, at_constType, at_container, at_copyREF, at_declare, at_declares, at_declrepr, at_declstruct, at_declunion, at_defexception, at_define, at_definstance, at_defobject, at_defrepr, at_defstruct, at_deftypeclass, at_defunion, at_deref, at_docString, at_dummyType, at_dup, at_exceptionType, at_field, at_fields, at_fieldType, at_fill, at_floatLiteral, at_fn, at_fnargVec, at_fqCtr, at_frameBindings, at_ident, at_identList, at_identPattern, at_if, at_ifident, at_ifsel, at_import, at_importAs, at_inner_ref, at_interface, at_intLiteral, at_labeledBlock, at_lambda, at_let, at_letbinding, at_letbindings, at_letGather, at_letrec, at_letStar, at_localFrame, at_loop, at_loopbinding, at_loopbindings, at_looptest, at_MakeVector, at_methdecl, at_method_decl, at_method_decls, at_methType, at_mixfix, at_mkArrayRef, at_mkClosure, at_module, at_mutableType, at_nth, at_Null, at_object_apply, at_oc_closed, at_oc_open, at_opaqueCat, at_or, at_otherwise, at_primaryType, at_proclaim, at_provide, at_qualType, at_recdef, at_reprctr, at_reprctrs, at_reprrepr, at_return_from, at_sel_ctr, at_select, at_setbang, at_setClosure, at_sizeof, at_stringLiteral, at_struct_apply, at_suspend, at_tcapp, at_tcdecls, at_tcmethod_binding, at_tcmethods, at_throw, at_try, at_tvlist, at_tyfn, at_typeAnnotation, at_typeapp, at_ucon_apply, at_unboxedCat, at_unboxedType, at_unit, at_unless, at_usesel, at_usw_leg, at_usw_legs, at_uswitch, at_vector, at_vector_nth, at_vectorType, and at_when.
| void AST::rename | ( | boost::shared_ptr< AST > | from, | |
| std::string | newName | |||
| ) |
| const char* AST::tagName | ( | ) | const [inline] |
| const char * AST::tagName | ( | const AstType | at | ) | [static] |
Definition at line 417 of file AST.cxx.
References agt__AnonGroup0, agt_category, agt_CompilationUnit, agt_definition, agt_eform, agt_expr, agt_expr_or_define, agt_fielditem, agt_if_definition, agt_literal, agt_openclosed, agt_ow, agt_qtype, agt_tc_definition, agt_tvar, agt_type, agt_type_definition, agt_ucon, agt_uselhs, agt_value_definition, agt_var, at_allocREF, at_and, at_AnyGroup, at_apply, at_argVec, at_array, at_array_nth, at_array_ref_nth, at_arrayRefType, at_arrayType, at_begin, at_bitfieldType, at_bitsizeof, at_boolLiteral, at_boxedCat, at_boxedType, at_byRefType, at_charLiteral, at_cond, at_cond_leg, at_cond_legs, at_condelse, at_constraints, at_constructor, at_constructors, at_constType, at_container, at_copyREF, at_declare, at_declares, at_declrepr, at_declstruct, at_declunion, at_defexception, at_define, at_definstance, at_defobject, at_defrepr, at_defstruct, at_deftypeclass, at_defunion, at_deref, at_docString, at_dummyType, at_dup, at_exceptionType, at_field, at_fields, at_fieldType, at_fill, at_floatLiteral, at_fn, at_fnargVec, at_fqCtr, at_frameBindings, at_ident, at_identList, at_identPattern, at_if, at_ifident, at_ifsel, at_import, at_importAs, at_inner_ref, at_interface, at_intLiteral, at_labeledBlock, at_lambda, at_let, at_letbinding, at_letbindings, at_letGather, at_letrec, at_letStar, at_localFrame, at_loop, at_loopbinding, at_loopbindings, at_looptest, at_MakeVector, at_methdecl, at_method_decl, at_method_decls, at_methType, at_mixfix, at_mkArrayRef, at_mkClosure, at_module, at_mutableType, at_nth, at_Null, at_object_apply, at_oc_closed, at_oc_open, at_opaqueCat, at_or, at_otherwise, at_primaryType, at_proclaim, at_provide, at_qualType, at_recdef, at_reprctr, at_reprctrs, at_reprrepr, at_return_from, at_sel_ctr, at_select, at_setbang, at_setClosure, at_sizeof, at_stringLiteral, at_struct_apply, at_suspend, at_tcapp, at_tcdecls, at_tcmethod_binding, at_tcmethods, at_throw, at_try, at_tvlist, at_tyfn, at_typeAnnotation, at_typeapp, at_ucon_apply, at_unboxedCat, at_unboxedType, at_unit, at_unless, at_usesel, at_usw_leg, at_usw_legs, at_uswitch, at_vector, at_vector_nth, at_vectorType, and at_when.
Referenced by astChNumError(), and astChTypeError().
| shared_ptr< AST > AST::Use | ( | ) |
Given a defining occurrence, return a new AST for a use occurrence.
Definition at line 133 of file ASTaux.cxx.
References assert(), astType, at_ident, getDeepCopy(), id_tvar, isIdentType(), MASK_FLAGS_FROM_USE, symbolDef, and symType.
Referenced by cl_convert_ast().
Definition at line 777 of file AST.hxx.
Referenced by add_relevant_items_todo(), addCompType(), AlphaRename(), AST(), checkInfTypedValues(), cl_convert_ast(), cl_heapify(), cl_rewrite_captured_idents(), clearConstraints(), collectHeapifiedArgs(), findusedef(), FixDefs(), fixWithFqns(), getAllDefs(), getCtr(), getID(), getInstanceMethod(), getLetintoLetStream(), getValuesIntoMainStream(), hoist(), isLiteral(), isMemberOfType(), isTcMethod(), isTopLevelForm(), isUnionLeg(), isValid(), lbMustNotSurvive(), leadsToTopLevelForm(), mangleIDs(), markPreludeDefs(), markRecBound(), nodeName(), old_atKwd(), polyinst(), precedence(), printName(), proclaimsAboveDefs(), refize(), refSub(), removeUnreached(), Specialize(), sub(), substitute(), tagName(), trulyHoist(), and Use().
| ::std::vector<AST_SMART_PTR<AST> > AST::children |
Definition at line 780 of file AST.hxx.
Referenced by add_relevant_items_todo(), addCompType(), addType(), AlphaRename(), buildLinkedAST(), checkInfTypedValues(), child(), cl_convert(), cl_convert_ast(), cl_heapify(), cl_rewrite_captured_idents(), clearConstraints(), clearTypes(), clearusedef(), collectHeapifiedArgs(), disown(), findusedef(), FixDefs(), fixWithFqns(), getAllDefs(), getDeepCopy(), getLetintoLetStream(), getTrueCopy(), getTypesIntoMainStream(), getValuesIntoMainStream(), hoist(), isValid(), lbMustNotSurvive(), mangleIDs(), markPreludeDefs(), markRecBound(), moveTypesUp(), polyinst(), proclaimsAboveDefs(), refize(), refSub(), removeUnreached(), Specialize(), sub(), substitute(), and trulyHoist().
On a definition AST: pointer to the definitive declaration (the first one). Set by the resolver in Symtab.cxx.
Definition at line 828 of file AST.hxx.
Referenced by AST(), and Specialize().
| boost::shared_ptr<AST> AST::defbps |
| boost::shared_ptr<AST> AST::defForm |
Pointer to defining form.
defForm has context sensitive meaning. This is basically a hack in the absence of parent pointers, where I must reach back into the definition and get the defining form, or some form of a containing datastructure.
In the case of top-level expressions, we use it to get the entire defining form from the identifier being defined
(def defIdent ... ) ^ | |________| defForm
In the case of let-expressions: (The quoted phrases are just ast-types not syntax.)
_______________ __________________ | defForm | | defForm | v | v | (define ... (let .. ("letbindings" ("letbinding" ident ... )))) ^ | ^ | |_____________| |_______________| defForm defForm
___________ | | v | (switch ... ("usw_leg" id ...) ...) ^ | |____| _____ __________ | | | | v | v | (do ("dobindings" ("dobinding" id ...) ...) ^ | |_____|
Definition at line 893 of file AST.hxx.
Referenced by addCompType(), AST(), polyinst(), and Specialize().
On a declaration AST only: if a definition for it has been seen, then defn points to the definition. Set by the resolver in Symtab.cxx.
Definition at line 824 of file AST.hxx.
Referenced by AST(), polyinst(), and Specialize().
A set of environments associated with this ast.
Definition at line 848 of file AST.hxx.
Referenced by getDeepCopy().
| std::string AST::externalName |
| size_t AST::field_bits |
Definition at line 797 of file AST.hxx.
Referenced by asString(), AST(), isGlobal(), and PrettyPrint().
If this is a global identifier, fqn is its canonical fully qualified name. The interface component of an fqn is the IFNAME of the interface in which the symbol was defined. the ident component is the identifier under which the symbol was defined at the point of its original definition, which may or may not be the name that was bound in an importing environment (because USE may have aliased it under a different name).
Definition at line 837 of file AST.hxx.
Referenced by cl_convert_ast(), cl_heapify(), findusedef(), fixWithFqns(), and refize().
| bool AST::isDecl |
| unsigned long AST::litBase |
| AST_LOCATION_TYPE AST::loc |
Definition at line 779 of file AST.hxx.
Referenced by AST(), astChNumError(), astChTypeError(), checkInfTypedValues(), cl_convert_ast(), cl_heapify(), cl_rewrite_captured_idents(), endLoc(), FixDefs(), hoist(), moveTypesUp(), polyinst(), proclaimsAboveDefs(), refize(), refSub(), setupTypApp(), Specialize(), sub(), and trulyHoist().
| boost::shared_ptr<AST> AST::parentLB |
Let-Binding within which this at_letbindings is contained. In the case of the outer-most let-bindings, this field points to the top-level define/recdef. This flag is set everytime the resolver is called, so there is no need to worry while cloning an AST.
Definition at line 947 of file AST.hxx.
Referenced by AST().
| ::std::string AST::s |
Definition at line 778 of file AST.hxx.
Referenced by AlphaRename(), AST(), atKwd(), cl_convert_ast(), cl_heapify(), fixWithFqns(), getNewName(), getTokenString(), mangleIDs(), polyinst(), refize(), Specialize(), and substitute().
| boost::shared_ptr<TypeScheme> AST::scheme |
| boost::shared_ptr<AST> AST::stCtr |
Union Constructors with identical layout must share the same structure type since they can be used in the same switch leg. Structures equality is nominal in BitC (structures are identified by name, not by identical components). Therefore, if at a second constructor, a previously typed structure with identical structure is found, the new constructor uses the structure defined at the old structure and stores a pointer to that constructor in stCtr.
| boost::shared_ptr<TypeScheme> AST::stSigma |
TypeScheme for the Structure definition corresponding to a union constructor.
| boost::shared_ptr<AST> AST::symbolDef |
Definition at line 803 of file AST.hxx.
Referenced by addCompType(), AlphaRename(), AST(), cl_convert_ast(), findusedef(), fixWithFqns(), polyinst(), refSub(), Specialize(), sub(), substitute(), and Use().
| boost::shared_ptr<Type> AST::symType |
Definition at line 802 of file AST.hxx.
Referenced by AST(), checkInfTypedValues(), cl_convert_ast(), clearTypes(), getType(), getValuesIntoMainStream(), isFnxn(), lbMustNotSurvive(), polyinst(), refize(), setupTypApp(), Specialize(), trulyHoist(), and Use().
| boost::shared_ptr<Type> AST::tagType |
| size_t AST::total_fill |
| boost::shared_ptr<AST> AST::tvarLB |
| size_t AST::unin_discm |
1.4.7