막상 ctags를 돌려보니 main()은 보이는데
그아래의 변수들이 보이지 않는 현상 발생 -_-
이게 무슨 신혼첫날밤에 발기부전 걸리는 소리야! 라는 생각에
검색을 해보니 공식적인 내용은 발견하지 못했지만 아래의 내용들 발견..

ctagas는 원래 로컬 변수들은 못다루는듯 -_-
확인겸 openCV 소스를 받아서 전체를 돌리고 vi에서 해보니
main(int argc, char** argv) 의 argv를 소스내에서 찾으니 엉뚱한 곳으로 날아간다.

I know CTags does not handle local vars, However, the code I said I will be happy to contribute uses also a lexer + written with flex language to analyze a current scope (small scope, the main parsing is done via CTags)

즉, ctags만으로는 지역변수나 전역변수가 사용된 곳, 함수가 사용된 곳은 찾기 힘들다. 이때는 cscope를 사용하면 된다.
[링크 : http://blog.naver.com/parkys1982/30014739315

12. How can I locate all references to a specific function or variable?

There are several packages already available which provide this capability. As of this writing, they are:
GLOBAL source code tag system
GNU id-utils
cscope
cflow
 
[링크 : http://ctags.sourceforge.net/faq.html#12

'프로그램 사용 > ctags & cscope' 카테고리의 다른 글

kscope 에서 특정 확장자 추가하기  (0) 2009.11.04
kscope 프로젝트 생성하기  (0) 2009.08.20
ctags format - CTAGS 출력 포맷/양식  (0) 2009.06.14
ctags  (0) 2009.01.07
Posted by 구차니
프로그램 사용/antlr2011. 10. 24. 22:35
우분투에서 antlr 실행 파일은 pccts 패키지에 존재한다.

$ antlr
'antlr' 프로그램은 현재 설치되어 있지 않습니다.  다음을 입력하여 이를 설치할 수 있습니다:
sudo apt-get install pccts 

$ antlr
Antlr parser generator   Version 1.33MR33   1989-2001
antlr [options] f1 f2 ... fn
    -CC            Generate C++ output (default=FALSE)
    -cr            Generate cross reference (default=FALSE)
    -ck      ___   Set compressed lookahead depth; fast approximate lookahead
    -e1            Ambiguities/errors shown in low detail (default)
    -e2            Ambiguities/errors shown in more detail
    -e3            Ambiguities for k>1 grammars shown with exact tuples (not lookahead sets)
    -f       ___   Read names of grammar files from specified file
    -fe      ___   Rename err.c
    -fh      ___   Rename stdpccts.h header (turns on -gh)
    -fl      ___   Rename lexical output--parser.dlg
    -fm      ___   Rename mode.h
    -fr      ___   Rename remap.h
    -ft      ___   Rename tokens.h
    -ga            Generate ANSI-compatible code (default=FALSE)
    -gc            Do not generate output parser code (default=FALSE)
    -gd            Generate code to trace rule invocation (default=FALSE)
    -ge            Generate an error class for each non-terminal (default=FALSE)
    -gh            Generate stdpccts.h for non-ANTLR-generated-files to include
    -gk            Generate parsers that delay lookahead fetches until needed
    -gl            Generate line info about grammar actions in C parser
    -glms          Like -gl but replace '\' with '/' in #line filenames for MS C/C++ systems
    -gp      ___   Prefix all generated rule functions with a string
    -gs            Do not generate sets for token expression lists (default=FALSE)
    -gt            Generate code for Abstract-Syntax-Trees (default=FALSE)
    -gx            Do not generate lexical (dlg-related) files (default=FALSE)
    -gxt           Do not generate tokens.h (default=FALSE)
    -k       ___   Set full LL(k) lookahead depth (default==1)
    -o       ___   Directory where all output files should go (default=".")
    -p             Print out the grammar w/o actions (default=no)
    -pa            Print out the grammar w/o actions & w/FIRST sets (default=no)
    -pr            no longer used; predicates employed if present
    -prc     ___   Turn on/off computation of context for hoisted predicates
    -rl      ___   Limit max # of tree nodes used by grammar analysis
    -stdout        Send grammar.c/grammar.cpp to stdout
    -tab     ___   Width of tabs (1 to 8) for grammar.c/grammar.cpp files
    -w1            Set the warning level to 1 (default)
    -w2            Ambiguities yield warnings even if predicates or (...)? block
    -mrhoist ___   Turn on/off k=1 Maintenance Release style hoisting
    -mrhoistk___   Turn on/off k>1 EXPERIMENTAL Maintenance Release style hoisting
    -aa      ___   Ambiguity aid for a rule (rule name or line number)
    -aam           Lookahead token may appear multiple times in -aa listing
    -aad     ___   Limits exp growth of -aa listing - default=1 (max=ck value)
    -info    ___   Extra info: p=pred t=tnodes f=first/follow m=monitor o=orphans 0=noop
    -treport ___   Report when tnode usage exceeds value during ambiguity resolution
    -newAST        In C++ mode use "newAST(...)" rather than "new AST(...)"
    -tmake         In C++ mode use parser's tmake method rather than "ASTBase::tmake(...)"
    -alpha         Provide additional information for "(alpha)? beta" error messages
    -mrblkerr      EXPERIMENTAL change to (...)* and (...)+ syntax error sets
    -nopurify      Don't use the notorious PURIFY macro (replaced by MR23 initial value syntax)
                   to zero return arguments of rules
    -              Read grammar from stdin 

[링크 : http://packages.ubuntu.com/oneiric/pccts]
[링크 : http://packages.ubuntu.com/hardy/antlr]

2011/04/23 - [Programming/언어론] - antlr - ANother Tool for Language Recognition

---
2011.11.06 추가
[링크 : http://www.antlr2.org/pccts133.html]
[링크 : http://www.antlr2.org/1.33/pccts_faq.html]
    [링크 : http://www.polhode.com/pccts.html]
    [링크 : http://www.antlr2.org/book/pcctsbk.pdf]
    [링크 : http://www.antlr2.org/1.33/tutorial.zip]

ubuntu에서 설치가능한 antlr은 PCCTS  버전으로
antlr 1.33MR33 이라고 표기되었듯이 아마도 antlr v1 으로 추정된다.
그런 이유로 이녀석으로 돌려봤자 요즘 문법은(antlr v2 / v3) 인식되지 않으며
기본적으로 생성될 경우 c언어로 출력이 나오게 된다.
$ cat poly.g
poly > [float r]
    :   <<float f;>>
        term>[$r] ( "\+" term>[f] <<$r += f;>> )*
    ;

$ antlr poly.g
Antlr parser generator   Version 1.33MR33   1989-2001
poly.g, line 3: warning: rule term not defined
poly.g, line 3: warning: rule term not defined
poly.g, line 3: warning: rule term not defined

$ cat poly.c 
/*
 * A n t l r  T r a n s l a t i o n  H e a d e r
 *
 * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
 * Purdue University Electrical Engineering
 * With AHPCRC, University of Minnesota
 * ANTLR Version 1.33MR33
 *
 *   antlr poly.g
 *
 */

#define ANTLR_VERSION	13333
#include "pcctscfg.h"
#include "pccts_stdio.h"
#define zzSET_SIZE 4
#include "antlr.h"
#include "tokens.h"
#include "dlgdef.h"
#include "mode.h"

/* MR23 In order to remove calls to PURIFY use the antlr -nopurify option */

#ifndef PCCTS_PURIFY
#define PCCTS_PURIFY(r,s) memset((char *) &(r),'\0',(s));
#endif

ANTLR_INFO

float
#ifdef __USE_PROTOS
poly(void)
#else
poly()
#endif
{
  float   _retv;
  zzRULE;
  zzBLOCK(zztasp1);
  PCCTS_PURIFY(_retv,sizeof(float  ))
  zzMake0;
  {
  float f;
  zzEXIT(zztasp1);
  return _retv;
fail:
  zzEXIT(zztasp1);
  zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
  zzresynch(setwd1, 0x1);
  return _retv;
  }
}

$  cat tokens.h
#ifndef tokens_h
#define tokens_h
/* tokens.h -- List of labelled tokens and stuff
 *
 * Generated from: poly.g
 *
 * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
 * Purdue University Electrical Engineering
 * ANTLR Version 1.33MR33
 */
#define zzEOF_TOKEN 1

#ifdef __USE_PROTOS
extern float poly(void);
#else
extern float poly();
#endif

#endif
extern SetWordType setwd1[];


$  cat err.c
/*
 * A n t l r  S e t s / E r r o r  F i l e  H e a d e r
 *
 * Generated from: poly.g
 *
 * Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-2001
 * Parr Research Corporation
 * with Purdue University Electrical Engineering
 * With AHPCRC, University of Minnesota
 * ANTLR Version 1.33MR33
 */

#define ANTLR_VERSION	13333
#include "pcctscfg.h"
#include "pccts_stdio.h"
#define zzSET_SIZE 4
#include "antlr.h"
#include "tokens.h"
#include "dlgdef.h"
#include "err.h"

ANTLRChar *zztokens[3]={
	/* 00 */	"Invalid",
	/* 01 */	"@",
	/* 02 */	"\\+"
};
SetWordType setwd1[3] = {0x0,0x1,0x0};

$  cat parser.dlg
<<
/* parser.dlg -- DLG Description of scanner
 *
 * Generated from: poly.g
 *
 * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001
 * Purdue University Electrical Engineering
 * With AHPCRC, University of Minnesota
 * ANTLR Version 1.33MR33
 */

#define ANTLR_VERSION	13333
#include "pcctscfg.h"
#include "pccts_stdio.h"
#include "antlr.h"
#include "tokens.h"
#include "dlgdef.h"
LOOKAHEAD

void
#ifdef __USE_PROTOS
zzerraction(void)
#else
zzerraction()
#endif
{
	(*zzerr)("invalid token");
	zzadvance();
	zzskip();
}
>>


%%START

@
	<<
		NLA = 1;
	>>

\+
	<<
		NLA = 2;
	>>

%%
[링크 : http://www.rubyholic.com/Languages/PCCTS/Grammars.html

'프로그램 사용 > antlr' 카테고리의 다른 글

java를 이용한 antlr AST 탐색하기(AST navigation)  (0) 2011.11.02
ANTLR IDE 2.1.2 for ANTLR 3.0 above  (0) 2011.11.02
antlrworks  (0) 2011.11.02
antlr + eclipse & java  (0) 2011.10.30
antlr - ANother Tool for Language Recognition  (0) 2011.04.23
Posted by 구차니
프로그램 사용/eclipse2011. 10. 24. 21:39
$ sudo apt-get install eclipse
로 설치를 했는데 프로젝트 윈도우에서 아무것도 나오지 않는 현상 발생 -_-


 아래의 도움말 대로 SUN(oracle) JDK를 깔아서 -vm 옵션을 줘도 여전히 안보이고 -_-

혹시나 해서 버전을 비교해보니 우분투에서 관리하는건 GALILEO 버전이고


eclipse.org 에서 오늘 받아본건 INDIGO 버전이다.


VM 설정없이 그냥했는데 잘 나오네 -_-


결론 : 우분투에서 eclipse 패키지 관리가 잘못된듯

---
두개의 환경파일을 비교해보면 은근 심하게 많은 차이점이 발견된다.
혹시나 해서 덮어씌어 봤지만 역시나 실행은 안되니 eclipse.ini 파일은 덮어씌우지 않도록!




----
2011.10.25 추가
몽작가님 의 리플을 보고 확인해보니
eclipse-platform 패키지에는 eclipse-jdt가 suggest로 되어 있어 기본적으로 설치는 안되는 것으로 생각된다.

eclipse-platform eclipse-jdt 두개의 패키지를 집에와서 설치해보니 자~알 된다!
몽백작님 캄사욤~

[링크 : http://packages.ubuntu.com/hardy/eclipse-platform]
[링크 : http://packages.ubuntu.com/hardy/eclipse-jdt
[링크 : http://packages.ubuntu.com/hardy/eclipse-cdt

Posted by 구차니
프로그램 사용/busybox2011. 10. 21. 18:50
설명은 콘솔 출력을 /dev/console에서 다른걸로 돌려주는거라는데
kernel 부팅 인자로 console=ttyS0,115200n8 이런걸 넣어줘서
telnet 포트로 돌려줄려고 하니 안되는건 여전한듯..

# setconsole --help
BusyBox v1.14.2 (2011-01-24 14:35:28 KST) multi-call binary

Usage: setconsole [-r|--reset] [DEVICE]

Redirect system console output to DEVICE (default: /dev/tty)

Options:
        -r      Reset output to /dev/console 

# tty
/dev/pts/0

# setconsole /dev/pts/0
setconsole: TIOCCONS: Device or resource busy 


 

'프로그램 사용 > busybox' 카테고리의 다른 글

busybox su가 안될 경우  (0) 2014.12.05
busybox tftp  (0) 2013.06.18
busybox ash "cannot open /dev/ttyAS1: no such device"  (0) 2010.04.20
busybox ps는 BSD 스타일?  (0) 2010.01.12
ifup / ifdown 을 통한 static <-> dhcp 변환  (0) 2009.12.29
Posted by 구차니
repository browse
>> svn ls file:///repo_dir

Check for modificiations
>> svn status

[링크 : http://wiki.kldp.org/wiki.php/SubversionBook/Reference]
[링크 : http://maverick.inria.fr/~Xavier.Decoret/resources/svn/index.html]
Posted by 구차니
프로그램 사용/meld2011. 10. 15. 20:48
meld의 기본 설정에서 (Edit - Preference)
기타의 "문법 강조 사용"을 켜면 문법이 강조되어 출력이 된다.
기본값은 "줄 번호 표시"와 "문법 강조 사용"이 꺼져있다.


2009/02/13 - [Linux] - GUI diff tool - meld
2009/04/06 - [프로그램 사용] - meld - GUI merge tool for linux

'프로그램 사용 > meld' 카테고리의 다른 글

meld 자동 줄 바꿈  (0) 2024.07.19
meld for windows 비교 내용이 안나오는 문제  (0) 2014.03.31
meld for windows  (0) 2014.03.31
meld - GUI merge tool for linux  (0) 2009.04.06
GUI diff tool - meld  (6) 2009.02.13
Posted by 구차니
솔찍히 svn 이나 cvs를 콘솔에서 하기에는 너무 무리가 많은데.. (내 능력의 한계일지도 -_-)
rabiitVCS는 리눅스 용으로 nautilius와 통합이 된다고 한다.

[링크 : http://rabbitvcs.org/]
    [링크 : http://wiki.rabbitvcs.org/wiki/install/ubuntu]
[링크 : http://ioriy2k.pe.kr/archives/2628]

설치는 간단하게 (반드시 nautilus를 재실행 해야한다)
$ sudo add-apt-repository ppa:rabbitvcs/ppa
$ sudo apt-get update
$ sudo apt-get install rabbitvcs-core rabbitvcs-nautilus rabbitvcs-thunar rabbitvcs-gedit rabbitvcs-cli 

$ nautilus -q 

그나저나 패키지 의존성 좀 쩌는듯...
$ sudo apt-get install rabbitvcs-core rabbitvcs-nautilus rabbitvcs-thunar rabbitvcs-gedit rabbitvcs-cli
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다       
상태 정보를 읽는 중입니다... 완료
다음 패키지를 더 설치할 것입니다:
  exo-utils global ipython libexo-0.3-0 libexo-common libthunar-vfs-1-2
  libxfce4util-bin libxfce4util-common libxfce4util4 libxfcegui4-4
  libxfconf-0-2 meld python-configobj python-dulwich python-foolscap
  python-nautilus python-svn python-wxgtk2.8 python-wxversion thunar
  thunar-data thunar-volman thunarx-python xfce-keyboard-shortcuts xfce4-panel
  xfconf
제안하는 패키지:
  doxygen apache httpd id-utils python-profiler python-numpy python-matplotlib
  python-qt3 python-qt4 python-svn-dbg wx2.8-doc wx2.8-examples python-wxtools
  tcsh csh octave3.0 mksh pdksh thunar-archive-plugin thunar-media-tags-plugin
다음 새 패키지를 설치할 것입니다:
  exo-utils global ipython libexo-0.3-0 libexo-common libthunar-vfs-1-2
  libxfce4util-bin libxfce4util-common libxfce4util4 libxfcegui4-4
  libxfconf-0-2 meld python-configobj python-dulwich python-foolscap
  python-nautilus python-svn python-wxgtk2.8 python-wxversion rabbitvcs-cli
  rabbitvcs-core rabbitvcs-gedit rabbitvcs-nautilus rabbitvcs-thunar thunar
  thunar-data thunar-volman thunarx-python xfce-keyboard-shortcuts xfce4-panel
  xfconf
0개 업그레이드, 31개 새로 설치, 0개 지우기 및 5개 업그레이드 안 함.
24.0M바이트 아카이브를 받아야 합니다.
이 작업 후 73.7M바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까 [Y/n]? Y

기본적으로 meld가 비교용 프로그램으로 등록되며, TortoiseSVN 보다는 갱신이 잘 안되는 경향이 있는것 같으니
귀찮아도 사용전에 F5를 눌러 상태를 갱신하고 사용해야 할때가 있을 듯 하다.

아래는 nautilus와 통합된 rabbitVCS의 context-menu 구조이다.


'프로그램 사용 > Version Control' 카테고리의 다른 글

TortoiseSVN Trac의 SVN 접속시 인증오류  (0) 2011.11.15
svn 명령어  (0) 2011.10.16
git-svn 을 이용해서 svn 을 복제가능하다고?  (0) 2011.08.14
TortoiseSVN doc 비교  (0) 2011.07.29
svn pam  (0) 2011.06.24
Posted by 구차니
프로그램 사용/gcc2011. 10. 12. 23:57
gcc 버전에 따른 오류라고 하는데
우분투에서 --v로 확인해보면 해당 버전도 아닌데 흐음.. 왜이럴까..

$ gcc --v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)  


아무튼, "error: extra qualification" 이녀석은
제한자(qualification / 자격) 해당 함수/메소드의 클래스를 제한해주는 역활인데
아래의 소스에 대해서
 void Mesh::HSVtoRGB( double *r, double *g, double *b, double h, double s=1 , double v=1 ); 

이러한 에러를 발생해 낸다.
 mesh.h:229: error: extra qualification ‘Mesh::’ on member ‘HSVtoRGB’

mesh.cpp에 Mesh::HSVtoRGB() 함수가 존재함에도 왜이런 에러가 뜰려나 후우...
프로토 타입이랑 원 함수랑 s=1 , v=1 부분이 달라서 동일하게 해도 여전히 에러가 난다 ㅠ.ㅠ


Posted by 구차니
Cross Make 인데
정확하게는 makefile을 생성하는 제너레이터 이다.

MakeLists.txt 라는 파일을 생성해 놓으면 그 파일의 정의에 따라 Makefile을 생성하는 툴인데
문법은 흐음... 그리 어려워 보이진 않는 느낌?
 PROJECT(FOO)
 # make sure cmake addes the binary directory for the project to the include path
 INCLUDE_DIRECTORIES(${FOO_BINARY_DIR})
 # add the executable that will do the generation
 ADD_EXECUTABLE(my_generator my_generator.cxx)
 GET_TARGET_PROPERTY(MY_GENERATOR_EXE my_generator LOCATION)
 # add the custom command that will generate all three files
 ADD_CUSTOM_COMMAND(
   OUTPUT ${FOO_BINARY_DIR}/output1.cpp ${FOO_BINARY_DIR}/output2.h ${FOO_BINARY_DIR}/output3.cpp
   COMMAND ${MY_GENERATOR_EXE} ${FOO_BINARY_DIR} ${FOO_SOURCE_DIR}/input.txt
   DEPENDS my_generator
   MAIN_DEPENDENCY ${FOO_SOURCE_DIR}/input.txt
   )
 # now create an executable using the generated files
 ADD_EXECUTABLE(generated
                ${FOO_BINARY_DIR}/output1.cpp
                ${FOO_BINARY_DIR}/output2.h
                ${FOO_BINARY_DIR}/output3.cpp) 

[링크 : http://www.cmake.org/Wiki/CMake_FAQ

윈도우에서는 GUI 툴이 생성을 해주는 것 같다.


linux에서도 gt 나 ncurse로 GUI / CUI 구성이 되어 있는듯 하다
$ apt-cache search cmake
cmake-data - CMake data files (modules, templates and documentation)
cmake - 크로스 플랫폼, 오픈 소스 make 시스템
cmake-curses-gui - Curses based user interface for CMake (ccmake)
cmake-qt-gui - Qt4 based user interface for CMake (cmake-gui)

cmake-curses-gui 의 실행 파일명은 ccmake 이고,
cmake-qt-gui의 실행 파일명은 cmake-gui 이다.


[링크 : http://packages.ubuntu.com/lucid/cmake-curses-gui]
[링크 : http://www.cmake.org/cmake/help/runningcmake.html]  << 사용법

[링크 : http://rgbear.tistory.com/1]
[링크 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/Development/Env/cmake]
[링크 : http://semtle.tistory.com/205]

2010/04/06 - [프로그램 사용/make, configure] - cmake - cross make 

'프로그램 사용 > make, configure' 카테고리의 다른 글

make burn 0.0.0 ???  (0) 2014.11.11
make를 조용하게  (0) 2014.09.12
cross compile 초기화 하기  (0) 2010.05.18
cmake - cross make  (0) 2010.04.06
makefile 에서 컴파일할 목록 생성하기  (0) 2010.04.03
Posted by 구차니
프로그램 사용2011. 10. 7. 09:13
역시 FAQ는 읽어야 제맛

In other cases, uClibc leaves certain features (such as full C99 Math library support, wordexp, IPV6, and RPC support)disabled by default. Those features can be enabled for people that need them, but are otherwise disabled to save space.

you do not need to give away your application source code just because you use uClibc and/or run on Linux. uClibc is licensed under the Lesser GPL license, just like the GNU C library (glibc). 

[링크 : http://uclibc.org/FAQ.html

Posted by 구차니