package pfff

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tok = Parse_info.t
and info = tok
and 'a wrap = 'a * tok
and 'a paren = tok * 'a * tok
and 'a brace = tok * 'a * tok
and 'a bracket = tok * 'a * tok
and 'a angle = tok * 'a * tok
and 'a single_angle = tok * 'a * tok
and 'a comma_list = ('a, tok) Common.either list
and 'a comma_list_dots = ('a, tok, tok) Common.either3 list
type ident =
  1. | Name of string wrap
  2. | XhpName of xhp_tag wrap
and xhp_tag = string list
type dname =
  1. | DName of string wrap
type qualified_ident = qualified_ident_element list
and qualified_ident_element =
  1. | QI of ident
  2. | QITok of tok
type name =
  1. | XName of qualified_ident
  2. | Self of tok
  3. | Parent of tok
  4. | LateStatic of tok
type hint_type =
  1. | Hint of name * type_args option
  2. | HintArray of tok
  3. | HintQuestion of tok * hint_type
  4. | HintTuple of hint_type comma_list paren
  5. | HintCallback of (tok * hint_type comma_list_dots paren * (tok * tok option * hint_type) option) paren
  6. | HintShape of tok * (string_const_expr * tok * hint_type) comma_list paren
  7. | HintTypeConst of hint_type * tok * hint_type
  8. | HintVariadic of tok * hint_type option
and type_param =
  1. | TParam of ident
  2. | TParamConstraint of ident * tok * class_name
and class_name = hint_type
and ptype =
  1. | BoolTy
  2. | IntTy
  3. | DoubleTy
  4. | StringTy
  5. | ArrayTy
  6. | ObjectTy
and expr =
  1. | Id of name
  2. | IdVar of dname * Scope_php.phpscope ref
  3. | This of tok
  4. | Call of expr * argument comma_list paren
  5. | ObjGet of expr * tok * expr
  6. | ClassGet of class_name_reference * tok * expr
  7. | ArrayGet of expr * expr option bracket
  8. | HashGet of expr * expr brace
  9. | BraceIdent of expr brace
  10. | Deref of tok * expr
  11. | Sc of scalar
  12. | Binary of expr * binaryOp wrap * expr
  13. | Unary of unaryOp wrap * expr
  14. | Assign of lvalue * tok * expr
  15. | AssignOp of lvalue * assignOp wrap * expr
  16. | Postfix of rw_variable * fixOp wrap
  17. | Infix of fixOp wrap * rw_variable
  18. | CondExpr of expr * tok * expr option * tok * expr
  19. | AssignList of tok * list_assign comma_list paren * tok * expr
  20. | ArrayLong of tok * array_pair comma_list paren
  21. | ArrayShort of array_pair comma_list bracket
  22. | Collection of name * array_pair comma_list brace
  23. | New of tok * class_name_reference * argument comma_list paren option
  24. | Clone of tok * expr
  25. | AssignRef of lvalue * tok * tok * lvalue
  26. | AssignNew of lvalue * tok * tok * tok * class_name_reference * argument comma_list paren option
  27. | Cast of castOp wrap * expr
  28. | CastUnset of tok * expr
  29. | InstanceOf of expr * tok * class_name_reference
  30. | Eval of tok * expr paren
  31. | Lambda of lambda_def
  32. | ShortLambda of short_lambda_def
  33. | Exit of tok * expr option paren option
  34. | At of tok * expr
  35. | Print of tok * expr
  36. | BackQuote of tok * encaps list * tok
  37. | Include of tok * expr
  38. | IncludeOnce of tok * expr
  39. | Require of tok * expr
  40. | RequireOnce of tok * expr
  41. | Empty of tok * lvalue paren
  42. | Isset of tok * lvalue comma_list paren
  43. | XhpHtml of xhp_html
  44. | Yield of tok * array_pair
  45. | YieldBreak of tok * tok
  46. | Await of tok * expr
  47. | SgrepExprDots of tok
  48. | ParenExpr of expr paren
and scalar =
  1. | C of constant
  2. | Guil of tok * encaps list * tok
  3. | HereDoc of tok * encaps list * tok
and constant =
  1. | Int of string wrap
  2. | Double of string wrap
  3. | String of string wrap
  4. | PreProcess of cpp_directive wrap
  5. | XdebugClass of name * class_stmt list
  6. | XdebugResource
and cpp_directive =
  1. | Line
  2. | File
  3. | Dir
  4. | ClassC
  5. | TraitC
  6. | MethodC
  7. | FunctionC
  8. | NamespaceC
and encaps =
  1. | EncapsString of string wrap
  2. | EncapsVar of lvalue
  3. | EncapsCurly of tok * lvalue * tok
  4. | EncapsDollarCurly of tok * lvalue * tok
  5. | EncapsExpr of tok * expr * tok
and binaryOp =
  1. | Arith of arithOp
  2. | Logical of logicalOp
  3. | BinaryConcat
  4. | CombinedComparison
and arithOp =
  1. | Plus
  2. | Minus
  3. | Mul
  4. | Div
  5. | Mod
  6. | DecLeft
  7. | DecRight
  8. | And
  9. | Or
  10. | Xor
and logicalOp =
  1. | Inf
  2. | Sup
  3. | InfEq
  4. | SupEq
  5. | Eq
  6. | NotEq
  7. | Identical
  8. | NotIdentical
  9. | AndLog
  10. | OrLog
  11. | XorLog
  12. | AndBool
  13. | OrBool
and assignOp =
  1. | AssignOpArith of arithOp
  2. | AssignConcat
and unaryOp =
  1. | UnPlus
  2. | UnMinus
  3. | UnBang
  4. | UnTilde
and castOp = ptype
and list_assign =
  1. | ListVar of lvalue
  2. | ListList of tok * list_assign comma_list paren
  3. | ListEmpty
and array_pair =
  1. | ArrayExpr of expr
  2. | ArrayRef of tok * lvalue
  3. | ArrayArrowExpr of expr * tok * expr
  4. | ArrayArrowRef of expr * tok * tok * lvalue
and xhp_html =
  1. | Xhp of xhp_tag wrap * xhp_attribute list * tok * xhp_body list * xhp_tag option wrap
  2. | XhpSingleton of xhp_tag wrap * xhp_attribute list * tok
and xhp_attribute = xhp_attr_name * tok * xhp_attr_value
and xhp_attr_name = string wrap
and xhp_attr_value =
  1. | XhpAttrString of tok * encaps list * tok
  2. | XhpAttrExpr of expr brace
  3. | SgrepXhpAttrValueMvar of string wrap
and xhp_body =
  1. | XhpText of string wrap
  2. | XhpExpr of expr brace
  3. | XhpNested of xhp_html
and argument =
  1. | Arg of expr
  2. | ArgRef of tok * w_variable
  3. | ArgUnpack of tok * expr
and lvalue = expr
and class_name_reference = expr
and rw_variable = lvalue
and r_variable = lvalue
and w_variable = lvalue
and static_scalar = expr
and string_const_expr = expr
and stmt =
  1. | ExprStmt of expr * tok
  2. | EmptyStmt of tok
  3. | Block of stmt_and_def list brace
  4. | If of tok * expr paren * stmt * if_elseif list * if_else option
  5. | IfColon of tok * expr paren * tok * stmt_and_def list * new_elseif list * new_else option * tok * tok
  6. | While of tok * expr paren * colon_stmt
  7. | Do of tok * stmt * tok * expr paren * tok
  8. | For of tok * tok * for_expr * tok * for_expr * tok * for_expr * tok * colon_stmt
  9. | Switch of tok * expr paren * switch_case_list
  10. | Foreach of tok * tok * expr * tok option * tok * foreach_pattern * tok * colon_stmt
  11. | Break of tok * expr option * tok
  12. | Continue of tok * expr option * tok
  13. | Return of tok * expr option * tok
  14. | Throw of tok * expr * tok
  15. | Try of tok * stmt_and_def list brace * catch list * finally list
  16. | Echo of tok * expr comma_list * tok
  17. | Globals of tok * global_var comma_list * tok
  18. | StaticVars of tok * static_var comma_list * tok
  19. | InlineHtml of string wrap
  20. | Use of tok * use_filename * tok
  21. | Unset of tok * lvalue comma_list paren * tok
  22. | Declare of tok * declare comma_list paren * colon_stmt
  23. | FuncDefNested of func_def
  24. | ClassDefNested of class_def
and switch_case_list =
  1. | CaseList of tok * tok option * case list * tok
  2. | CaseColonList of tok * tok option * case list * tok * tok
and case =
  1. | Case of tok * expr * tok * stmt_and_def list
  2. | Default of tok * tok * stmt_and_def list
and if_elseif = tok * expr paren * stmt
and if_else = tok * stmt
and for_expr = expr comma_list
and foreach_pattern =
  1. | ForeachVar of foreach_variable
  2. | ForeachArrow of foreach_pattern * tok * foreach_pattern
  3. | ForeachList of tok * list_assign comma_list paren
and foreach_variable = is_ref * lvalue
and catch = tok * (class_name * dname) paren * stmt_and_def list brace
and finally = tok * stmt_and_def list brace
and use_filename =
  1. | UseDirect of string wrap
  2. | UseParen of string wrap paren
and declare = ident * static_scalar_affect
and colon_stmt =
  1. | SingleStmt of stmt
  2. | ColonStmt of tok * stmt_and_def list * tok * tok
