Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Semantic parser for PHP 5.5+ from CEDET Contrib (Steven Remót's version). Uses `ede-php-autoload`.
;;; wisent-php-wy.el --- Generated parser support file
;; Copyright (C) 2008 Free Software Foundation
;; Author: Andrea Turso <trashofmasters@gmail.com>
;; Created: 2015-06-20 11:43:24+0100
;; Keywords: syntax
;; X-RCS: $Id$
;; This file is not part of GNU Emacs.
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;; This software is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; PLEASE DO NOT MANUALLY EDIT THIS FILE! It is automatically
;; generated from the grammar file wisent-php.wy.
;;; History:
;;
;;; Code:
(require 'semantic/lex)
(eval-when-compile (require 'semantic/bovine))
;;; Prologue
;;
(declare-function wisent-php-create-container-tag "wisent-php")
(declare-function wisent-php-get-container-tags "wisent-php")
;;; Declarations
;;
(defconst wisent-php-wy--keyword-table
(semantic-lex-make-keyword-table
'(("exit" . T_EXIT)
("die" . T_EXIT)
("function" . T_FUNCTION)
("const" . T_CONST)
("return" . T_RETURN)
("try" . T_TRY)
("catch" . T_CATCH)
("throw" . T_THROW)
("if" . T_IF)
("elseif" . T_ELSEIF)
("endif" . T_ENDIF)
("else" . T_ELSE)
("while" . T_WHILE)
("endwhile" . T_ENDWHILE)
("do" . T_DO)
("for" . T_FOR)
("endfor" . T_ENDFOR)
("foreach" . T_FOREACH)
("endforeach" . T_ENDFOREACH)
("declare" . T_DECLARE)
("enddeclare" . T_ENDDECLARE)
("instanceof" . T_INSTANCEOF)
("int" . INT)
("as" . T_AS)
("switch" . T_SWITCH)
("endswitch" . T_ENDSWITCH)
("case" . T_CASE)
("default" . T_DEFAULT)
("break" . T_BREAK)
("continue" . T_CONTINUE)
("echo" . T_ECHO)
("print" . T_PRINT)
("namespace" . T_NAMESPACE)
("class" . T_CLASS)
("interface" . T_INTERFACE)
("extends" . T_EXTENDS)
("implements" . T_IMPLEMENTS)
("new" . T_NEW)
("package" . PACKAGE)
("clone" . T_CLONE)
("var" . T_VAR)
("eval" . T_EVAL)
("include" . T_INCLUDE)
("include_once" . T_INCLUDE_ONCE)
("require" . T_REQUIRE)
("require_once" . T_REQUIRE_ONCE)
("use" . T_USE)
("global" . T_GLOBAL)
("isset" . T_ISSET)
("empty" . T_EMPTY)
("__halt_compiler" . T_HALT_COMPILER)
("static" . T_STATIC)
("abstract" . T_ABSTRACT)
("final" . T_FINAL)
("private" . T_PRIVATE)
("protected" . T_PROTECTED)
("public" . T_PUBLIC)
("unset" . T_UNSET)
("list" . T_LIST)
("array" . T_ARRAY)
("or" . T_LOGICAL_OR)
("and" . T_LOGICAL_AND)
("xor" . T_LOGICAL_XOR)
("__CLASS__" . T_CLASS_C)
("__FUNCTION__" . T_FUNC_C)
("__METHOD__" . T_METHOD_C)
("__LINE__" . T_LINE)
("__FILE__" . T_FILE)
("@author" . _AUTHOR)
("@version" . _VERSION)
("@param" . _PARAM)
("@return" . _RETURN)
("@exception" . _EXCEPTION)
("@throws" . _THROWS)
("@see" . _SEE)
("@since" . _SINCE)
("@serial" . _SERIAL)
("@serialData" . _SERIALDATA)
("@serialField" . _SERIALFIELD)
("@deprecated" . _DEPRECATED))
'(("@deprecated" phpdoc
(seq 12 usage
(type function variable)
opt t))
("@serialField" phpdoc
(seq 11 usage
(variable)
opt t))
("@serialData" phpdoc
(seq 10 usage
(function)
opt t))
("@serial" phpdoc
(seq 9 usage
(variable)
opt t))
("@since" phpdoc
(seq 8 usage
(type function variable)
opt t))
("@see" phpdoc
(seq 7 usage
(type function variable)
opt t with-ref t))
("@throws" phpdoc
(seq 6 usage
(function)
with-name t))
("@exception" phpdoc
(seq 5 usage
(function)
with-name t))
("@return" phpdoc
(seq 4 usage
(function)))
("@param" phpdoc
(seq 3 usage
(function)
with-name t))
("@version" phpdoc
(seq 2 usage
(type)))
("@author" phpdoc
(seq 1 usage
(type)))
("public" summary "Access level modifier: public {class|interface|<type>} <name> ...")
("protected" summary "Access level modifier: protected {class|interface|<type>} <name> ...")
("private" summary "Access level modifier: private {class|interface|<type>} <name> ...")
("final" summary "Class|Member declaration modifier: final {class|<type>} <name> ...")
("abstract" summary "Class|Method declaration modifier: abstract {class|<type>} <name> ...")
("static" summary "Declaration modifier: static {class|interface|<type>} <name> ...")
("use" summary "Alias definition: use <imported> {as <name>}")
("implements" summary "Class SuperInterfaces declaration: implements <name> [, ...]")
("extends" summary "SuperClass|SuperInterfaces declaration: extends <name> [, ...]")
("interface" summary "Interface declaration: interface <name>")
("class" summary "Class declaration: class <name>")
("namespace" summary "Namespace declaration: namespace <name>")
("continue" summary "continue [<label>] ;")
("break" summary "break [<label>] ;")
("default" summary "switch(<expr>) { ... default: <stmts>}")
("case" summary "switch(<expr>) {case <const-expr>: <stmts> ... }")
("for" summary "for ([<init-expr>]; [<expr>]; [<update-expr>]) <stmt>")
("do" summary "do <stmt> while (<expr>);")
("while" summary "while (<expr>) <stmt> | do <stmt> while (<expr>);")
("else" summary "if (<expr>) <stmt> else <stmt>")
("if" summary "if (<expr>) <stmt> [else <stmt>]")
("catch" summary "try {<stmts>} catch(<parm>) {<stmts>} ... ")
("try" summary "try {<stmts>} [catch(<parm>) {<stmts>} ...] [finally {<stmts>}]")
("return" summary "return [<expr>] ;")
("const" summary "const <var> [= <expr>]")))
"Table of language keywords.")
(defconst wisent-php-wy--token-table
(semantic-lex-make-type-table
'(("<no-type>"
(T_IF)
(T_EXIT))
("code"
(EPILOGUE)
(PROLOGUE))
("number"
(NUMBER_LITERAL))
("string"
(STRING_LITERAL))
("variable"
(T_VARIABLE))
("symbol"
(IDENTIFIER))
("punctuation"
(T_NAMESPACE_SEP . "\\")
(T_ASTERISK . "@")
(T_COMP . "~")
(T_OR . "|")
(T_XOR . "^")
(T_QUESTION . "?")
(T_URSHIFTEQ . ">>>=")
(T_URSHIFT . ">>>")
(T_GT . ">")
(T_EQ . "=")
(T_LT . "<")
(T_SEMI . ";")
(T_COLON . ":")
(T_DIV . "/")
(T_DOT . ".")
(T_MINUS . "-")
(T_COMMA . ",")
(T_PLUS . "+")
(T_MULT . "*")
(T_AND . "&")
(T_MOD . "%")
(T_NOT . "!")
(T_HEREDOC . "<<<")
(T_DOUBLE_ARROW . "=>")
(T_SR . ">>")
(T_SL . "<<")
(T_BOOLEAN_AND . "&&")
(T_BOOLEAN_OR . "||")
(T_XOR_EQUAL . "^=")
(T_OR_EQUAL . "|=")
(T_AND_EQUAL . "&=")
(T_SR_EQUAL . ">>=")
(T_SL_EQUAL . "<<=")
(T_MOD_EQUAL . "%=")
(T_CONCAT_EQUAL . ".=")
(T_DIV_EQUAL . "/=")
(T_MUL_EQUAL . "*=")
(T_MINUS_EQUAL . "-=")
(T_PLUS_EQUAL . "+=")
(T_IS_GREATER_OR_EQUAL . ">=")
(T_IS_SMALLER_OR_EQUAL . "<=")
(T_IS_NOT_EQUAL . "<>")
(T_IS_NOT_EQUAL . "!=")
(T_IS_EQUAL . "==")
(T_IS_NOT_IDENTICAL . "!==")
(T_IS_IDENTICAL . "===")
(T_DEC . "--")
(T_INC . "++")
(T_PAAMAYIM_NEKUDOTAYIM . "::")
(T_DEREF . "->"))
("close-paren"
(RBRACK . "]")
(RBRACE . "}")
(RPAREN . ")"))
("open-paren"
(LBRACK . "[")
(LBRACE . "{")
(LPAREN . "("))
("block"
(BRACK_BLOCK . "(LBRACK RBRACK)")
(BRACE_BLOCK . "(LBRACE RBRACE)")
(PAREN_BLOCK . "(LPAREN RPAREN)")))
'(("keyword" :declared t)
("code" :declared t)
("number" :declared t)
("string" :declared t)
("variable" syntax "\\$\\(\\sw\\|\\s_\\)+")
("variable" :declared t)
("symbol" syntax "[a-zA-Z_]\\(\\sw\\|\\s_\\)*")
("symbol" :declared t)
("punctuation" syntax "\\(\\s.\\|\\s'\\)+")
("punctuation" matchdatatype string)
("punctuation" :declared t)
("block" :declared t)))
"Table of lexical tokens.")
(defconst wisent-php-wy--parse-table
(progn
(eval-when-compile
(require 'semantic/wisent/comp))
(wisent-compile-grammar
'((PAREN_BLOCK BRACE_BLOCK BRACK_BLOCK LPAREN RPAREN LBRACE RBRACE LBRACK RBRACK T_DEREF T_PAAMAYIM_NEKUDOTAYIM T_INC T_DEC T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_IS_EQUAL T_IS_NOT_EQUAL T_IS_SMALLER_OR_EQUAL T_IS_GREATER_OR_EQUAL T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_SL_EQUAL T_SR_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_BOOLEAN_OR T_BOOLEAN_AND T_SL T_SR T_DOUBLE_ARROW T_HEREDOC T_NOT T_MOD T_AND T_MULT T_PLUS T_COMMA T_MINUS T_DOT T_DIV T_COLON T_SEMI T_LT T_EQ T_GT T_URSHIFT T_URSHIFTEQ T_QUESTION T_XOR T_OR T_COMP T_ASTERISK T_NAMESPACE_SEP IDENTIFIER T_VARIABLE STRING_LITERAL NUMBER_LITERAL PROLOGUE EPILOGUE T_EXIT T_FUNCTION T_CONST T_RETURN T_TRY T_CATCH T_THROW T_IF T_ELSEIF T_ENDIF T_ELSE T_WHILE T_ENDWHILE T_DO T_FOR T_ENDFOR T_FOREACH T_ENDFOREACH T_DECLARE T_ENDDECLARE T_INSTANCEOF INT T_AS T_SWITCH T_ENDSWITCH T_CASE T_DEFAULT T_BREAK T_CONTINUE T_ECHO T_PRINT T_NAMESPACE T_CLASS T_INTERFACE T_EXTENDS T_IMPLEMENTS T_NEW PACKAGE T_CLONE T_VAR T_EVAL T_INCLUDE T_INCLUDE_ONCE T_REQUIRE T_REQUIRE_ONCE T_USE T_GLOBAL T_ISSET T_EMPTY T_HALT_COMPILER T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC T_UNSET T_LIST T_ARRAY T_LOGICAL_OR T_LOGICAL_AND T_LOGICAL_XOR T_CLASS_C T_FUNC_C T_METHOD_C T_LINE T_FILE _AUTHOR _VERSION _PARAM _RETURN _EXCEPTION _THROWS _SEE _SINCE _SERIAL _SERIALDATA _SERIALFIELD _DEPRECATED)
((left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE)
(left T_COMMA)
(left T_LOGICAL_OR)
(left T_LOGICAL_XOR)
(left T_LOGICAL_AND)
(right T_PRINT)
(left T_EQ T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL)
(left T_QUESTION T_COLON)
(left T_BOOLEAN_OR)
(left T_BOOLEAN_AND)
(left T_OR)
(left T_XOR)
(left T_AND)
(nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL)
(nonassoc T_LT T_IS_SMALLER_OR_EQUAL 62 T_IS_GREATER_OR_EQUAL)
(left T_SL T_SR)
(left T_PLUS T_MINUS T_DOT)
(left T_MULT T_DIV T_MOD)
(right T_NOT)
(nonassoc T_INSTANCEOF)
(right T_COMP T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST T_ASTERISK)
(right LBRACK)
(nonassoc T_NEW T_CLONE)
(left T_ELSEIF)
(left T_ELSE)
(left T_ENDIF))
(start
((PROLOGUE compilation_units EPILOGUE)
(identity $2))
((PROLOGUE compilation_units)
(identity $2)))
(compilation_units
((T_NAMESPACE namespaced_identifier T_SEMI compilation_units)
(wisent-raw-tag
(semantic-tag-new-type $2 $1
(wisent-cook-tag $4)
nil)))
((compilation_unit compilation_units)
(wisent-php-create-container-tag $2 $1))
(nil
(wisent-php-create-container-tag)))
(compilation_unit
((include_declaration))
((type_declaration)))
(include_declaration
((T_REQUIRE require_expr T_SEMI)
(identity $2))
((T_REQUIRE_ONCE require_expr T_SEMI)
(identity $2))
((T_INCLUDE require_expr T_SEMI)
(identity $2))
((T_INCLUDE_ONCE require_expr T_SEMI)
(identity $2)))
(require_expr
((STRING_LITERAL)
(wisent-raw-tag
(semantic-tag-new-include $1 nil)))
((PAREN_BLOCK)
(wisent-raw-tag
(semantic-tag-new-include $1 nil))))
(type_declaration
((function_declaration))
((class_declaration))
((interface_declaration))
((namespace_declaration))
((use_statement)))
(class_declaration
((class_modifiers_opt T_CLASS IDENTIFIER superc_opt interfaces_opt class_body)
(wisent-raw-tag
(semantic-tag-new-type $3 $2 $6
(if
(or $4 $5)
(cons $4 $5))
:typemodifiers $1))))
(superc_opt
(nil)
((T_EXTENDS namespaced_identifier)
(identity $2)))
(interfaces_opt
(nil)
((T_IMPLEMENTS identifier_list)
(nreverse $2)))
(class_body
((BRACE_BLOCK)
(semantic-parse-region
(car $region1)
(cdr $region1)
'class_member_declaration 1)))
(class_member_declaration
((LBRACE)
nil)
((RBRACE)
nil)
((block)
nil)
((interface_declaration))
((class_declaration))
((method_declaration))
((field_declaration))
((constant_declaration)))
(namespace_declaration
((T_NAMESPACE namespaced_identifier namespace_body)
(wisent-raw-tag
(semantic-tag-new-type $2 $1 $3 nil))))
(namespace_body
((BRACE_BLOCK)
(semantic-parse-region
(car $region1)
(cdr $region1)
'compilation_unit 1)))
(use_statement
((T_USE use_declarations T_SEMI)
(identity $2)))
(use_declarations
((use_declaration T_COMMA use_declarations)
(wisent-php-create-container-tag $1 $3))
((use_declaration)
(wisent-php-create-container-tag $1)))
(use_declaration
((namespaced_identifier T_AS IDENTIFIER)
(wisent-raw-tag
(semantic-tag-new-alias $3 "alias" $1)))
((namespaced_identifier)
(wisent-raw-tag
(semantic-tag-new-alias
(car
(last
(split-string $1 "\\\\")))
"alias" $1))))
(interface_declaration
((class_modifiers_opt T_INTERFACE IDENTIFIER extends_interfaces_opt interface_body)
(wisent-raw-tag
(semantic-tag-new-type $3 $2 $5
(if $4
(cons nil $4))
:typemodifiers $1))))
(extends_interfaces_opt
(nil)
((T_EXTENDS identifier_list)
(identity $2)))
(interface_body
((BRACE_BLOCK)
(semantic-parse-region
(car $region1)
(cdr $region1)
'interface_member_declaration 1)))
(interface_member_declaration
((LBRACE)
nil)
((RBRACE)
nil)
((interface_declaration))
((class_declaration))
((method_declaration))
((field_declaration))
((constant_declaration)))
(function_declaration
((method_declarator method_body)
(wisent-raw-tag
(semantic-tag-new-function
(car $1)
nil
(cdr $1)
:local-variables
(semantic-parse-region
(car $region2)
(cdr $region2)
'instruction 1)))))
(method_declaration
((method_modifiers_opt method_declarator method_body)
(wisent-raw-tag
(semantic-tag-new-function
(car $2)
nil
(cdr $2)
:typemodifiers $1 :constructor-flag
(string=
(car $2)
"__construct")
:local-variables $3))))
(method_declarator
((T_FUNCTION reference_opt IDENTIFIER formal_parameter_list)
(cons $3 $4)))
(identifier_list
((identifier_list T_COMMA namespaced_identifier)
(cons $3 $1))
((namespaced_identifier)
(list $1)))
(method_body
((T_SEMI))
((block)))
(block
((BRACE_BLOCK)
(semantic-parse-region
(car $region1)
(cdr $region1)
'instruction 1)))
(formal_parameter_list
((PAREN_BLOCK)
(semantic-parse-region
(car $region1)
(cdr $region1)
'formal_parameters 1)))
(formal_parameters
((LPAREN)
nil)
((RPAREN)
nil)
((formal_parameter T_COMMA))
((formal_parameter RPAREN)))
(formal_parameter
((type_opt T_VARIABLE T_EQ expression)
(wisent-raw-tag
(semantic-tag-new-variable $2 $1 $region4)))
((type_opt T_VARIABLE)
(wisent-raw-tag
(semantic-tag-new-variable $2 $1 nil))))
(type_opt
(nil)
((T_ARRAY))
((namespaced_identifier)))
(field_declaration
((field_modifiers_opt variable_declarator T_SEMI)
(wisent-raw-tag
(semantic-tag-new-variable
(car $2)
nil
(cdr $2)
:typemodifiers
(cons "attribute" $1)))))
(variable_declarator
((T_VARIABLE T_EQ variable_initializer)
(cons $1 $3))
((T_VARIABLE)
(cons $1 nil)))
(constant_declaration
((T_CONST IDENTIFIER T_EQ variable_initializer T_SEMI)
(wisent-raw-tag
(semantic-tag-new-variable $2 nil $region3 :typemodifiers
(list "static" "public")
:constant-flag t))))
(reference_opt
(nil)
((T_AND)))
(variable_initializer
((expression)))
(instruction
((foreach_statement))
((if_statement))
((expression T_SEMI)
(identity $1))
((BRACE_BLOCK)
(wisent-php-create-container-tag
(semantic-parse-region
(car $region1)
(cdr $region1)
'instruction 1))))
(assignment
((T_VARIABLE assignment_operator variable_initializer)
(wisent-raw-tag
(semantic-tag-new-variable $1
(if
(semantic-tag-p $3)
(semantic-tag-name $3)
"")
$region3))))
(if_statement
((T_IF PAREN_BLOCK instruction)
(wisent-php-create-container-tag $3)))
(elseif_opt
((T_ELSEIF PAREN_BLOCK instruction elseif_opt)
(wisent-php-create-container-tag $3 $4))
((T_ELSE instruction)
(wisent-php-create-container-tag $2)))
(foreach_statement
((T_FOREACH PAREN_BLOCK instruction)
(wisent-php-create-container-tag
(semantic-parse-region
(car $region2)
(cdr $region2)
'foreach_args 1)
$3)))
(foreach_args
((term T_AS foreach_var)
(wisent-php-create-container-tag
(wisent-cook-tag $3)))
((term T_AS foreach_var T_DOUBLE_ARROW foreach_var)
(wisent-php-create-container-tag
(wisent-cook-tag $3)
(wisent-cook-tag $5))))
(foreach_var
((T_VARIABLE)
(wisent-raw-tag
(semantic-tag-new-variable $1 "" ""))))
(expression
((assignment))
((instanciation)
(identity $1))
((expression term))
((term)))
(term
((literal))
((operator))
((IDENTIFIER))
((namespaced_identifier))
((T_VARIABLE))
((BRACK_BLOCK))
((PAREN_BLOCK))
((T_NEW))
((T_CLONE))
((T_ARRAY)
(identity $1))
((BRACE_BLOCK)
(wisent-php-create-container-tag
(semantic-parse-region
(car $region1)
(cdr $region1)
'instruction 1))))
(instanciation
((T_NEW namespaced_identifier)
(wisent-raw-tag
(semantic-tag-new-type $2 "class" 'nil 'nil)))
((T_NEW namespaced_identifier PAREN_BLOCK)
(wisent-raw-tag
(semantic-tag-new-type $2 "class" 'nil 'nil))))
(namespaced_identifier
((T_NAMESPACE_SEP namespaced_identifier)
(concat "\\" $2))
((IDENTIFIER T_NAMESPACE_SEP namespaced_identifier)
(concat $1 "\\" $3))
((IDENTIFIER)))
(literal
((STRING_LITERAL))
((NUMBER_LITERAL)))
(assignment_operator
((T_PLUS_EQUAL))
((T_MINUS_EQUAL))
((T_MUL_EQUAL))
((T_DIV_EQUAL))
((T_CONCAT_EQUAL))
((T_MOD_EQUAL))
((T_SL_EQUAL))
((T_SR_EQUAL))
((T_AND_EQUAL))
((T_OR_EQUAL))
((T_XOR_EQUAL))
((T_EQ)))
(operator
((T_DEREF))
((T_PAAMAYIM_NEKUDOTAYIM))
((T_INC))
((T_DEC))
((T_IS_IDENTICAL))
((T_IS_NOT_IDENTICAL))
((T_IS_EQUAL))
((T_IS_NOT_EQUAL))
((T_IS_NOT_EQUAL))
((T_IS_SMALLER_OR_EQUAL))
((T_IS_GREATER_OR_EQUAL))
((T_BOOLEAN_OR))
((T_BOOLEAN_AND))
((T_SL))
((T_SR))
((T_DOUBLE_ARROW))
((T_HEREDOC))
((T_NOT))
((T_MOD))
((T_AND))
((T_MULT))
((T_PLUS))
((T_COMMA))
((T_MINUS))
((T_DOT))
((T_DIV))
((T_COLON))
((T_LT))
((T_GT))
((T_URSHIFT))
((T_URSHIFTEQ))
((T_QUESTION))
((T_XOR))
((T_OR))
((T_COMP))
((T_ASTERISK))
((T_LIST))
((T_ARRAY))
((T_LOGICAL_OR))
((T_LOGICAL_AND))
((T_LOGICAL_XOR))
((assignment_operator)))
(class_modifiers_opt
(nil)
((class_modifiers)
(nreverse $1)))
(class_modifiers
((class_modifiers class_modifier)
(cons $2 $1))
((class_modifier)
(list $1)))
(class_modifier
((T_FINAL))
((T_ABSTRACT)))
(method_modifiers_opt
(nil)
((method_modifiers)
(nreverse $1)))
(method_modifiers
((method_modifiers method_modifier)
(cons $2 $1))
((method_modifier)
(list $1)))
(method_modifier
((T_FINAL))
((T_ABSTRACT))
((T_STATIC))
((T_PRIVATE))
((T_PROTECTED))
((T_PUBLIC)))
(field_modifiers_opt
(nil)
((field_modifiers)
(nreverse $1)))
(field_modifiers
((field_modifiers field_modifier)
(cons $2 $1))
((field_modifier)
(list $1)))
(field_modifier
((method_modifier))
((T_VAR)))
(dims_opt
(nil
(identity ""))
((dims)))
(dims
((dims BRACK_BLOCK)
(concat $1 "[]"))
((BRACK_BLOCK)
(identity "[]"))))
'(start compilation_units compilation_unit include_declaration require_expr use_statement type_declaration class_declaration class_body class_member_declaration namespace_declaration namespace_body interface_declaration interface_body interface_member_declaration method_declaration method_declarator identifier_list method_body block formal_parameter_list formal_parameters formal_parameter field_declaration variable_declarator constant_declaration variable_initializer class_modifiers class_modifier method_modifiers method_modifier field_modifiers field_modifier instruction foreach_args)))
"Parser table.")
(defun wisent-php-wy--install-parser ()
"Setup the Semantic Parser."
(semantic-install-function-overrides
'((parse-stream . wisent-parse-stream)))
(setq semantic-parser-name "LALR"
semantic--parse-table wisent-php-wy--parse-table
semantic-debug-parser-source #("wisent-php.wy" 0 13 (help-echo "Mouse-2 toggles maximizing, mouse-3 displays a popup-menu"))
semantic-flex-keywords-obarray wisent-php-wy--keyword-table
semantic-lex-types-obarray wisent-php-wy--token-table)
;; Collect unmatched syntax lexical tokens
(semantic-make-local-hook 'wisent-discarding-token-functions)
(add-hook 'wisent-discarding-token-functions
'wisent-collect-unmatched-syntax nil t))
;;; Analyzers
;;
(define-lex-block-type-analyzer wisent-php-wy--<block>-block-analyzer
"block analyzer for <block> tokens."
"\\s(\\|\\s)"
'((("(" LPAREN PAREN_BLOCK)
("{" LBRACE BRACE_BLOCK)
("[" LBRACK BRACK_BLOCK))
(")" RPAREN)
("}" RBRACE)
("]" RBRACK))
)
(define-lex-string-type-analyzer wisent-php-wy--<punctuation>-string-analyzer
"string analyzer for <punctuation> tokens."
"\\(\\s.\\|\\s'\\)+"
'((T_NAMESPACE_SEP . "\\")
(T_ASTERISK . "@")
(T_COMP . "~")
(T_OR . "|")
(T_XOR . "^")
(T_QUESTION . "?")
(T_URSHIFTEQ . ">>>=")
(T_URSHIFT . ">>>")
(T_GT . ">")
(T_EQ . "=")
(T_LT . "<")
(T_SEMI . ";")
(T_COLON . ":")
(T_DIV . "/")
(T_DOT . ".")
(T_MINUS . "-")
(T_COMMA . ",")
(T_PLUS . "+")
(T_MULT . "*")
(T_AND . "&")
(T_MOD . "%")
(T_NOT . "!")
(T_HEREDOC . "<<<")
(T_DOUBLE_ARROW . "=>")
(T_SR . ">>")
(T_SL . "<<")
(T_BOOLEAN_AND . "&&")
(T_BOOLEAN_OR . "||")
(T_XOR_EQUAL . "^=")
(T_OR_EQUAL . "|=")
(T_AND_EQUAL . "&=")
(T_SR_EQUAL . ">>=")
(T_SL_EQUAL . "<<=")
(T_MOD_EQUAL . "%=")
(T_CONCAT_EQUAL . ".=")
(T_DIV_EQUAL . "/=")
(T_MUL_EQUAL . "*=")
(T_MINUS_EQUAL . "-=")
(T_PLUS_EQUAL . "+=")
(T_IS_GREATER_OR_EQUAL . ">=")
(T_IS_SMALLER_OR_EQUAL . "<=")
(T_IS_NOT_EQUAL . "<>")
(T_IS_NOT_EQUAL . "!=")
(T_IS_EQUAL . "==")
(T_IS_NOT_IDENTICAL . "!==")
(T_IS_IDENTICAL . "===")
(T_DEC . "--")
(T_INC . "++")
(T_PAAMAYIM_NEKUDOTAYIM . "::")
(T_DEREF . "->"))
'punctuation)
(define-lex-regex-type-analyzer wisent-php-wy--<variable>-regexp-analyzer
"regexp analyzer for <variable> tokens."
"\\$\\(\\sw\\|\\s_\\)+"
nil
'T_VARIABLE)
(define-lex-regex-type-analyzer wisent-php-wy--<symbol>-regexp-analyzer
"regexp analyzer for <symbol> tokens."
"[a-zA-Z_]\\(\\sw\\|\\s_\\)*"
nil
'IDENTIFIER)
(define-lex-regex-type-analyzer wisent-php-wy--<number>-regexp-analyzer
"regexp analyzer for <number> tokens."
semantic-lex-number-expression
nil
'NUMBER_LITERAL)
(define-lex-sexp-type-analyzer wisent-php-wy--<string>-sexp-analyzer
"sexp analyzer for <string> tokens."
"\\s\""
'STRING_LITERAL)
(define-lex-keyword-type-analyzer wisent-php-wy--<keyword>-keyword-analyzer
"keyword analyzer for <keyword> tokens."
"\\(\\sw\\|\\s_\\)+")
;;; Epilogue
;;
(defconst semantic-php-number-regexp
(eval-when-compile
(concat "\\("
"\\<[0-9]+[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
"\\|"
"\\<[0-9]+[.][eE][-+]?[0-9]+[fFdD]?\\>"
"\\|"
"\\<[0-9]+[.][fFdD]\\>"
"\\|"
"\\<[0-9]+[.]"
"\\|"
"[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
"\\|"
"\\<[0-9]+[eE][-+]?[0-9]+[fFdD]?\\>"
"\\|"
"\\<0[xX][0-9a-fA-F]+[lL]?\\>"
"\\|"
"\\<[0-9]+[lLfFdD]?\\>"
"\\)"
))
"Lexer regexp to match Java number terminals.
Following is the specification of Java number literals.
DECIMAL_LITERAL:
[1-9][0-9]*
;
HEX_LITERAL:
0[xX][0-9a-fA-F]+
;
OCTAL_LITERAL:
0[0-7]*
;
INTEGER_LITERAL:
<DECIMAL_LITERAL>[lL]?
| <HEX_LITERAL>[lL]?
| <OCTAL_LITERAL>[lL]?
;
EXPONENT:
[eE][+-]?[09]+
;
FLOATING_POINT_LITERAL:
[0-9]+[.][0-9]*<EXPONENT>?[fFdD]?
| [.][0-9]+<EXPONENT>?[fFdD]?
| [0-9]+<EXPONENT>[fFdD]?
| [0-9]+<EXPONENT>?[fFdD]
;")
(defconst wisent-php-label-regex
"[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*")
(defvar wisent-in-php nil
"State variable tracking parsing in/out of PHP code.")
(defun wisent-php--move-to-php-beginning ()
(if (re-search-forward "<[%?]" nil t)
(cond
((or (looking-at "\\(php\\)?$")
(looking-at "\\(php\\)?[[:space:]])"))
(goto-char (match-end 0))
'T_NONPHP)
((or (looking-at "=$")
(looking-at "=[[:space:]]"))
'T_ECHO_BLOCK)
(t
(wisent-php--move-to-php-beginning)))
(goto-char (point-max))
nil))
(define-lex-regex-analyzer wisent-php-lex-prologue
"Detect and create a prologue token."
"<[?%]\\(php\\)?\\([[:space:]]+\\|$\\)"
;; Zing to the end of this brace block.
(let ((start (match-beginning 0))
(end (match-end 0)))
(semantic-lex-push-token
(semantic-lex-token 'PROLOGUE start end))))
(define-lex-regex-analyzer wisent-php-lex-epilogue
"Detect and create an epilogue or percent-percent token."
"[%?]>"
(let ((start (match-beginning 0))
(end (match-end 0)))
(semantic-lex-push-token
(semantic-lex-token 'EPILOGUE start end))))
(define-lex-regex-analyzer wisent-php-lex-heredoc
"Detect and create an epilogue or percent-percent token."
(concat "<<<[[:blank:]]*\\(" wisent-php-label-regex "\\)$")
(let ((start (match-beginning 0))
(end (progn
(re-search-forward (concat "^" (match-string 1) ";") nil t)
(match-end 0))))
(semantic-lex-push-token
(semantic-lex-token 'STRING_LITERAL start end))
(setq semantic-lex-end-point end)))
(define-lex-analyzer wisent-php-lex-out-of-php
"Detect and create python indentation tokens at beginning of line."
(progn
(and wisent-in-php
(looking-at "[[:space:]\n]*[%?]>")
(setq wisent-in-php nil))
(when (not wisent-in-php)
(let ((last-pos (point))
(token (wisent-php--move-to-php-beginning)))
(setq semantic-lex-end-point (point))
(when token
(setq wisent-in-php t)))
;; (semantic-lex-push-token
;; (semantic-lex-token token last-pos (point)))))
t)))
;; Define the lexer for this grammar
(define-lex wisent-php-lexer
"Lexical analyzer that handles php buffers.
It ignores whitespaces, newlines and comments."
semantic-lex-ignore-whitespace
semantic-lex-ignore-newline
semantic-lex-ignore-comments
wisent-php-lex-prologue
wisent-php-lex-epilogue
wisent-php-lex-heredoc
;;;; Auto-generated analyzers.
wisent-php-wy--<number>-regexp-analyzer
wisent-php-wy--<string>-sexp-analyzer
;; Must detect keywords before other symbols
wisent-php-wy--<keyword>-keyword-analyzer
wisent-php-wy--<variable>-regexp-analyzer
wisent-php-wy--<symbol>-regexp-analyzer
wisent-php-wy--<punctuation>-string-analyzer
wisent-php-wy--<block>-block-analyzer
;;;;
semantic-lex-default-action)
;;; wisent-php.wy ends her
(provide 'wisent-php-wy)
;; Local Variables:
;; version-control: never
;; no-update-autoloads: t
;; End:
;;; wisent-php-wy.el ends here
;;; wisent-php.el --- Php LALR parser for Emacs
;; Copyright (C) 2008, 2009 Anonymous
;;
;; NOTE: Original author wished to remian anonymous and did not assign copyright
;; to the FSF.
;; Author: Original code for Java by David Ponce <david@dponce.com>
;; Keywords: syntax
;; This file is not part of GNU Emacs.
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;;
;;; Code:
(require 'semantic/wisent)
(require 'semantic/find)
(require 'semantic/db)
(require 'wisent-php-wy)
(eval-when-compile
(require 'semantic/util)
(require 'semantic/ctxt)
(require 'semantic/imenu)
(require 'semantic/senator))
(require 'semantic/bovine/c)
(require 'ede-php-autoload)
;;;;
;;;; Simple parser error reporting function
;;;;
(defun wisent-php-parse-error (msg)
"Error reporting function called when a parse error occurs.
MSG is the message string to report."
;; (let ((error-start (nth 2 wisent-input)))
;; (if (number-or-marker-p error-start)
;; (goto-char error-start)))
(message msg)
;;(debug)
)
;;;;
;;;; Local context
;;;;
(defun wisent-php-get-in-class-local-variables (tag)
"Return a list of variable tags defined in a class' method.
TAG is a class tag."
(list
(semantic-tag-new-variable "$this" tag)
(semantic-tag-new-variable "static" tag)
(semantic-tag-new-variable "self" tag)
(semantic-tag-new-variable "parent"
(car (semantic-tag-type-superclasses tag)))))
(defun wisent-php-get-in-function-local-variables (tag)
"Return the local variables defined in a function.
TAG is a function tag."
(append
(plist-get (semantic-tag-attributes tag) :local-variables)
(semantic-get-local-arguments)))
(define-mode-local-override semantic-get-local-variables
php-mode ()
"Get local values from a specific context.
Parse the current context for `field_declaration' nonterminals to
collect tags, such as local variables or prototypes.
This function override `get-local-variables'.
Add `$this', `static' and `self' if needed"
(let ((vars '())
;; We want nothing to do with funny syntaxing while doing this.
(semantic-unmatched-syntax-hook nil)
(tags (semantic-find-tag-by-overlay)))
(dolist (tag tags vars)
(cond
((wisent-php-is-tag-class-like? tag)
(setq vars (append (wisent-php-get-in-class-local-variables tag) vars)))
((equal 'function (semantic-tag-class tag))
(setq vars (append (wisent-php-get-in-function-local-variables tag) vars)))))))
;;;;
;;;; Member protection
;;;;
(define-mode-local-override semantic-tag-protection
php-mode (tag &optional parent)
"Return protection information about TAG with optional parent."
(let ((type-modifiers (semantic-tag-modifiers tag))
(protection nil))
(while (and type-modifiers (not protection))
(let ((modifier (car type-modifiers)))
(setq protection
(cond ((string= "private" modifier)
'private)
((string= "protected" modifier)
'protected)
((string= "public" modifier)
'public)
(t nil))))
(setq type-modifiers (cdr type-modifiers)))
(or protection 'public)))
(define-mode-local-override semantic-find-tags-by-scope-protection
php-mode (scopeprotection parent &optional table)
"Find all tags accessible by SCOPEPROTECTION.
SCOPEPROTECTION is a symbol which can be returned by the method
`semantic-tag-protection'. A hard-coded order is used to determine a match.
PARENT is a tag representing the PARENT slot needed for
`semantic-tag-protection'.
TABLE is a list of tags (a subset of PARENT members) to scan. If TABLE is nil,
the type members of PARENT are used.
See `semantic-tag-protected-p' for details on which tags are returned.
This implementation is just there to override `semantic-find-tags-by-scope-protection-c-mode'."
(semantic-find-tags-by-scope-protection-default scopeprotection parent table))
;;;;
;;;; Name splitting / unsplitting
;;;;
(define-mode-local-override semantic-analyze-split-name
php-mode (name)
"Split a tag NAME into a sequence.
Sometimes NAMES are gathered from the parser that are componded.
In PHP, \"foo\bar\" means :
\"The class BAR in the namespace FOO.\"
Return the string NAME for no change, or a list if it needs to be split."
(let ((ans (split-string name (regexp-quote "\\"))))
(if (= (length ans) 1)
name
(delete "" ans))))
(define-mode-local-override semantic-analyze-unsplit-name
php-mode (namelist)
"Assemble a NAMELIST into a string representing a compound name.
In PHP, (\"foo\" \"bar\") becomes \"foo\\bar\"."
(mapconcat 'identity namelist "\\"))
;;;;
;;;; Tag scoping
;;;;
(defun wisent-php-import-file-content-for-class (project class-name)
"Import the tags in the file that defines a certain class.
PROJECT is the ede php project in which class is defined.
CLASS-NAME is the name of the class.
Return nil if it could not find the file or if the file was the current file."
(let ((file (ede-php-autoload-find-class-def-file project class-name)))
(when (and file (not (string= file (buffer-file-name))))
(find-file-noselect file)
(semanticdb-file-stream file))))
(defun wisent-php-is-tag-class-like? (tag)
"Return non-nil if a tag is a PHP class or interface, nil otherwise."
(and (equal 'type (semantic-tag-class tag))
(member (semantic-tag-type tag) '("class" "interface"))))
(defun wisent-php-is-tag-alias? (tag)
"Return non-nil if a tag is a PHP alias, nil otherwise."
(and (equal 'type (semantic-tag-class tag))
(string= (semantic-tag-type tag) "use")))
(defun wisent-php-is-tag-namespace? (tag)
"Return non-nil if a tag is a PHP namespace, nil otherwise."
(and (equal 'type (semantic-tag-class tag))
(string= (semantic-tag-type tag) "namespace")))
(defun wisent-php-get-full-name (name namespace-prefix)
"Return the full name of the type NAME.
if NAME is absolute, just return NAME.
Otherwise, prefix it with NAMESPACE-PREFIX."
(if (= (aref name 0) ?\\)
name
(concat namespace-prefix "\\" name)))
(defun wisent-php-get-tag-namespace-prefix (tag)
"Return the namespace prefix for TAG.
It implies looking at TAG's parents to find a namespace and
returning its name."
(catch 'prefix
(while tag
(when (wisent-php-is-tag-namespace? tag)
(throw 'prefix (semantic-tag-name tag)))
(setq tag (semantic-find-tag-parent-by-overlay tag)))
""))
(defun wisent-php-tag-has-bounds? (tag)
"Return t if TAG has bounds, nil otherwise."
(condition-case nil
(semantic-tag-bounds tag)
(error nil)))
(defun wisent-php-get-implicit-types-for-tag (tag)
"Return all types TAG implicitly references."
;; Only import type for tags that have buffer information
(when (wisent-php-tag-has-bounds? tag)
(let ((tag-names '())
(prefix (wisent-php-get-tag-namespace-prefix tag)))
(cond
((and (equal 'variable (semantic-tag-class tag)) (stringp (semantic-tag-type tag)))
(add-to-list 'tag-names (semantic-tag-type tag)))
;; For a class, implicit types are its parent types
((wisent-php-is-tag-class-like? tag)
(setq tag-names (semantic-tag-type-superclasses tag))))
;; Finally, prefix relative types by the namespace
(mapcar
(lambda (name) (wisent-php-get-full-name name prefix))
tag-names))))
(defun wisent-php-find-alias-tags (&optional table)
"Return all tags in TABLE that represents a use statement."
(let ((tags (semantic-find-tags-by-type "use"))
(namespaces (semantic-find-tags-by-type "namespace" table)))
(dolist (cur namespaces)
(setq tags
(append tags
(semantic-find-tags-by-type "use"
(semantic-tag-get-attribute cur :members)))))
tags))
(defun wisent-php-create-include-tag-from-alias (tag)
"Create an include tag from a use statement TAG if possible.
Return nil if it cannot."
(let ((def (car (semantic-tag-type-superclasses tag)))
(current-project (ede-current-project))
def-file)
(when (ede-php-autoload-project-p (ede-current-project))
(setq def-file (ede-php-autoload-find-class-def-file (ede-current-project)
def))
(when def-file
(semantic-tag-new-include def-file nil)))))
(define-mode-local-override semantic-find-tags-included
php-mode (&optional table)
"Create include tags from use statements."
(delq nil (mapcar #'wisent-php-create-include-tag-from-alias
(wisent-php-find-alias-tags table))))
(defun wisent-php-import-implicit-types (tags)
"Return a list of the tags implicitly references in items of TAGS.
TAGS is a list of semantic tags."
(let ((tag-names '())
(implicit-tags '())
(project (ede-current-project)))
(dolist (tag tags)
(setq tag-names (append tag-names (wisent-php-get-implicit-types-for-tag tag))))
(if (ede-php-autoload-project-p project)
(dolist (name tag-names implicit-tags)
(when (stringp name)
(setq implicit-tags (append implicit-tags
(wisent-php-import-file-content-for-class
project
name)))))
tag-names)))
(define-mode-local-override semantic-ctxt-scoped-types
php-mode (&optional point)
"Return type names in scope at POINT.
Add types in function arguments."
(when point (goto-char point))
(let ((tags-overlay (semantic-find-tag-by-overlay))
(local-variables (semantic-get-local-variables)))
(wisent-php-import-implicit-types (append tags-overlay local-variables))))
;;;;
;;;; Semantic integration of the Php LALR parser
;;;;
;; Lexing
(defvar-mode-local php-mode semantic-lex-number-expression semantic-php-number-regexp)
(defvar-mode-local php-mode semantic-lex-analyzer #'wisent-php-lexer)
(defvar-mode-local php-mode semantic-lex-syntax-modifications '((?\\ ".")))
(defvar-mode-local php-mode semantic-lex-comment-regex "\\(/\\*\\|//\\|#\\)")
;; Parsing
(defvar-mode-local php-mode semantic-tag-expand-function #'wisent-php-expand-tag)
(defvar-mode-local php-mode semantic-type-relation-separator-character
'("->" "::" "\\"))
(defvar-mode-local php-mode semantic-command-separation-character ";")
;; Navigation
(defvar-mode-local php-mode semantic-symbol->name-assoc-list-for-type-parts
'((type . "Classes")
(variable . "Variables")
(function . "Methods")))
(defvar-mode-local php-mode senator-step-at-tag-classes '(function variable))
(defvar-mode-local php-mode semantic-imenu-summary-function #'semantic-format-tag-prototype)
;;;###autoload
(defun wisent-php-default-setup ()
"Hook run to setup Semantic in `php-mode'.
Use the alternate LALR(1) parser."
(set (make-local-variable 'wisent-in-php) nil)
(wisent-php-wy--install-parser)
(setq
imenu-create-index-function 'semantic-create-imenu-index
semantic-symbol->name-assoc-list
(append semantic-symbol->name-assoc-list-for-type-parts
'((include . "Includes")
(package . "Package")))
))
;; Setup phpdoc stuff
;;(semantic-php-doc-setup))
;;
;; Tag merging / expansion
;;
(defun wisent-php-translate-to-container-list (tags)
"Translate TAGS to a list that can be consumed by the container tag.
If TAGS is a container tag, extracts its tags.
If TAGS is actually a single tag, wrap it in a list.
Otherwise, return it unchanged."
(cond
((wisent-php-is-tag-container? tags)
(wisent-php-get-container-tags tags))
((semantic-tag-p tags)
(list tags))
(t tags)))
(defun wisent-php-create-container-tag (&rest tag-collections)
"Create a container tag for wrapping TAG-COLLECTIONS."
(semantic-tag "" 'container
:tags (apply #'append
(mapcar #'wisent-php-translate-to-container-list
tag-collections))))
(defun wisent-php-get-container-tags (tag)
"Return tags wrapped in the container TAG."
(plist-get (semantic-tag-attributes tag) :tags))
(defun wisent-php-is-tag-container? (tag)
"Return t if TAG is a container, nil otherwise."
(equal (semantic-tag-class tag) 'container))
(defun wisent-php-expand-tag-namespace (tag)
"Expand namespace TAG into a list of equivalent type tags.
It basically splits namespace parts (\"\\\") into a hierarchy of
namespaces."
(let* ((split-name (semantic-analyze-split-name (semantic-tag-name tag)))
(names (if (stringp split-name) (list split-name) (reverse split-name)))
(current-tag nil)
(loop-tag nil)
(region (semantic-tag-bounds tag))
(region-start (car region))
(region-end (cadr region)))
(dolist (name names)
(setq current-tag (semantic-tag-new-type name "namespace"
(if (null current-tag)
(semantic-tag-type-members tag)
(list current-tag))
nil))
(semantic-tag-set-bounds current-tag region-start region-end))
(list current-tag)))
(defun wisent-php-expand-tag-alias (tag)
"Replace alias TAG with a type and an include tag."
(let* ((name (semantic-tag-name tag))
(def (semantic-tag-alias-definition tag))
(project (ede-current-project))
(def-file "")
(region (semantic-tag-bounds tag))
(clone (semantic-tag-new-type name "use" nil (list (concat "\\" def))))
(start (car region))
(end (cadr region))
(xpand (list clone)))
(semantic-tag-set-bounds clone start end)
xpand))
(defun wisent-php-expand-tag-variable (tag)
"Strip the heading $ from instance variables."
(when (and (member "attribute" (semantic-tag-modifiers tag))
(not (member "static" (semantic-tag-modifiers tag))))
(semantic-tag-set-name tag (substring (semantic-tag-name tag) 1)))
(list tag))
(defun wisent-php-expand-tag (tag)
"Expand TAG into a list of equivalent tags, or nil.
Expand multiple variable or alias declarations merged into a single tag."
(cond
((equal (semantic-tag-class tag) 'alias)
(wisent-php-expand-tag-alias tag))
((equal (semantic-tag-class tag) 'variable)
(wisent-php-expand-tag-variable tag))
((wisent-php-is-tag-container? tag)
(apply #'append (mapcar #'wisent-cook-tag (wisent-php-get-container-tags tag))))
((wisent-php-is-tag-namespace? tag)
(wisent-php-expand-tag-namespace tag))
(t (list tag))))
;;;###autoload
(add-hook 'php-mode-hook #'wisent-php-default-setup)
(provide 'wisent-php)
;;; wisent-php.el ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.