package pfff

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tok = Parse_info.t
type 'a wrap = 'a * tok
type 'a bracket = tok * 'a * tok
type ident = string wrap
type var = string wrap
type qualified_ident = ident list
type name = qualified_ident
type program = stmt list
and stmt =
  1. | Expr of expr
  2. | Block of stmt list
  3. | If of tok * expr * stmt * stmt
  4. | Switch of tok * expr * case list
  5. | While of tok * expr * stmt list
  6. | Do of tok * stmt list * expr
  7. | For of tok * expr list * expr list * expr list * stmt list
  8. | Foreach of tok * expr * tok * foreach_pattern * stmt list
  9. | Return of tok * expr option
  10. | Break of tok * expr option
  11. | Continue of tok * expr option
  12. | Throw of tok * expr
  13. | Try of tok * stmt list * catch list * finally list
  14. | ClassDef of class_def
  15. | FuncDef of func_def
  16. | ConstantDef of constant_def
  17. | TypeDef of type_def
  18. | NamespaceDef of tok * qualified_ident * stmt list bracket
  19. | NamespaceUse of tok * qualified_ident * ident option
  20. | StaticVars of tok * (var * expr option) list
  21. | Global of tok * expr list
and case =
  1. | Case of tok * expr * stmt list
  2. | Default of tok * stmt list
and catch = tok * hint_type * var * stmt list
and finally = tok * stmt list
and expr =
  1. | Int of string wrap
  2. | Double of string wrap
  3. | String of string wrap
  4. | Id of name
  5. | IdSpecial of special wrap
  6. | Var of var
  7. | Array_get of expr * expr option
  8. | Obj_get of expr * tok * expr
  9. | Class_get of expr * tok * expr
  10. | New of tok * expr * expr list
  11. | InstanceOf of tok * expr * expr
  12. | Assign of expr * tok * expr
  13. | AssignOp of expr * binaryOp wrap * expr
  14. | List of expr list bracket
  15. | Arrow of expr * tok * expr
  16. | Ref of tok * expr
  17. | Unpack of expr
  18. | Call of expr * expr list
  19. | Infix of Ast_generic.incr_decr wrap * expr
  20. | Postfix of Ast_generic.incr_decr wrap * expr
  21. | Binop of expr * binaryOp wrap * expr
  22. | Unop of unaryOp wrap * expr
  23. | Guil of expr list bracket
  24. | ConsArray of array_value list bracket
  25. | Collection of name * array_value list bracket
  26. | Xhp of xml
  27. | CondExpr of expr * expr * expr
  28. | Cast of Cst_php.ptype wrap * expr
  29. | Lambda of func_def
and special =
  1. | This
  2. | Eval
and binaryOp =
  1. | BinaryConcat
  2. | CombinedComparison
  3. | ArithOp of Ast_generic.arithmetic_operator
and xhp =
  1. | XhpText of string wrap
  2. | XhpExpr of expr
  3. | XhpXml of xml
and xml = {
  1. xml_tag : ident;
  2. xml_attrs : (ident * xhp_attr_value) list;
  3. xml_body : xhp list;
}
and xhp_attr_value = expr
and foreach_pattern = expr
and array_value = expr
and string_const_expr = expr
and hint_type =
  1. | Hint of name
  2. | HintArray of tok
  3. | HintQuestion of tok * hint_type
  4. | HintTuple of hint_type list bracket
  5. | HintCallback of hint_type list * hint_type option
  6. | HintShape of tok * (string_const_expr * hint_type) list bracket
  7. | HintTypeConst of hint_type * tok * hint_type
  8. | HintVariadic of tok * hint_type option
and class_name = hint_type
and func_def = {
  1. f_name : ident;
  2. f_kind : function_kind;
  3. f_params : parameter list;
  4. f_return_type : hint_type option;
  5. f_ref : bool;
  6. m_modifiers : modifier list;
  7. l_uses : (bool * var) list;
  8. f_attrs : attribute list;
  9. f_body : stmt list;
}
and function_kind =
  1. | Function
  2. | AnonLambda
  3. | ShortLambda
  4. | Method
and parameter = {
  1. p_type : hint_type option;
  2. p_ref : tok option;
  3. p_name : var;
  4. p_default : expr option;
  5. p_attrs : attribute list;
  6. p_variadic : tok option;
}
and modifier = Cst_php.modifier wrap
and attribute = expr
and constant_def = {
  1. cst_tok : tok;
  2. cst_name : ident;
  3. cst_body : expr option;
}
and enum_type = {
  1. e_base : hint_type;
  2. e_constraint : hint_type option;
}
and class_def = {
  1. c_name : ident;
  2. c_kind : class_kind wrap;
  3. c_extends : class_name option;
  4. c_implements : class_name list;
  5. c_uses : class_name list;
  6. c_enum_type : enum_type option;
  7. c_modifiers : modifier list;
  8. c_attrs : attribute list;
  9. c_xhp_fields : xhp_field list;
  10. c_xhp_attr_inherit : class_name list;
  11. c_constants : constant_def list;
  12. c_variables : class_var list;
  13. c_methods : method_def list;
  14. c_braces : unit bracket;
}
and class_kind =
  1. | Class
  2. | Interface
  3. | Trait
  4. | Enum
and xhp_field = class_var * bool
and class_var = {
  1. cv_name : var;
  2. cv_type : hint_type option;
  3. cv_value : expr option;
  4. cv_modifiers : modifier list;
}
and method_def = func_def
and type_def = {
  1. t_name : ident;
  2. t_kind : type_def_kind;
}
and type_def_kind =
  1. | Alias of hint_type
  2. | Newtype of hint_type
  3. | ClassConstType of hint_type option
type any =
  1. | Program of program
  2. | Stmt of stmt
  3. | Expr2 of expr
  4. | Param of parameter
val unwrap : ('a * 'b) -> 'a
val wrap_fake : string -> string * Parse_info.t
val builtin : string -> string
val special : string -> string
val has_modifier : class_var -> bool
val is_static : (Cst_php.modifier * 'a) list -> bool
val is_private : (Cst_php.modifier * 'a) list -> bool
val string_of_xhp_tag : string list -> string
val str_of_ident : ('a * 'b) -> 'a
val tok_of_ident : ('a * 'b) -> 'b
val str_of_name : ('a * Cst_php.tok) list -> 'a
val tok_of_name : ('a * 'b) list -> 'b
val remove_first_char : string -> string
val str_of_class_name : hint_type -> string
val name_of_class_name : hint_type -> ident