and new_elseif = tok * expr paren * tok * stmt_and_def list
and new_else = tok * tok * stmt_and_def list
and stmt_and_def = stmt
and func_def = {
  1. f_attrs : attributes option;
  2. f_tok : tok;
  3. f_type : function_type;
  4. f_modifiers : modifier wrap list;
  5. f_ref : is_ref;
  6. f_name : ident;
  7. f_tparams : type_params option;
  8. f_params : parameter comma_list_dots paren;
  9. f_return_type : (tok * tok option * hint_type) option;
  10. f_body : stmt_and_def list brace;
}
and function_type =
  1. | FunctionRegular
  2. | FunctionLambda
  3. | MethodRegular
  4. | MethodAbstract
and parameter = {
  1. p_attrs : attributes option;
  2. p_modifier : modifier wrap option;
  3. p_soft_type : tok option;
  4. p_type : hint_type option;
  5. p_ref : is_ref;
  6. p_name : dname;
  7. p_default : static_scalar_affect option;
  8. p_variadic : tok option;
}
and is_ref = tok option
and lambda_def = lexical_vars option * func_def
and lexical_vars = tok * lexical_var comma_list paren
and lexical_var =
  1. | LexicalVar of is_ref * dname
and short_lambda_def = {
  1. sl_modifiers : modifier wrap list;
  2. sl_params : short_lambda_params;
  3. sl_tok : tok option;
  4. sl_body : short_lambda_body;
}
and short_lambda_params =
  1. | SLSingleParam of parameter
  2. | SLParams of parameter comma_list_dots paren
  3. | SLParamsOmitted
and short_lambda_body =
  1. | SLExpr of expr
  2. | SLBody of stmt_and_def list brace
and constant_def = {
  1. cst_toks : tok * tok * tok;
  2. cst_name : ident;
  3. cst_type : hint_type option;
  4. cst_val : static_scalar;
}
and class_def = {
  1. c_attrs : attributes option;
  2. c_type : class_type;
  3. c_name : ident;
  4. c_tparams : type_params option;
  5. c_extends : extend option;
  6. c_implements : interface option;
  7. c_enum_type : enum_type option;
  8. c_body : class_stmt list brace;
}
and class_type =
  1. | ClassRegular of tok
  2. | ClassAbstractFinal of tok * tok * tok
  3. | ClassFinal of tok * tok
  4. | ClassAbstract of tok * tok
  5. | Interface of tok
  6. | Trait of tok
  7. | Enum of tok
and extend = tok * class_name
and interface = tok * class_name comma_list
and class_stmt =
  1. | ClassConstants of tok option * tok * hint_type option * class_constant comma_list * tok
  2. | ClassVariables of class_var_modifier * hint_type option * class_variable comma_list * tok
  3. | Method of method_def
  4. | XhpDecl of xhp_decl
  5. | UseTrait of tok * class_name comma_list * (tok, trait_rule list brace) Common.either
  6. | TraitConstraint of tok * trait_constraint_kind wrap * hint_type * tok
  7. | ClassType of type_def
and class_constant = ident * static_scalar_affect option
and class_variable = dname * static_scalar_affect option
and class_var_modifier =
  1. | NoModifiers of tok
  2. | VModifiers of modifier wrap list
and method_def = func_def
and modifier =
  1. | Public
  2. | Private
  3. | Protected
  4. | Static
  5. | Abstract
  6. | Final
  7. | Async
and xhp_decl =
  1. | XhpAttributesDecl of tok * xhp_attribute_decl comma_list * tok
  2. | XhpChildrenDecl of tok * xhp_children_decl * tok
  3. | XhpCategoriesDecl of tok * xhp_category_decl comma_list * tok
and xhp_attribute_decl =
  1. | XhpAttrInherit of xhp_tag wrap
  2. | XhpAttrDecl of xhp_attribute_type * xhp_attr_name * xhp_value_affect option * tok option
and xhp_attribute_type =
  1. | XhpAttrType of hint_type
  2. | XhpAttrVar of tok
  3. | XhpAttrEnum of tok * constant comma_list brace
and xhp_value_affect = tok * static_scalar
and xhp_children_decl =
  1. | XhpChild of xhp_tag wrap
  2. | XhpChildCategory of xhp_tag wrap
  3. | XhpChildAny of tok
  4. | XhpChildEmpty of tok
  5. | XhpChildPcdata of tok
  6. | XhpChildSequence of xhp_children_decl * tok * xhp_children_decl
  7. | XhpChildAlternative of xhp_children_decl * tok * xhp_children_decl
  8. | XhpChildMul of xhp_children_decl * tok
  9. | XhpChildOption of xhp_children_decl * tok
  10. | XhpChildPlus of xhp_children_decl * tok
  11. | XhpChildParen of xhp_children_decl paren
and xhp_category_decl = xhp_tag wrap
and trait_rule =
  1. | InsteadOf of name * tok * ident * tok * class_name comma_list * tok
  2. | As of (ident, name * tok * ident) Common.either * tok * modifier wrap list * ident option * tok
and trait_constraint_kind =
  1. | MustExtend
  2. | MustImplement
and enum_type = {
  1. e_tok : tok;
  2. e_base : hint_type;
  3. e_constraint : (tok * hint_type) option;
}
and type_def = {
  1. t_tok : tok;
  2. t_name : ident;
  3. t_tparams : type_params option;
  4. t_tconstraint : (tok * hint_type) option;
  5. t_tokeq : tok;
  6. t_kind : type_def_kind;
  7. t_sc : tok;
}
and type_def_kind =
  1. | Alias of hint_type
  2. | Newtype of hint_type
  3. | ClassConstType of hint_type option
and global_var =
  1. | GlobalVar of dname
  2. | GlobalDollar of tok * r_variable
  3. | GlobalDollarExpr of tok * expr brace
and static_var = dname * static_scalar_affect option
and static_scalar_affect = tok * static_scalar
and namespace_use_rule =
  1. | ImportNamespace of qualified_ident
  2. | AliasNamespace of qualified_ident * tok * ident
and attribute =
  1. | Attribute of string wrap
  2. | AttributeWithArgs of string wrap * static_scalar comma_list paren
and attributes = attribute comma_list angle
and toplevel =
  1. | StmtList of stmt list
  2. | FuncDef of func_def
  3. | ClassDef of class_def
  4. | ConstantDef of constant_def
  5. | TypeDef of type_def
  6. | NamespaceDef of tok * qualified_ident * tok
  7. | NamespaceBracketDef of tok * qualified_ident option * toplevel list brace
  8. | NamespaceUse of tok * namespace_use_rule comma_list * tok
  9. | NotParsedCorrectly of tok list
  10. | FinalDef of tok
and program = toplevel list
type entity =
  1. | FunctionE of func_def
  2. | ClassE of class_def
  3. | ConstantE of constant_def
  4. | TypedefE of type_def
  5. | StmtListE of stmt list
  6. | MethodE of method_def
  7. | ClassConstantE of class_constant
  8. | ClassVariableE of class_variable * modifier list
  9. | XhpAttrE of xhp_attribute_decl
  10. | MiscE of tok list
type any =
  1. | Expr of expr
  2. | Stmt2 of stmt
  3. | StmtAndDefs of stmt_and_def list
  4. | Toplevel of toplevel
  5. | Program of program
  6. | Entity of entity
  7. | Argument of argument
  8. | Arguments of argument comma_list
  9. | Parameter of parameter
  10. | Parameters of parameter comma_list_dots paren
  11. | Body of stmt_and_def list brace
  12. | ClassStmt of class_stmt
  13. | ClassConstant2 of class_constant
  14. | ClassVariable of class_variable
  15. | ListAssign of list_assign
  16. | ColonStmt2 of colon_stmt
  17. | Case2 of case
  18. | XhpAttribute of xhp_attribute
  19. | XhpAttrValue of xhp_attr_value
  20. | XhpHtml2 of xhp_html
  21. | XhpChildrenDecl2 of xhp_children_decl
  22. | Info of tok
  23. | InfoList of tok list
  24. | Ident2 of ident
  25. | Hint2 of hint_type
val noScope : unit -> Scope_code.t ref
val fakeInfo : ?next_to:(Parse_info.token_location * int) option -> string -> Parse_info.token_mutable
val unwrap : ('a * 'b) -> 'a
val unparen : ('a * 'b * 'c) -> 'b
val unbrace : ('a * 'b * 'c) -> 'b
val unbracket : ('a * 'b * 'c) -> 'b
val uncomma : ('a, 'b) Common.either list -> 'a list
val uncomma_dots : ('a, 'b, 'b) Common.either3 list -> 'a list
val unarg : argument -> expr
val unargs : (argument, 'a) Common.either list -> expr list * w_variable list
val unmodifiers : class_var_modifier -> modifier list
val map_paren : ('a -> 'b) -> ('c * 'a * 'd) -> 'c * 'b * 'd
val map_comma_list : ('a -> 'b) -> ('a, 'c) Common.either list -> ('b, 'c) Common.either list
val str_of_ident : ident -> string
val info_of_ident : ident -> tok
val str_of_dname : dname -> string
val info_of_dname : dname -> tok
val info_of_qualified_ident : qualified_ident_element list -> tok
val info_of_name : name -> tok
exception TodoNamespace of tok
val str_of_name : name -> string
val str_of_name_namespace : name -> string
val name_of_class_name : hint_type -> name
val str_of_class_name : hint_type -> string
val ident_of_class_name : hint_type -> ident
OCaml

Innovation. Community. Security.