用c++解析旺盛的标签
Parsing Exuberant Ctags with C++
我需要用符号浏览器制作一个编辑器,我说我会玩标签。好吧,我读标签格式,并试图谷歌和搜索这里在SO。我只发现了关于标签和vim的问题,我对vim一窍不通。所以我决定自己玩。所以我拿了一个标签文件,我完全困惑了!
在这里我已经把PHP文件及其相应的标签,我需要你的帮助,我怎么知道如果行代表类属性或方法?也我怎么能知道PHP函数/方法的返回值?
我还没有找到任何好的教程处理PHP(或任何其他语言)标签以外的vi/vim连接的标签!由于
PHP文件<?php
$teachers = array("standard one"=>"Celina Stephen", "Standard Two"=>"Emanyor Dickson");
function set_teachers($teacher_array){
$teachers = $teacher_array;
return $teacher_array;
}
class School{
$teachers;
$students;
public function __construct(){
}
public function get_all(){
return array($this->teachers,$this->students);
}
}
class ManySchools extends School{
public __construct(){
parent::construct();
}
private do_selection($teacher, $student=null){
return false;
}
}
标记文件!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.9~svn20110310 //
ManySchools test.php /^class ManySchools extends School{$/;" c
School test.php /^class School{$/;" c
__construct test.php /^ public function __construct(){$/;" f
get_all test.php /^ public function get_all(){$/;" f
set_teachers test.php /^function set_teachers($teacher_array){$/;" f
teachers test.php /^ $teachers = $teacher_array;$/;" v
teachers test.php /^$teachers = array("standard one"=>"Celina Stephen", "Standard Two"=>"Emanyor Dickson");$/;" v
每行;"
后第一项描述标签的kind
,即是否为类、函数等。在你的例子中,c
代表类,f
代表函数,以此类推。您可以使用ctags --list-kinds=php
获得完整的列表。
返回类型(不幸的是)不由标签报告。
你一定要看一下标签手册,所有的东西都解释得很好,例如除了默认报告的信息之外,它还可以报告哪些其他信息
我读标签格式
Exuberant标签文件格式有很好的文档。
相关文章:
- C 和 C++ 中开关语句的案例标签的常量值,但显示不同的行为
- 如何正确指定 goto 语句的标签?
- 使用g++静态初始化带有命名标签的嵌套C++结构
- 通过水平滚动条更改标签
- 从 QFontDatabase 设置 QFont 将所有标签设置为等宽字体?Qt C++
- 在C++中存储要输入的标签列表
- 如何在等效列表中查找最小的连接标签
- 标签检测鼠标单击 c++
- 无法将行编辑中的文本打印到 Qt C++ 中的标签
- 如何根据C++中的标签运行特定函数?
- C++ Expat 仅打印元素的第一个字母和标签中的数据
- 默认标签显然在 switch 语句中不起作用
- 在 gcc/clang (C++) 中获取函数范围之外的标签地址
- 在"printf"中使用标签"h"或"hh"是否涉及未定义的
- GTK 3 C++按钮中带有标签的图标
- 如何使QLineSeries/QXYSeries仅显示一个点标签
- SFINAE和标签调度之间的差异
- 如何在主窗口标签的对话框中显示QLineEdit的输入
- Qt - 将空指针(原始数据)转换为 QImage 并将其显示在标签上
- win32 c++ 我想在静态标签的文本之后直接插入一个 EDIT 控件