Replace pfff with flitter
This commit is contained in:
parent
cccf36eb4f
commit
c8efc2a088
27 changed files with 295 additions and 293 deletions
8
.depend
8
.depend
|
|
@ -8,14 +8,14 @@ find_source.cmi : commons/common.cmi
|
||||||
main.cmo : lang_cpp/parsing/test_parsing_cpp.cmi \
|
main.cmo : lang_cpp/parsing/test_parsing_cpp.cmi \
|
||||||
lang_c/parsing/test_parsing_c.cmi external/jsonwheel/json_io.cmi \
|
lang_c/parsing/test_parsing_c.cmi external/jsonwheel/json_io.cmi \
|
||||||
external/jsonwheel/json_in.cmo generators/nim/generate_nim.cmi \
|
external/jsonwheel/json_in.cmo generators/nim/generate_nim.cmi \
|
||||||
lang_cpp/parsing/flag_parsing_cpp.cmo globals/config_pfff.cmo \
|
lang_cpp/parsing/flag_parsing_cpp.cmo globals/config_flitter.cmo \
|
||||||
commons/common2.cmi commons/common.cmi
|
commons/common2.cmi commons/common.cmi
|
||||||
main.cmx : lang_cpp/parsing/test_parsing_cpp.cmx \
|
main.cmx : lang_cpp/parsing/test_parsing_cpp.cmx \
|
||||||
lang_c/parsing/test_parsing_c.cmx external/jsonwheel/json_io.cmx \
|
lang_c/parsing/test_parsing_c.cmx external/jsonwheel/json_io.cmx \
|
||||||
external/jsonwheel/json_in.cmx generators/nim/generate_nim.cmx \
|
external/jsonwheel/json_in.cmx generators/nim/generate_nim.cmx \
|
||||||
lang_cpp/parsing/flag_parsing_cpp.cmx globals/config_pfff.cmx \
|
lang_cpp/parsing/flag_parsing_cpp.cmx globals/config_flitter.cmx \
|
||||||
commons/common2.cmx commons/common.cmx
|
commons/common2.cmx commons/common.cmx
|
||||||
main_test.cmo : generators/nim/unit_generate_nim.cmi commons/oUnit.cmi \
|
main_test.cmo : generators/nim/unit_generate_nim.cmi commons/oUnit.cmi \
|
||||||
globals/config_pfff.cmo commons/common2.cmi commons/common.cmi
|
globals/config_flitter.cmo commons/common2.cmi commons/common.cmi
|
||||||
main_test.cmx : generators/nim/unit_generate_nim.cmx commons/oUnit.cmx \
|
main_test.cmx : generators/nim/unit_generate_nim.cmx commons/oUnit.cmx \
|
||||||
globals/config_pfff.cmx commons/common2.cmx commons/common.cmx
|
globals/config_flitter.cmx commons/common2.cmx commons/common.cmx
|
||||||
|
|
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -16,8 +16,8 @@ lang_cpp/parsing/parser_cpp.mli
|
||||||
lang_cpp/parsing/parser_cpp.output
|
lang_cpp/parsing/parser_cpp.output
|
||||||
h_program-lang/archi_code_lexer.ml
|
h_program-lang/archi_code_lexer.ml
|
||||||
|
|
||||||
pfff
|
flitter
|
||||||
pfff_test
|
flitter_test
|
||||||
|
|
||||||
# ocamlbuild working directory
|
# ocamlbuild working directory
|
||||||
_build/
|
_build/
|
||||||
|
|
|
||||||
36
Makefile
36
Makefile
|
|
@ -11,15 +11,15 @@ TOP:=$(shell pwd)
|
||||||
|
|
||||||
SRC=find_source.ml
|
SRC=find_source.ml
|
||||||
|
|
||||||
TARGET=pfff
|
TARGET=flitter
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Program related variables
|
# Program related variables
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
PROGS=pfff
|
PROGS=flitter
|
||||||
|
|
||||||
PROGS+=pfff_test
|
PROGS+=flitter_test
|
||||||
|
|
||||||
OPTPROGS= $(PROGS:=.opt)
|
OPTPROGS= $(PROGS:=.opt)
|
||||||
|
|
||||||
|
|
@ -158,7 +158,7 @@ distclean:: clean
|
||||||
set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i $@; done
|
set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i $@; done
|
||||||
rm -f .depend
|
rm -f .depend
|
||||||
rm -f Makefile.config
|
rm -f Makefile.config
|
||||||
rm -f globals/config_pfff.ml
|
rm -f globals/config_flitter.ml
|
||||||
rm -f TAGS
|
rm -f TAGS
|
||||||
# find -name ".#*1.*" | xargs rm -f
|
# find -name ".#*1.*" | xargs rm -f
|
||||||
|
|
||||||
|
|
@ -178,19 +178,19 @@ purebytecode:
|
||||||
# codegraph (was pm_depend)
|
# codegraph (was pm_depend)
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
pfff_test: $(LIBS) $(OBJS) main_test.cmo
|
flitter_test: $(LIBS) $(OBJS) main_test.cmo
|
||||||
$(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
|
$(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^
|
||||||
pfff_test.opt: $(LIBS:.cma=.cmxa) $(OPTOBJS) main_test.cmx
|
flitter_test.opt: $(LIBS:.cma=.cmxa) $(OPTOBJS) main_test.cmx
|
||||||
$(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
|
$(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^
|
||||||
clean::
|
clean::
|
||||||
rm -f pfff_test
|
rm -f flitter_test
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
$(MAKE) rec && $(MAKE) pfff_test
|
$(MAKE) rec && $(MAKE) flitter_test
|
||||||
./pfff_test -verbose all
|
./flitter_test -verbose all
|
||||||
test:
|
test:
|
||||||
$(MAKE) rec && $(MAKE) pfff_test
|
$(MAKE) rec && $(MAKE) flitter_test
|
||||||
./pfff_test -verbose all
|
./flitter_test -verbose all
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Build documentation
|
# Build documentation
|
||||||
|
|
@ -201,7 +201,7 @@ test:
|
||||||
# Install
|
# Install
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
VERSION=$(shell cat globals/config_pfff.ml.in |grep version |perl -p -e 's/.*"(.*)".*/$$1/;')
|
VERSION=$(shell cat globals/config_flitter.ml.in |grep version |perl -p -e 's/.*"(.*)".*/$$1/;')
|
||||||
|
|
||||||
# note: don't remove DESTDIR, it can be set by package build system like ebuild
|
# note: don't remove DESTDIR, it can be set by package build system like ebuild
|
||||||
install: all
|
install: all
|
||||||
|
|
@ -210,7 +210,7 @@ install: all
|
||||||
cp -a $(PROGS) $(DESTDIR)$(BINDIR)
|
cp -a $(PROGS) $(DESTDIR)$(BINDIR)
|
||||||
cp -a data $(DESTDIR)$(SHAREDIR)
|
cp -a data $(DESTDIR)$(SHAREDIR)
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "You can also install pfff by copying the programs"
|
@echo "You can also install flitter by copying the programs"
|
||||||
@echo "available in this directory anywhere you want and"
|
@echo "available in this directory anywhere you want and"
|
||||||
@echo "give it the right options to find its configuration files."
|
@echo "give it the right options to find its configuration files."
|
||||||
|
|
||||||
|
|
@ -222,7 +222,7 @@ INSTALL_SUBDIRS= \
|
||||||
commons \
|
commons \
|
||||||
lang_cpp/parsing
|
lang_cpp/parsing
|
||||||
|
|
||||||
LIBNAME=pfff
|
LIBNAME=flitter
|
||||||
install-findlib:: all all.opt
|
install-findlib:: all all.opt
|
||||||
ocamlfind install $(LIBNAME) META
|
ocamlfind install $(LIBNAME) META
|
||||||
set -e; for i in $(INSTALL_SUBDIRS); do echo $$i; $(MAKE) -C $$i install-findlib; done
|
set -e; for i in $(INSTALL_SUBDIRS); do echo $$i; $(MAKE) -C $$i install-findlib; done
|
||||||
|
|
@ -235,7 +235,7 @@ version:
|
||||||
|
|
||||||
|
|
||||||
install-bin:
|
install-bin:
|
||||||
cp $(PROGS) ../pfff-binaries/mac
|
cp $(PROGS) ../flitter-binaries/mac
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Package rules
|
# Package rules
|
||||||
|
|
@ -257,10 +257,10 @@ srctar:
|
||||||
#http://stackoverflow.com/questions/2689813/cross-compile-windows-64-bit-exe-from-linux
|
#http://stackoverflow.com/questions/2689813/cross-compile-windows-64-bit-exe-from-linux
|
||||||
|
|
||||||
# making an OPAM package:
|
# making an OPAM package:
|
||||||
# - git push from pfff to github
|
# - git push from flitter to github
|
||||||
# - make a new release on github: https://github.com/facebook/pfff/releases
|
# - make a new release on github: https://github.com/facebook/flitter/releases
|
||||||
# - get md5sum of new archive
|
# - get md5sum of new archive
|
||||||
# - update opam file in opam-repository/pfff-xxx/
|
# - update opam file in opam-repository/flitter-xxx/
|
||||||
# - test locally?
|
# - test locally?
|
||||||
# - commit, git push
|
# - commit, git push
|
||||||
# - do pull request on github
|
# - do pull request on github
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# Variables
|
# Variables
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# if part of pfff/ or other programs with a Makefile.config
|
# if part of flitter/ or other programs with a Makefile.config
|
||||||
-include ../Makefile.config
|
-include ../Makefile.config
|
||||||
|
|
||||||
LIBNAME=commons
|
LIBNAME=commons
|
||||||
|
|
@ -24,7 +24,7 @@ SYSLIBS=unix.cma str.cma
|
||||||
|
|
||||||
-include Makefile.common
|
-include Makefile.common
|
||||||
|
|
||||||
# too many code in pfff assume commons/lib.cma
|
# too many code in flitter assume commons/lib.cma
|
||||||
all:: lib.cma
|
all:: lib.cma
|
||||||
all.opt: lib.cmxa lib.a
|
all.opt: lib.cmxa lib.a
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5737,7 +5737,7 @@ let add_in_scope_h x (k,v) =
|
||||||
(* See console.ml *)
|
(* See console.ml *)
|
||||||
|
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
(* Gc optimisation (pfff) *)
|
(* Gc optimisation (flitter) *)
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
|
|
||||||
(* opti: to avoid stressing the GC with a huge graph, we sometimes
|
(* opti: to avoid stressing the GC with a huge graph, we sometimes
|
||||||
|
|
@ -6130,9 +6130,9 @@ let common_prefix_of_files_or_dirs xs =
|
||||||
(*
|
(*
|
||||||
let _ =
|
let _ =
|
||||||
example
|
example
|
||||||
(common_prefix_of_files_or_dirs ["/home/pad/pfff/visual";
|
(common_prefix_of_files_or_dirs ["/home/pad/flitter/visual";
|
||||||
"/home/pad/pfff/commons";]
|
"/home/pad/flitter/commons";]
|
||||||
=*= "/home/pad/pfff"
|
=*= "/home/pad/flitter"
|
||||||
)
|
)
|
||||||
*)
|
*)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,7 @@ let file_type_of_file a =
|
||||||
|
|
||||||
let is_textual_file file =
|
let is_textual_file file =
|
||||||
match file_type_of_file file with
|
match file_type_of_file file with
|
||||||
(* if this contains weird code then pfff_visual crash *)
|
(* if this contains weird code then flitter_visual crash *)
|
||||||
| PL (Web Sql) -> false
|
| PL (Web Sql) -> false
|
||||||
|
|
||||||
| PL _
|
| PL _
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,13 @@ generate_nim.cmx : ../../h_program-lang/parse_info.cmx \
|
||||||
../../lang_cpp/parsing/ast_cpp.cmx generate_nim.cmi
|
../../lang_cpp/parsing/ast_cpp.cmx generate_nim.cmi
|
||||||
generate_nim.cmi : ../../commons/common.cmi
|
generate_nim.cmi : ../../commons/common.cmi
|
||||||
unit_generate_nim.cmo : ../../commons/oUnit.cmi generate_nim.cmi \
|
unit_generate_nim.cmo : ../../commons/oUnit.cmi generate_nim.cmi \
|
||||||
../../lang_cpp/parsing/flag_parsing_cpp.cmo ../../globals/config_pfff.cmo \
|
../../lang_cpp/parsing/flag_parsing_cpp.cmo \
|
||||||
../../commons/common2.cmi ../../commons/common.cmi \
|
../../globals/config_flitter.cmo ../../commons/common2.cmi \
|
||||||
../../lang_cpp/parsing/ast_cpp.cmo unit_generate_nim.cmi
|
../../commons/common.cmi ../../lang_cpp/parsing/ast_cpp.cmo \
|
||||||
|
unit_generate_nim.cmi
|
||||||
unit_generate_nim.cmx : ../../commons/oUnit.cmx generate_nim.cmx \
|
unit_generate_nim.cmx : ../../commons/oUnit.cmx generate_nim.cmx \
|
||||||
../../lang_cpp/parsing/flag_parsing_cpp.cmx ../../globals/config_pfff.cmx \
|
../../lang_cpp/parsing/flag_parsing_cpp.cmx \
|
||||||
../../commons/common2.cmx ../../commons/common.cmx \
|
../../globals/config_flitter.cmx ../../commons/common2.cmx \
|
||||||
../../lang_cpp/parsing/ast_cpp.cmx unit_generate_nim.cmi
|
../../commons/common.cmx ../../lang_cpp/parsing/ast_cpp.cmx \
|
||||||
|
unit_generate_nim.cmi
|
||||||
unit_generate_nim.cmi : ../../commons/oUnit.cmi
|
unit_generate_nim.cmi : ../../commons/oUnit.cmi
|
||||||
|
|
|
||||||
|
|
@ -942,12 +942,12 @@ and process_fullType ((qualifier, typeC)) =
|
||||||
process_typeC typeC
|
process_typeC typeC
|
||||||
|
|
||||||
and process_toplevel = function
|
and process_toplevel = function
|
||||||
| NotParsedCorrectly node -> ""
|
| NotParsedCorrectly node -> "# Error parsing: " ^ process_list ~delimiter:"" process_token node
|
||||||
| DeclElem node -> process_declaration node
|
| DeclElem node -> process_declaration node
|
||||||
| CppDirectiveDecl node -> process_cpp_directive node
|
| CppDirectiveDecl node -> process_cpp_directive node
|
||||||
| IfdefDecl node -> ""
|
| IfdefDecl node -> ""
|
||||||
| MacroTop ((v1, v2, v3)) -> ""
|
| MacroTop ((v1, v2, v3)) -> "# MacroTop"
|
||||||
| MacroVarTop ((v1, v2)) -> ""
|
| MacroVarTop ((v1, v2)) -> "# MacroVarTop"
|
||||||
|
|
||||||
let iter_ast ast =
|
let iter_ast ast =
|
||||||
List.map process_toplevel ast
|
List.map process_toplevel ast
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,13 @@ let strip_string s =
|
||||||
|
|
||||||
let get_files glob =
|
let get_files glob =
|
||||||
try
|
try
|
||||||
let path = Filename.concat Config_pfff.path "/tests/generators/nim/" in
|
let path = Filename.concat Config_flitter.path "/tests/generators/nim/" in
|
||||||
sort (Common2.glob (spf "%s/%s" path glob))
|
sort (Common2.glob (spf "%s/%s" path glob))
|
||||||
with
|
with
|
||||||
Common2.CmdError (a, b) -> []
|
Common2.CmdError (a, b) -> []
|
||||||
|
|
||||||
let basename fpath =
|
let basename fpath =
|
||||||
let fullpath = Filename.concat Config_pfff.path "/tests/generators/nim//" in
|
let fullpath = Filename.concat Config_flitter.path "/tests/generators/nim//" in
|
||||||
readable ~root:fullpath fpath
|
readable ~root:fullpath fpath
|
||||||
|
|
||||||
let get_code_pairs name =
|
let get_code_pairs name =
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
config_pfff.cmo :
|
config_flitter.cmo :
|
||||||
config_pfff.cmx :
|
config_flitter.cmx :
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ TOP=..
|
||||||
##############################################################################
|
##############################################################################
|
||||||
TARGET=lib
|
TARGET=lib
|
||||||
|
|
||||||
SRC= config_pfff.ml
|
SRC= config_flitter.ml
|
||||||
|
|
||||||
LIBS=
|
LIBS=
|
||||||
INCLUDEDIRS=../commons
|
INCLUDEDIRS=../commons
|
||||||
|
|
@ -30,17 +30,17 @@ $(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa)
|
||||||
$(OCAMLOPT) -a -o $(TARGET).cmxa $(OPTOBJS)
|
$(OCAMLOPT) -a -o $(TARGET).cmxa $(OPTOBJS)
|
||||||
|
|
||||||
|
|
||||||
config_pfff.ml:
|
config_flitter.ml:
|
||||||
@echo "config_pfff.ml is missing. Have you run ./configure?"
|
@echo "config_flitter.ml is missing. Have you run ./configure?"
|
||||||
@exit 1
|
@exit 1
|
||||||
|
|
||||||
distclean::
|
distclean::
|
||||||
rm -f config_pfff.ml
|
rm -f config_flitter.ml
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# install
|
# install
|
||||||
##############################################################################
|
##############################################################################
|
||||||
LIBNAME=pfff-config
|
LIBNAME=flitter-config
|
||||||
EXPORTSRC=\
|
EXPORTSRC=\
|
||||||
|
|
||||||
install-findlib: all all.opt
|
install-findlib: all all.opt
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
let version = "0.29"
|
let version = "0.29"
|
||||||
|
|
||||||
let path =
|
let path =
|
||||||
try (Sys.getenv "PFFF_HOME")
|
try (Sys.getenv "FLITTER_HOME")
|
||||||
with Not_found->"./"
|
with Not_found->"./"
|
||||||
|
|
||||||
let std_xxx = ref (Filename.concat path "xxx.yyy")
|
let std_xxx = ref (Filename.concat path "xxx.yyy")
|
||||||
|
|
||||||
let logger =
|
let logger =
|
||||||
try Some (Sys.getenv "PFFF_LOGGER")
|
try Some (Sys.getenv "FLITTER_LOGGER")
|
||||||
with Not_found-> None
|
with Not_found-> None
|
||||||
|
|
@ -32,7 +32,7 @@ $(TARGET).cmxa: $(OPTOBJS) $(LIBS:.cma=.cmxa)
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# install
|
# install
|
||||||
##############################################################################
|
##############################################################################
|
||||||
LIBNAME=pfff-h_files-format
|
LIBNAME=flitter-h_files-format
|
||||||
EXPORTSRC=\
|
EXPORTSRC=\
|
||||||
outline.mli
|
outline.mli
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ beforedepend:: archi_code_lexer.ml
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# install
|
# install
|
||||||
##############################################################################
|
##############################################################################
|
||||||
LIBNAME=pfff-h_program-lang
|
LIBNAME=flitter-h_program-lang
|
||||||
EXPORTSRC=\
|
EXPORTSRC=\
|
||||||
ast_fuzzy.mli \
|
ast_fuzzy.mli \
|
||||||
meta_ast_generic.mli \
|
meta_ast_generic.mli \
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ open Common
|
||||||
* own code and facebook flib code.
|
* own code and facebook flib code.
|
||||||
*
|
*
|
||||||
* This is used by codemap to colorize files. This is also used
|
* This is used by codemap to colorize files. This is also used
|
||||||
* mainly for its AutoGenerated category in pfff -test_loc to
|
* mainly for its AutoGenerated category in flitter -test_loc to
|
||||||
* not count auto generated code in the LOC of a project. This
|
* not count auto generated code in the LOC of a project. This
|
||||||
* can also be used in the deadcode detector to not count auto
|
* can also be used in the deadcode detector to not count auto
|
||||||
* generated files (e.g. visitor_xxx.ml) as real users of an entity.
|
* generated files (e.g. visitor_xxx.ml) as real users of an entity.
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ let empty_database () = {
|
||||||
}
|
}
|
||||||
|
|
||||||
let default_db_name =
|
let default_db_name =
|
||||||
"PFFF_DB.marshall"
|
"FLITTER_DB.marshall"
|
||||||
|
|
||||||
|
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ open Common
|
||||||
* A few design choices:
|
* A few design choices:
|
||||||
*
|
*
|
||||||
* - one could store such information directly into database_xxx.ml
|
* - one could store such information directly into database_xxx.ml
|
||||||
* and have pfff_db compute such information (for instance each function
|
* and have flitter_db compute such information (for instance each function
|
||||||
* could have a set of properties like unit_test, or dead) but this
|
* could have a set of properties like unit_test, or dead) but this
|
||||||
* would force people to build their own db to visualize the results.
|
* would force people to build their own db to visualize the results.
|
||||||
* One could compute this information in database_light_xxx.ml, but this
|
* One could compute this information in database_light_xxx.ml, but this
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ open Common
|
||||||
(* Prelude *)
|
(* Prelude *)
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
(*
|
(*
|
||||||
* Some helpers for the different lexers and parsers in pfff.
|
* Some helpers for the different lexers and parsers in flitter.
|
||||||
* The main types are:
|
* The main types are:
|
||||||
* ('token_location' < 'token_origin' < 'token_mutable') * token_kind
|
* ('token_location' < 'token_origin' < 'token_mutable') * token_kind
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ open Common2.Infix
|
||||||
* the kencc extensions and does not allow to analyze cpp constructs.
|
* the kencc extensions and does not allow to analyze cpp constructs.
|
||||||
* CIL has two pointer analysis but they were written with bug finding
|
* CIL has two pointer analysis but they were written with bug finding
|
||||||
* in mind I think, not code comprehension which we really care about
|
* in mind I think, not code comprehension which we really care about
|
||||||
* in pfff.
|
* in flitter.
|
||||||
* In the end I thought generating datalog facts for plan9 using lang_c/
|
* In the end I thought generating datalog facts for plan9 using lang_c/
|
||||||
* was simpler that modifying CIL (moreover fixing lang_cpp/ and lang_c/
|
* was simpler that modifying CIL (moreover fixing lang_cpp/ and lang_c/
|
||||||
* to handle plan9 code was anyway needed for codemap).
|
* to handle plan9 code was anyway needed for codemap).
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ ast_cpp.cmo : ../../h_program-lang/scope_code.cmi \
|
||||||
../../h_program-lang/parse_info.cmi ../../commons/common.cmi
|
../../h_program-lang/parse_info.cmi ../../commons/common.cmi
|
||||||
ast_cpp.cmx : ../../h_program-lang/scope_code.cmx \
|
ast_cpp.cmx : ../../h_program-lang/scope_code.cmx \
|
||||||
../../h_program-lang/parse_info.cmx ../../commons/common.cmx
|
../../h_program-lang/parse_info.cmx ../../commons/common.cmx
|
||||||
flag_parsing_cpp.cmo : ../../globals/config_pfff.cmo
|
flag_parsing_cpp.cmo : ../../globals/config_flitter.cmo
|
||||||
flag_parsing_cpp.cmx : ../../globals/config_pfff.cmx
|
flag_parsing_cpp.cmx : ../../globals/config_flitter.cmx
|
||||||
lexer_cpp.cmo : parser_cpp.cmi ../../h_program-lang/parse_info.cmi \
|
lexer_cpp.cmo : parser_cpp.cmi ../../h_program-lang/parse_info.cmi \
|
||||||
flag_parsing_cpp.cmo ../../commons/common2.cmi ../../commons/common.cmi \
|
flag_parsing_cpp.cmo ../../commons/common2.cmi ../../commons/common.cmi \
|
||||||
ast_cpp.cmo
|
ast_cpp.cmo
|
||||||
|
|
@ -182,11 +182,11 @@ type_cpp.cmo : ast_cpp.cmo type_cpp.cmi
|
||||||
type_cpp.cmx : ast_cpp.cmx type_cpp.cmi
|
type_cpp.cmx : ast_cpp.cmx type_cpp.cmi
|
||||||
type_cpp.cmi : ast_cpp.cmo
|
type_cpp.cmi : ast_cpp.cmo
|
||||||
unit_parsing_cpp.cmo : parse_cpp.cmi ../../commons/oUnit.cmi \
|
unit_parsing_cpp.cmo : parse_cpp.cmi ../../commons/oUnit.cmi \
|
||||||
flag_parsing_cpp.cmo ../../globals/config_pfff.cmo \
|
flag_parsing_cpp.cmo ../../globals/config_flitter.cmo \
|
||||||
../../commons/common2.cmi ../../commons/common.cmi ast_cpp.cmo \
|
../../commons/common2.cmi ../../commons/common.cmi ast_cpp.cmo \
|
||||||
unit_parsing_cpp.cmi
|
unit_parsing_cpp.cmi
|
||||||
unit_parsing_cpp.cmx : parse_cpp.cmx ../../commons/oUnit.cmx \
|
unit_parsing_cpp.cmx : parse_cpp.cmx ../../commons/oUnit.cmx \
|
||||||
flag_parsing_cpp.cmx ../../globals/config_pfff.cmx \
|
flag_parsing_cpp.cmx ../../globals/config_flitter.cmx \
|
||||||
../../commons/common2.cmx ../../commons/common.cmx ast_cpp.cmx \
|
../../commons/common2.cmx ../../commons/common.cmx ast_cpp.cmx \
|
||||||
unit_parsing_cpp.cmi
|
unit_parsing_cpp.cmi
|
||||||
unit_parsing_cpp.cmi : ../../commons/oUnit.cmi
|
unit_parsing_cpp.cmi : ../../commons/oUnit.cmi
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ token_views_context.cmo: token_views_context.ml
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# install
|
# install
|
||||||
##############################################################################
|
##############################################################################
|
||||||
LIBNAME=pfff-lang_cpp
|
LIBNAME=flitter-lang_cpp
|
||||||
EXPORTSRC=meta_ast_cpp.mli \
|
EXPORTSRC=meta_ast_cpp.mli \
|
||||||
parser_cpp.mli parse_cpp.mli \
|
parser_cpp.mli parse_cpp.mli \
|
||||||
lib_parsing_cpp.mli visitor_cpp.mli \
|
lib_parsing_cpp.mli visitor_cpp.mli \
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
* and because templates are also qualifiers, almost all types
|
* and because templates are also qualifiers, almost all types
|
||||||
* are now mutually recursive ...
|
* are now mutually recursive ...
|
||||||
*
|
*
|
||||||
* Like most other ASTs in pfff, it's actually more a Concrete Syntax Tree.
|
* Like most other ASTs in flitter, it's actually more a Concrete Syntax Tree.
|
||||||
* Some stuff are tagged 'semantic:' which means that they are computed
|
* Some stuff are tagged 'semantic:' which means that they are computed
|
||||||
* after parsing.
|
* after parsing.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ type language =
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
|
|
||||||
let macros_h =
|
let macros_h =
|
||||||
ref (Filename.concat Config_pfff.path "/data/cpp_stdlib/macros.h")
|
ref (Filename.concat Config_flitter.path "/data/cpp_stdlib/macros.h")
|
||||||
|
|
||||||
let cmdline_flags_macrofile () = [
|
let cmdline_flags_macrofile () = [
|
||||||
"-macros", Arg.Set_string macros_h,
|
"-macros", Arg.Set_string macros_h,
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,7 @@ let (_defs : (string, Pp_token.define_body) Hashtbl.t) =
|
||||||
*)
|
*)
|
||||||
let add_defs file =
|
let add_defs file =
|
||||||
if not (Sys.file_exists file)
|
if not (Sys.file_exists file)
|
||||||
then failwith (spf "Could not find %s, have you set PFFF_HOME correctly?"
|
then failwith (spf "Could not find %s, have you set FLITTER_HOME correctly?"
|
||||||
file);
|
file);
|
||||||
pr2 (spf "Using %s macro file" file);
|
pr2 (spf "Using %s macro file" file);
|
||||||
let xs = extract_macros file in
|
let xs = extract_macros file in
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ let unittest =
|
||||||
(* Parsing *)
|
(* Parsing *)
|
||||||
(*-----------------------------------------------------------------------*)
|
(*-----------------------------------------------------------------------*)
|
||||||
"regression files" >:: (fun () ->
|
"regression files" >:: (fun () ->
|
||||||
let dir = Filename.concat Config_pfff.path "/tests/cpp/parsing" in
|
let dir = Filename.concat Config_flitter.path "/tests/cpp/parsing" in
|
||||||
let files =
|
let files =
|
||||||
Common2.glob (spf "%s/*.cpp" dir) @ Common2.glob (spf "%s/*.h" dir) in
|
Common2.glob (spf "%s/*.cpp" dir) @ Common2.glob (spf "%s/*.h" dir) in
|
||||||
files +> List.iter (fun file ->
|
files +> List.iter (fun file ->
|
||||||
|
|
@ -46,7 +46,7 @@ let unittest =
|
||||||
);
|
);
|
||||||
|
|
||||||
"rejecting bad code" >:: (fun () ->
|
"rejecting bad code" >:: (fun () ->
|
||||||
let dir = Filename.concat Config_pfff.path "/tests/cpp/parsing_errors" in
|
let dir = Filename.concat Config_flitter.path "/tests/cpp/parsing_errors" in
|
||||||
let files = Common2.glob (spf "%s/*.cpp" dir) in
|
let files = Common2.glob (spf "%s/*.cpp" dir) in
|
||||||
files +> List.iter (fun file ->
|
files +> List.iter (fun file ->
|
||||||
try
|
try
|
||||||
|
|
@ -61,7 +61,7 @@ let unittest =
|
||||||
|
|
||||||
(* parsing C files (and not C++ files) possibly containing C++ keywords *)
|
(* parsing C files (and not C++ files) possibly containing C++ keywords *)
|
||||||
"C regression files" >:: (fun () ->
|
"C regression files" >:: (fun () ->
|
||||||
let dir = Filename.concat Config_pfff.path "/tests/c/parsing" in
|
let dir = Filename.concat Config_flitter.path "/tests/c/parsing" in
|
||||||
let files =
|
let files =
|
||||||
Common2.glob (spf "%s/*.c" dir)
|
Common2.glob (spf "%s/*.c" dir)
|
||||||
(* @ Common2.glob (spf "%s/*.h" dir) *) in
|
(* @ Common2.glob (spf "%s/*.h" dir) *) in
|
||||||
|
|
|
||||||
8
main.ml
8
main.ml
|
|
@ -8,7 +8,7 @@ open Common
|
||||||
(* Purpose *)
|
(* Purpose *)
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
(*
|
(*
|
||||||
* A "driver" for the different parsers in pfff.
|
* A "driver" for the different parsers in flitter.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
|
|
@ -52,7 +52,7 @@ let test_json_pretty_printer file =
|
||||||
|
|
||||||
|
|
||||||
(* ---------------------------------------------------------------------- *)
|
(* ---------------------------------------------------------------------- *)
|
||||||
let pfff_extra_actions () = [
|
let flitter_extra_actions () = [
|
||||||
"-dump_json", " <file>",
|
"-dump_json", " <file>",
|
||||||
Common.mk_action_1_arg test_json_pretty_printer;
|
Common.mk_action_1_arg test_json_pretty_printer;
|
||||||
"-json_pp", " <file>",
|
"-json_pp", " <file>",
|
||||||
|
|
@ -64,7 +64,7 @@ let pfff_extra_actions () = [
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
|
|
||||||
let all_actions () =
|
let all_actions () =
|
||||||
pfff_extra_actions() @
|
flitter_extra_actions() @
|
||||||
Test_parsing_c.actions()@
|
Test_parsing_c.actions()@
|
||||||
Test_parsing_cpp.actions()@
|
Test_parsing_cpp.actions()@
|
||||||
Generate_nim.actions()@
|
Generate_nim.actions()@
|
||||||
|
|
@ -96,7 +96,7 @@ let options () = [
|
||||||
Common2.cmdline_flags_other () @
|
Common2.cmdline_flags_other () @
|
||||||
[
|
[
|
||||||
"-version", Arg.Unit (fun () ->
|
"-version", Arg.Unit (fun () ->
|
||||||
pr2 (spf "pfff version: %s" Config_pfff.version);
|
pr2 (spf "flitter version: %s" Config_flitter.version);
|
||||||
exit 0;
|
exit 0;
|
||||||
), " guess what";
|
), " guess what";
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ let options () = [
|
||||||
Common2.cmdline_flags_other () @
|
Common2.cmdline_flags_other () @
|
||||||
[
|
[
|
||||||
"-version", Arg.Unit (fun () ->
|
"-version", Arg.Unit (fun () ->
|
||||||
pr2 (spf "pfff (test) version: %s" Config_pfff.version);
|
pr2 (spf "flitter (test) version: %s" Config_flitter.version);
|
||||||
exit 0;
|
exit 0;
|
||||||
),
|
),
|
||||||
" guess what";
|
" guess what";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue