From: Jean Privat Date: Fri, 27 Sep 2019 12:54:46 +0000 (-0400) Subject: Merge: Contract implementation X-Git-Url: http://nitlanguage.org?hp=0de7df7c850bb5b1f1699c7cd474d9f96d2e5d32 Merge: Contract implementation # Contract. This pr is a copy of #2747 with some modifications. It has a dependency with the #2779 and #2788. Adding programming by contract (Design by contract) in Nit language. Contracts works with nit annotations. I decided to cut the contract pr in a smaller part to facilitate reviewing (some feature are not available on it, see section futur feature). ## Annotations To define a new contract you need to use the corresponding annotation. For example it's possible to define a contract that x parameter must be strictly greater than 5. To do it would be necessary to define the contract in the following way `expects(x > 5)`. All expressions returning a boolean (comparison...) can be used as a condition. Three annotations were added: - `expects` to indicate the conditions need to the execution of the methods - `ensures` to indicate the conditions of guarantee at the end of the execution of the methods - `no_contract` to remove the inherited contract This syntaxe is choose because in the next version of c++ (20) (see [P1369](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1369r0.pdf) for a overview) the contract will be define with the keywords expects and ensures. So I think it would be interesting to keep the same principle. But if all nit developper prefer to use `require` and `ensure` it's fine to change it. ## Method contract (ensures, expects) For each method it's possible to define preconditions (`expects`) and post-conditions (`ensures`). If the call of the method satisfies the prerequisites (`expects`) of the method, the caller may assume that the return conditions (`ensures`) will be satisfied. The method contracts can access all the parameters of the method as well as the set of attributes/methods visible in the context of the method. i.e the set of parameters and the set of methods and attributes of the current class can be used (attributes declare locally in the method can not be used). For post-conditions (ensures) the `result` attribute has been added to perform a check on the return value of the method. Currently it's not possible to refer an old value in a ensures (exemple old(length) == length + 1). ## Process ### Building contract phase A phase is executed to check all the methods. This check is done to know if: - The method is annotated (redefined or not) - The method is a redefinition of a method already having a contract (i.e a method that does not add any new conditions to the existing contract). When a contract is detected the code is `extended` to add the verification features. Two methods are created. The first method is the contract face. Its goal is to provide the call of the contract verification and the call of the original method. With this strategy, the original code of the method is preserved. The second created method is for the contract verification. #### Exemple ##### Expect: ```nit class MyClass fun foo(x: Int) is expects(x > 0) do [...] end end ``` Representation of the compiled class ```nit class MyClass fun foo(x: Int) is expects(x > 0) do [...] end fun _contract_foo(x: Int) do _expects_foo(x) foo(x) end fun _expects_foo(x: Int) do assert x > 0 end end ``` ##### Ensure: ```nit class MyClass fun foo(x: Int): Bool is ensures(result == true) do [...] return true end end ``` Representation of the compiled class ```nit class MyClass fun foo(x: Int): Bool is ensures(result == true) do [...] return result end fun _contract_foo(x: Intl): Bool do var result = foo(x) _ensures_foo(x, result) return result end fun _ensures_foo(x: Int, result: Bool) do assert result == true end end ``` ## Inheritance Contracts support redefinition and adding condition. Note that when a contract is define in a parent class, it's no longer possible to remove this contract on all the classes that inherit or redefine them. They only need to be increased according to different subtyping rules. All preconditions (expects) can be weakened. i.e it's possible to provide a new alternative to validate the contract. This corresponds to the use of a logical OR between the old and the new conditions. All post-conditions (ensure) can be consolidate. i.e the new condition of the contract will provide a new guarantee to the user of the method. This rule can be translates into a logical AND between the old and the new conditions. ### Exemple #### Expect ```nit class SubMyClass super MyClass redef fun foo(x: Int) is expects(x > 0, x == 0) do [...] end redef fun _expects_foo(x: Int) do if x == 0 then return super(x) end redef fun _contract_foo(x: Int) do _expects_foo super(x) end end ``` #### Ensure ```nit class SubMyClass super MyClass redef fun foo(x: Int): Bool is ensures(result == true, x > 0) do [...] end redef fun _ensures_foo(x: Int, result: Bool) do super assert super(x, result) end redef fun _contract_foo(x: Int, result: Bool): Bool do var result = super _ensures_foo(x, result) return result end end ``` Summary | Annotation | Inheritance condition type | | ------------- | -------------| | expects | and | | ensures | or | ## Invocation All calls to contract methods are intercepted to call the contract version. For the moment the contracts are systematically called, whether it's an internal or external call. Only calls to super do not execute the contracts. This part is subject to evolution with a parameter to activate or not the internal call verification. ## Building Since contracts are expensive in resource, several levels of use have been defined based on the needed verification: - No contract: all contracts are disable (option `--no-contract`). - Default: By default the contracts can be defined as "semi-global". I.E. All contracts (ensures, expects)used in the main package are enabled, the expects contracts are enabled (ensures contracts are disable) in direct imported package. Other indirected imported package doesn't have active contract. - Full contract: Contracts are enable (ensures, expects) on all classes (option `--full-contract`). ## Future work This pr has been simplified to facilitate the reviewing. Future features: - Support class invariant contracts - Ability to put contracts on auto-getters and setter - Detection of query or command to avoid the contract to change the object state (this functionality will probably be an advice because it's difficult to define if a method has no side effect.) - `Old` support for the ensures contract to refer at the same value during the expects condition Some pr will follow to use the contacts directly in the lib (collection...). ### Note Currently the syntax of contracts is strict, only comparisons and method calls returning bouleans can be used. Indeed the arguments passed to the annotation of contract are directly used for assert. A solution would be given a more open syntax for more complex contracts instead of using a method. But this would cause problems in the syntax of annotations. If you have any suggestion don't hesitate. An issue is available to talk about the potential syntax. (#1340) Pull-Request: #2790 Reviewed-by: Jean Privat --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7bb7ada..fd21031 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,6 +29,7 @@ before_script: - git config --add github.oauthtoken "$GITHUB_OAUTHTOKEN" # needed for github api rate limit - pwd - ccache -s + - ccache -z - ccache -M 500M - du -sh .gradle || true - type -a nitc nitdoc || true # is there some nit tools? @@ -38,7 +39,7 @@ after_script: - export CCACHE_DIR=$PWD/.ccache - ccache -s - du -sh .gradle || true - - git status --ignored + - git status --ignored || true - date - tail status.txt @@ -51,7 +52,7 @@ sanity_checks: - misc/jenkins/checksignedoffby.sh | tee -a status.txt - misc/jenkins/checklicense.sh | tee -a status.txt -build_tools: +build_tools: &build_tools stage: build script: - make 2>> status.txt @@ -65,7 +66,7 @@ build_tools: - src/nitc_0 when: always -test_some: +test_some: &test_some stage: test dependencies: - build_tools @@ -77,7 +78,7 @@ test_some: artifacts: paths: - tests/errlist - - tests/*.xml + - tests/*.xml* when: always reports: junit: tests/*.xml @@ -87,9 +88,11 @@ nitunit_some: dependencies: - build_tools script: - - git diff --name-only origin/master..HEAD -- "*.nit" "*.res" "README.*" | grep -v "^tests/" > list0.txt || true + - git diff --name-only origin/master..HEAD -- "*.nit" "*.res" "README.*" | grep -v "^tests/\|contrib/" > list0.txt || true - xargs nitls -pP < list0.txt > list.txt + - test -s list.txt || exit 0 - xargs nitunit < list.txt + - junit2html nitunit.xml artifacts: paths: - nitunit.xml* @@ -119,11 +122,12 @@ basic_android: # TEST FULL ######################################################### -test_full_nitcs: +test_full_nitcs: &test_full_nitcs stage: more_test dependencies: - build_tools script: + - share/android-bdwgc/setup.sh - cd tests - ./testfull.sh | tee log.txt - grep -v '=>' log.txt > ../status.txt || true @@ -220,6 +224,7 @@ nitunit_lib: - xargs nitunit -v < list.txt| tee log.txt - grep -e KO log.txt > status.txt || true - tail -3 log.txt >> status.txt + - junit2html nitunit.xml artifacts: paths: - nitunit.xml* @@ -237,6 +242,7 @@ nitunit_src: - xargs nitunit -v < list.txt| tee log.txt - grep -e KO log.txt > status.txt || true - tail -3 log.txt >> status.txt + - junit2html nitunit.xml artifacts: paths: - nitunit.xml* @@ -286,6 +292,22 @@ build_oot: # MISC ############################################################## +check_requirments: + stage: more_test + image: debian:buster + before_script: + - date # cancel the default `before_script`, an empty list does nothing + script: # from the README + - apt-get update && apt-get install --yes --no-install-recommends build-essential ccache libgc-dev libunwind-dev pkg-config + - make + - bin/nitc examples/hello_world.nit + - ./hello_world + - . misc/nit_env.sh install + - nitc examples/hello_world.nit + - ./hello_world + - apt-get update && apt-get install --yes --no-install-recommends graphviz libcurl4-openssl-dev libevent-dev libmongoc-dev + - make more + bootstrap_full: stage: more_test dependencies: @@ -328,6 +350,21 @@ build_more_tools: - src/version.nit - src/nitc_0 +valgrind: + stage: more_test + dependencies: + - build_more_tools + script: + - mkdir -p valgrind.out + - nitc src/nitc.nit # To warm-up the cache + - src/valgrind.sh --callgrind-out-file=valgrind.out/nitc.nitc.out nitc src/nitc.nit -vv + - callgrind_annotate valgrind.out/nitc.nitc.out > valgrind.out/nitc.nitc.txt + - src/valgrind.sh --callgrind-out-file=valgrind.out/niti.niti.out nit -- src/nit.nit tests/base_simple3.nit -vv + - callgrind_annotate valgrind.out/niti.niti.out > valgrind.out/niti.niti.txt + artifacts: + paths: + - valgrind.out + build_doc: stage: more_test dependencies: @@ -339,6 +376,27 @@ build_doc: paths: - nitdoc.out +build_manual: + stage: more_test + script: + - apt-get update && apt-get install --yes --no-install-recommends pandoc texlive texlive-latex-extra lmodern + - make -C doc/manual + artifacts: + paths: + - doc/manual/*.pdf + - doc/manual/*.epub + +nitmetrics: + stage: more_test + dependencies: + - build_more_tools + script: + - mkdir -p nitmetrics.out + - nitmetrics --all --log --log-dir nitmetrics.out --dir nitmetrics.out --keep-going lib src | tee nitmetrics.out/metrics.txt + artifacts: + paths: + - nitmetrics.out + build_catalog: stage: more_test dependencies: @@ -350,17 +408,49 @@ build_catalog: - ./oot.sh pre-build - cd .. - nitcatalog -d catalog.out lib/ examples/ contrib/ contrib/oot/ - dependencies: - - build_more_tools artifacts: paths: - catalog.out -.test_macos: +build_tools_macos: + <<: *build_tools + tags: + - macos + +test_some_macos: + <<: *test_some + tags: + - macos + dependencies: + - build_tools_macos + +test_full_nitcs_macos: + <<: *test_full_nitcs + tags: + - macos + dependencies: + - build_tools_macos + +bench_old: + stage: more_test + tags: + - perf + dependencies: + - build_tools script: - - uname - - pwd - - ls / + - benchmarks/bench_old.sh + allow_failure: true # time is unreliable. manual check required + services: [] + +build_tools_windows: stage: build + before_script: + - date + after_script: + - date tags: - - macos + - windows + script: + - $project_dir = "$CI_PROJECT_DIR" -replace "\\", "\\\" + - $converted_project_dir = $(c:\msys64\usr\bin\bash -l -c "cygpath -u $project_dir") + - c:\msys64\usr\bin\env MSYSTEM=MINGW64 c:\msys64\usr\bin\bash -l -c "cd $converted_project_dir; make" diff --git a/README.md b/README.md index 2679f4d..e499bbb 100644 --- a/README.md +++ b/README.md @@ -19,20 +19,19 @@ Requirements: * pkg-config http://www.freedesktop.org/wiki/Software/pkg-config/ * ccache http://ccache.samba.org/ to improve recompilation * libgc-dev http://hboehm.info/gc/ - * graphviz http://www.graphviz.org/ to enable graphs with the nitdoc tool * libunwind http://nongnu.org/libunwind Those are available in most Linux distributions - $ sudo apt-get install build-essential ccache libgc-dev graphviz libunwind-dev pkg-config + $ sudo apt-get install build-essential ccache libgc-dev libunwind-dev pkg-config and on OS X using brew - $ brew install ccache bdw-gc graphviz libunwind-headers pkgconfig + $ brew install ccache bdw-gc libunwind-headers pkgconfig or with MacPorts - $ sudo port install ccache boehmgc graphviz libunwind-headers pkgconfig + $ sudo port install ccache boehmgc libunwind-headers pkgconfig Important files and directories: @@ -65,6 +64,20 @@ To have your environment automatically configured at login, just source it with $ . misc/nit_env.sh install + +More tools: + +Additional tools can also be compiled but require more dependencies. + + * graphviz http://www.graphviz.org/ to enable graphs with the nitdoc tool + * libcurl https://curl.haxx.se/libcurl/ for the nit package manager nitpm + * libevent https://libevent.org/ for the nit documentation server nitweb + * libmongoc http://mongoc.org/ also for nitweb + + $ sudo apt-get install graphviz libcurl4-openssl-dev libevent-dev libmongoc-dev + $ make more + + Contributing: To contribute to Nit, please see [CONTRIBUTING](CONTRIBUTING.md). diff --git a/benchmarks/bench_old.sh b/benchmarks/bench_old.sh new file mode 100755 index 0000000..0111aa7 --- /dev/null +++ b/benchmarks/bench_old.sh @@ -0,0 +1,87 @@ +#!/bin/bash +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This shell script run and compare nitc with the one in origin/master + +# execute a command multiple time and store its executin metrics +# $1 = output file (.tsv) +# $2. = command to execute +bench_one() { + out=$1 + shift + > "$out" + echo "> $*" + echo -e "user\treal\t%cpu\tmem" + for i in `seq 6`; do + /usr/bin/time -o "$out" -a -f "%U\t%e\t%P\t%M" "$@" >/dev/null + tail -n 1 "$out" + done +} + +# Get column $2, $3-th lowest value of tsv file $1 +get() { + cut -f "$2" < "$1" | sort -n | head -n "$3" | tail -n 1 +} + +# $1 + result% = $2 +percent() { + perl -e "printf '%+.1f', ($2/$1-1)*100;" +} + +# compare two tsv generated by `bench_one`. +# displays numbers and returns 1 if some execution metrics is above a threshold +compare() { + # Chose the median value + u1=`get "$1" 1 3` + e1=`get "$1" 2 3` + m1=`get "$1" 4 3` + u2=`get "$2" 1 3` + e2=`get "$2" 2 3` + m2=`get "$2" 4 3` + ud=`percent "$u1" "$u2"` + ed=`percent "$e1" "$e2"` + md=`percent "$m1" "$m2"` + echo "Before: user=$u1 real=$e1 mem=$m1" + echo "After: user=$u2 ($ud%) real=$e2 ($ed%) mem=$m2 ($md%)" + # Fail if above threshold + perl -e "exit ($ud>=3 || $ed>=5 || $md>=0.3)" +} + +set -e +#set -x + +old=`git show --pretty="%h %D" --no-patch origin/master` +new=`git show --pretty="%h %D" --no-patch` +if [ ! -f bin/nitc_old ]; then + git checkout origin/master + nitc --semi-global src/nitc.nit -o bin/nitc_old -v + nitc --semi-global src/nit.nit -o bin/nit_old -v + git checkout - +fi + +bench_one "nitc_old.tsv" nitc_old --no-cc src/nitc.nit +bench_one "nitc_new.tsv" nitc --no-cc src/nitc.nit +bench_one "nit_old.tsv" nit_old -- src/nitls.nit -p lib/core +bench_one "nit_new.tsv" nit -- src/nitls.nit -p lib/core + +echo +echo "Before is $old" +echo "After is $new" +echo "For nitc src/nitls.nit:" +ret=0 +compare "nitc_old.tsv" "nitc_new.tsv" || ret=1 +echo "For nit src/nitls.nit -p lib/core:" +compare "nit_old.tsv" "nit_new.tsv" || ret=1 +exit "$ret" diff --git a/contrib/benitlux/src/client/android.nit b/contrib/benitlux/src/client/android.nit index ee51327..3495f6c 100644 --- a/contrib/benitlux/src/client/android.nit +++ b/contrib/benitlux/src/client/android.nit @@ -52,7 +52,7 @@ redef class App android.content.IntentFilter filter = new android.content.IntentFilter(); filter.addAction(android.net.wifi.WifiManager.SCAN_RESULTS_AVAILABLE_ACTION); - final int final_self = self; + final nit.app.NitObject final_self = self; App_incr_ref(final_self); context.registerReceiver( @@ -197,7 +197,7 @@ redef class BeerView final String final_title = title; final boolean final_loggedin = loggedin; - final int final_self = self; + final nit.app.NitObject final_self = self; BeerView_incr_ref(self); // Nit GC view.setOnTouchListener(new android.view.View.OnTouchListener() { diff --git a/contrib/github_merge/github_merge.nit b/contrib/github_merge/github_merge.nit index f0717ff..cdb9de5 100644 --- a/contrib/github_merge/github_merge.nit +++ b/contrib/github_merge/github_merge.nit @@ -15,90 +15,77 @@ # Query the Github PR API to perform a merge module github_merge -import github::github_curl +import github::api import template import config -redef class Object - # Factorize cast - fun json_as_a: JsonArray do return self.as(JsonArray) - # Factorize cast - fun json_as_map: JsonObject do return self.as(JsonObject) -end +redef class GithubAPI -redef class GithubCurl - # Get a given pull request (PR) - fun getpr(repo: String, number: Int): nullable JsonObject - do - var ir = get_and_check("https://api.github.com/repos/{repo}/issues/{number}") - var irm = ir.json_as_map - if not irm.has_key("pull_request") then return null - var pr = get_and_check("https://api.github.com/repos/{repo}/pulls/{number}") - var prm = pr.json_as_map - var sha = prm["head"].json_as_map["sha"].to_s - var statuses = get_and_check("https://api.github.com/repos/{repo}/commits/{sha}/status") - statuses = statuses.json_as_map - prm["statuses"] = statuses - print "{prm["title"].to_s}: by {prm["user"].json_as_map["login"].to_s} (# {prm["number"].to_s})" - var mergeable = prm["mergeable"] - if mergeable != null then - print "\tmergeable: {mergeable.to_s}" - else - print "\tmergeable: unknown" - end - var state = statuses["state"] - if state == null then - print "\tstatus: not tested" - else - print "\tstatus: {state}" - var sts = statuses["statuses"].json_as_a - for st in sts do - st = st.json_as_map - var ctx = st["context"].to_s - state = st["state"].to_s - print "\tstatus {ctx}: {state}" - prm["status-{ctx}"] = state - end - end - return prm + # Get a given pull request and its state + private fun get_pull_with_state(repo: String, number: Int): nullable PullState do + var pull = get_pull(repo, number) + if not pull isa PullRequest then return null + + var statuses = get_commit_status(repo, pull.head.sha) + if not statuses isa CommitStatus then return null + + return new PullState(pull, statuses) end # Get reviewers of a PR - fun getrev(repo: String, pr: JsonObject): Array[String] - do - var number = pr["number"].as(Int) - var user = pr["user"].json_as_map["login"].as(String) - var comments = new Array[nullable Object] - comments.add_all(get_and_check("https://api.github.com/repos/{repo}/issues/{number}/comments").json_as_a) - comments.add_all(get_and_check("https://api.github.com/repos/{repo}/pulls/{number}/comments").json_as_a) + private fun get_pull_reviewers(repo: String, pull: PullRequest): Array[String] do + var user = pull.user.as(not null).login + + var comments = new Array[Comment] + comments.add_all(get_issue_comments(repo, pull.number)) + comments.add_all(get_pull_comments(repo, pull.number)) + var logins = new Array[String] - for c in comments do - var cm = c.json_as_map - var l = cm["user"].json_as_map["login"] - assert l isa String - if l != user and not logins.has(l) then logins.add(l) + for comment in comments do + var login = comment.user.login + if login != user and not logins.has(login) then logins.add(login) end var res = new Array[String] - for l in logins do - var u = get_and_check("https://api.github.com/users/{l}").json_as_map - if not u.has_key("name") or u["name"] == null or not u.has_key("email")or u["email"] == null then - print "No public name/email for user {l}" + for login in logins do + var rev = get_user(login) + if rev == null or rev.name == null or rev.email == null then + print "No public name/email for user {login}" continue end - var r = "{u["name"].to_s} <{u["email"].to_s}>" - res.add r - + res.add "{rev.name or else "N/A"} <{rev.email or else "N/A"}>" end return res end +end + +private class PullState + var pull: PullRequest + var status: CommitStatus + + fun pretty: String do + var s = new Buffer + s.append "{pull.title}: by {pull.user.as(not null).login} (# {pull.number})\n" + s.append "\tmergeable: {pull.mergeable or else "unknown"}\n" + s.append "\tstatus: {status.state or else "not tested"}\n" + for sub in status.statuses do + s.append "\tstatus {sub.context or else "N/A"}: {sub.state or else "N/A"}\n" + end + return s.write_to_string + end + fun state_for(context: String): nullable String do + for sub in status.statuses do + if sub.context == context then return sub.state + end + return null + end end if "NIT_TESTING".environ == "true" then exit 0 var opt_repo = new OptionString("Repository (e.g. nitlang/nit)", "-r", "--repo") var opt_auth = new OptionString("OAuth token", "--auth") -var opt_query = new OptionString("Query to get issues (e.g. label=ok_will_merge)", "-q", "--query") +var opt_query = new OptionString("Query to get issues (e.g. label:ok_will_merge)", "-q", "--query") var opt_keepgoing = new OptionBool("Skip merge conflicts", "-k", "--keep-going") var opt_all = new OptionBool("Merge all", "-a", "--all") var opt_status = new OptionArray("A status context that must be \"success\" (e.g. default)", "--status") @@ -131,23 +118,32 @@ var repo = opt_repo.value or else "nitlang/nit" var query = opt_query.value or else "labels=ok_will_merge" -var curl = new GithubCurl(auth, "Merge-o-matic (nitlang/nit)") +var api = new GithubAPI(auth, "Merge-o-matic (nitlang/nit)") if args.is_empty then # Without args, list `ok_will_merge` - var x = curl.get_and_check("https://api.github.com/repos/{repo}/issues?{query}") + var issues = api.search_repo_issues(repo, query) + if issues == null or issues.items.is_empty then + print "No issues for query `{query}`." + exit 1 + end var list = new Array[String] - for y in x.json_as_a do - var number = y.json_as_map["number"].as(Int) - var pr = curl.getpr(repo, number) - if pr == null then continue + for issue in issues.as(not null).items do + if not issue isa Issue then continue + if not issue.is_pull_request then continue + + var state = api.get_pull_with_state(repo, issue.number) + if not state isa PullState then continue + + print state.pretty for ctx in opt_status.value do - if pr.get_or_null("status-{ctx}") != "success" then + if state.state_for(ctx) != "success" then print "No \"success\" for {ctx}. Skip." - continue label + # continue label end end - list.add number.to_s + + list.add issue.number.to_s end label if not opt_all.value then return @@ -157,23 +153,24 @@ end for arg in args do # With a arg, merge the PR var number = arg.to_i - var pr = curl.getpr(repo, number) - if pr == null then + var pull = api.get_pull(repo, number) + if pull == null then print "Not a PR: {number}" return end - var revs = curl.getrev(repo, pr) + + var revs = api.get_pull_reviewers(repo, pull) var mergemsg = new Template - mergemsg.add "Merge: {pr["title"].to_s}\n\n" - mergemsg.add "{pr["body"].to_s}\n\n" - mergemsg.add "Pull-Request: #{pr["number"].to_s}\n" - for r in revs do - mergemsg.add "Reviewed-by: {r}\n" + mergemsg.add "Merge: {pull.title}\n\n" + mergemsg.add "{pull.body or else "N/A"}\n\n" + mergemsg.add "Pull-Request: #{pull.number}\n" + for rev in revs do + mergemsg.add "Reviewed-by: {rev}\n" end mergemsg.write_to_file("mergemsg") - var sha = pr["head"].json_as_map["sha"].as(String) + var sha = pull.head.sha if system("git show -s --pretty=format:%h {sha}") != 0 then print "Commit {sha} not in local repository; did you fetch github?" return diff --git a/contrib/github_search_for_jni/src/github_search_for_jni.nit b/contrib/github_search_for_jni/src/github_search_for_jni.nit index 8029b2e..f9927c1 100644 --- a/contrib/github_search_for_jni/src/github_search_for_jni.nit +++ b/contrib/github_search_for_jni/src/github_search_for_jni.nit @@ -17,7 +17,8 @@ # Script to scan Github for repositories possibly using JNI. module github_search_for_jni -import github::github_curl +import github::api +import json::static # The proprieties introduced by this redef are to be used only on a JSON object # representing a Github repository. @@ -51,8 +52,8 @@ end # Query sent to Github var main_query = "language:java" -# Curl instance use for all requests -var curl = new GithubCurl("OAUTH TOKEN (replace with your own)", "JNI project finder (nitlanguage.org)") +# API client instance use for all requests +var api = new GithubAPI("OAUTH TOKEN (replace with your own)", "JNI project finder (nitlanguage.org)") if "NIT_TESTING".environ == "true" then exit 0 @@ -61,8 +62,8 @@ var page = 0 var per_page = 100 loop # Get a page of the main query - var uri = "https://api.github.com/search/repositories?q={main_query}&page={page}&per_page={per_page}&sort=stars" - var obj = curl.get_and_check(uri).as(JsonObject) + var uri = "/search/repositories?q={main_query}&page={page}&per_page={per_page}&sort=stars" + var obj = api.send("GET", uri).parse_json.as(JsonObject) # Main object has "total_count" and "items" var items = obj["items"].as(JsonArray) @@ -77,7 +78,7 @@ loop # Download the language list var lang_url = item["languages_url"].as(String) - var langs = curl.get_and_check(lang_url).as(JsonObject) + var langs = api.send("GET", lang_url).parse_json.as(JsonObject) # The project is of interest if it has lots of Java and at least some C var may_be_of_interest = langs.has_lots_of_java and langs.has_some_c diff --git a/contrib/neo_doxygen/Makefile b/contrib/neo_doxygen/Makefile deleted file mode 100644 index ccda8cb..0000000 --- a/contrib/neo_doxygen/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -NITC ?= nitc -NITLS ?= nitls -NITUNIT ?= nitunit -NITDOC ?= nitdoc - -NEO4J_DIR=/var/lib/neo4j -OLD_PWD=${PWD} - -.PHONY: all -all: bin/neo_doxygen - -bin/neo_doxygen: $(shell $(NITLS) -M src/neo_doxygen.nit) - mkdir -p bin/ - $(NITC) src/neo_doxygen.nit -o bin/neo_doxygen - -.PHONY: check -check: - $(NITUNIT) . - -# Reset the local graph. -.PHONY: reset-neo -reset-neo: - sudo -u neo4j "${NEO4J_DIR}/bin/neo4j" stop \ - && sudo -u neo4j rm -rf "${NEO4J_DIR}/data/graph.db" \ - && sudo -u neo4j "${NEO4J_DIR}/bin/neo4j" start - -# Regenerate the XML documents in `tests`. -.PHONY: tests -tests: - $(MAKE) -C tests - -# Run the tests. -.PHONY: run-tests -run-tests: - cd ../../tests; \ - ./tests.sh ../contrib/neo_doxygen/src/tests/neo_doxygen_*.nit ; \ - cd "${OLD_PWD}" - -.PHONY: doc -doc: - $(NITDOC) . -o doc/ - -.PHONY: clean -clean: - rm -rf bin/ - rm -rf doc/ diff --git a/contrib/neo_doxygen/README.md b/contrib/neo_doxygen/README.md deleted file mode 100644 index c33e770..0000000 --- a/contrib/neo_doxygen/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# neo_doxygen - -This project provides a tool to convert a Doxygen XML output into a model in -Neo4j that is readable by the `nx` tool. - - -## Installation - -Ensure that you have a working version of `nitc` in `../../bin` then run `make` -in the present directory. The executable will be then generated at -`bin/neo_doxygen`. - - -## Usage - -Here is the procedure to generate an HTML documentation of a project using the -formatting of Nitdoc: - -1. First run Doxygen to generate an XML output of the documentation. In order to do -this, you have to enable the `GENERATE_XML` option. Note that you can disable -the `XML_PROGRAMLISTING` to speed up the process and save disk space. - - Important - - `neo_doxygen` do not read the `index.xml` file to know which file to load. As a - result, it may read files let by previous runs of Doxygen. To avoid producing - garbage, always clear the destination directory of the XML files before running - Doxygen. - - Example: `rm -rf doxygen/xml && doxygen Doxyfile` - -2. Use `bin/neo_doxygen` to generate the Neo4j graph. For details, run -`bin/neo_doxygen --help`. - - Important - - `neo_doxygen` do not remove what is already in the graph. So, you have to - manualy clear the graph (or at least, the subgraph contaning all the nodes - labelled with the specified project name) between each run. - - For an example of how to delete an entire Neo4j database, see - `make reset-neo`. - - Example: `make reset-neo && neo_doxygen my_project doxygen/xml` - -3. Use the `nx` tool to generate the HTML documentation from the previously -generated graph. - - Note: `nx` need to be configured before usage. For more details, refer to - the documentation of `nx`. - - Example: `nx neo doc my_project` - - -## Shell scripts - -The two shell scripts (`gen-one.sh` and `gen-all.sh`) are provided to automate -the execution of `neo_doxygen` and `nx` for some typical cases and to give a -starting for the development of similar scripts. In order for them to work, -each project on which they operate **must** contain the following files: - - * The `.nx_config` configuration file for the `nx` tool, located at the root - of the project. - - * The XML documents generated by Doxygen, located in the `doxygen/xml` - directory. - -Also, they **must** be run with the current working directory set to the present -directory. `gen-one.sh` handle only one project at a time while `gen-all.sh` -works on a collection of projects grouped in a directory. For detail about how -to invoke each script, see the comments in these scripts. - - -## Brief descriptions - -To populate the first line of a description (used as brief description in -Nitdoc), `neo_doxygen` uses the brief description provided by Doxygen. So, you -may need to change settings like `JAVADOC_AUTOBRIEF`, `QT_AUTOBRIEF` and -`MULTILINE_CPP_IS_BRIEF` in Doxygen to make `neo_doxygen` properly split the -brief description from the detailed description. In absence of brief -description, `neo_doxygen` will use the first block (usually, the first -paragraph) of the detailed as brief description. - - -## Python - -The built-in filter of Doxygen for Python is very basic. For example, it -recognizes anything in the “docstrings” as verbatim detailed description. In -order to enhance the processing of the Python scripts, the -[doxypypy](https://github.com/Feneric/doxypypy) filter may be used. diff --git a/contrib/neo_doxygen/gen-all.sh b/contrib/neo_doxygen/gen-all.sh deleted file mode 100755 index 4a19e9a..0000000 --- a/contrib/neo_doxygen/gen-all.sh +++ /dev/null @@ -1,33 +0,0 @@ -#! /bin/bash - -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ./gen-all.sh -# -# Document all projects in the specified directory. -# -# Projects are direct sub-directories of the specified directory. -# Every project directory must contain a `.nx_config` file. -# Also, every project must include the Doxygen XML output in its `doxygen/xml` -# directory. - -for dir in "$2"/*; do - if [ -d "$dir" ]; then - if [ -f "$dir/.nx_config" ]; then - # Note: gen-one.sh already prints errors. - ./gen-one.sh "$1" "$dir" || exit - fi - fi -done diff --git a/contrib/neo_doxygen/gen-one.sh b/contrib/neo_doxygen/gen-one.sh deleted file mode 100755 index 2621c8d..0000000 --- a/contrib/neo_doxygen/gen-one.sh +++ /dev/null @@ -1,38 +0,0 @@ -#! /bin/bash - -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ./gen-one.sh -# -# Document the project in the specified directory. -# -# The project name is the basename of the specified directory. -# The project directory must contain a `.nx_config` file. -# Also, the directory must include the Doxygen XML output in its `doxygen/xml` -# subdirectory. - -NEO_DOXYGEN="${PWD}/bin/neo_doxygen" -NX="${PWD}/../../bin/nx" -dir=$2 - -. sh-lib/errors.sh - -echo "$0: Documenting \"${dir##*/}\"..." -pushd "$dir" -try "$NEO_DOXYGEN" --src-lang "$1" --dest http://localhost:7474 -- "${dir##*/}" "$dir/doxygen/xml" -try echo "$0: [done] neo_doxygen" -try "$NX" neo doc "${dir##*/}" -try echo "$0: [done] nx" -popd diff --git a/contrib/neo_doxygen/package.ini b/contrib/neo_doxygen/package.ini deleted file mode 100644 index 3abb23b..0000000 --- a/contrib/neo_doxygen/package.ini +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name=neo_doxygen -tags=devel,cli -maintainer=Jean-Christophe Beaupré -license=Apache-2.0 -desc=neo_doxygen, a tool to convert a Doxygen XML output into a Neo4j model -[upstream] -browse=https://github.com/nitlang/nit/tree/master/contrib/neo_doxygen/ -git=https://github.com/nitlang/nit.git -git.directory=contrib/neo_doxygen/ -homepage=http://nitlanguage.org -issues=https://github.com/nitlang/nit/issues diff --git a/contrib/neo_doxygen/sh-lib/README.md b/contrib/neo_doxygen/sh-lib/README.md deleted file mode 100644 index ade333a..0000000 --- a/contrib/neo_doxygen/sh-lib/README.md +++ /dev/null @@ -1 +0,0 @@ -Libraries used by shell scripts. diff --git a/contrib/neo_doxygen/sh-lib/errors.sh b/contrib/neo_doxygen/sh-lib/errors.sh deleted file mode 100644 index dc5335b..0000000 --- a/contrib/neo_doxygen/sh-lib/errors.sh +++ /dev/null @@ -1,46 +0,0 @@ -#! /bin/bash - -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Error handling. - -# The program’s name. -prog_name=$0 - -# Run the specified command and exit in case of error. -function try { - "$@" - local status=$? - if [ $status -ne 0 ]; then - >&2 echo "${prog_name}: Error: \`$1\` failed with exit status ${status}." - trace - exit "$status" - fi - return 0 -} - -# Print the stack trace. -function trace { - local frame=0 - >&2 caller $frame - local has_next=$? - while [ $has_next = 0 ]; do - ((frame++)); - >&2 caller $frame - has_next=$? - done - >&2 echo "---" - return 0 -} diff --git a/contrib/neo_doxygen/sh-lib/more_sed.sh b/contrib/neo_doxygen/sh-lib/more_sed.sh deleted file mode 100644 index db58b69..0000000 --- a/contrib/neo_doxygen/sh-lib/more_sed.sh +++ /dev/null @@ -1,37 +0,0 @@ -#! /bin/sh - -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Functions related to the `sed` utility. - -# Replace `$1` by `$2` in the specified files (the rest of the arguments). -# -# Replacements are done in place. -# -# SETS: `local_1` -# SETS: `local_2` -replace() { - local_1=`escape_to_bre "$1"` - local_2=`escape_to_bre "$2"` - shift 2 - sed -s -i -e s."${local_1}"."${local_2}".g -- "$@" - unset local_1 - unset local_2 -} - -# Escape `$1` for inclusion in a POSIX BRE. -escape_to_bre() { - echo "$1" | sed -e 's/\*\|\.\|\^\|\$\|\[\|\\/\\\0/g' -} diff --git a/contrib/neo_doxygen/src/doxml/compounddef.nit b/contrib/neo_doxygen/src/doxml/compounddef.nit deleted file mode 100644 index b1f7eaa..0000000 --- a/contrib/neo_doxygen/src/doxml/compounddef.nit +++ /dev/null @@ -1,192 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# `compounddef` element reading. -module doxml::compounddef - -import memberdef -import doxyname -import more_collections - -# Processes the content of a `compounddef` element. -class CompoundDefListener - super EntityDefListener - - # The defined compound. - var compound: Compound is writable, noinit - - private var memberdef: MemberDefListener is noinit - private var param_listener: TypeParamListener is noinit - - # Default attributes for members in the current section. - private var member_defaults: MemberDefaults is noinit - - # For each section kind, default attributes for member in that section. - private var section_kinds: DefaultMap[String, MemberDefaults] is noinit - - - # Attributes of the current `` element. - - private var refid = "" - private var prot = "" - private var virt = "" - - - init do - super - var defaults = new MemberDefaults("public", false, false) - - memberdef = new MemberDefListener(reader, self) - param_listener = new TypeParamListener(reader, self) - - member_defaults = defaults - section_kinds = new DefaultMap[String, MemberDefaults](defaults) - - # public - section_kinds["public-type"] = defaults - section_kinds["public-func"] = defaults - section_kinds["public-attrib"] = defaults - section_kinds["public-slot"] = defaults - # public static - defaults = new MemberDefaults("public", true, false) - section_kinds["public-static-func"] = defaults - section_kinds["public-static-attrib"] = defaults - # Not scoped => public static - section_kinds["signal"] = defaults - section_kinds["dcop-func"] = defaults - section_kinds["property"] = defaults - section_kinds["event"] = defaults - section_kinds["define"] = defaults - section_kinds["typedef"] = defaults - section_kinds["enum"] = defaults - section_kinds["func"] = defaults - section_kinds["var"] = defaults - - # protected - defaults = new MemberDefaults("protected", false, false) - section_kinds["protected-type"] = defaults - section_kinds["protected-func"] = defaults - section_kinds["protected-attrib"] = defaults - section_kinds["protected-slot"] = defaults - # protected static - defaults = new MemberDefaults("protected", true, false) - section_kinds["protected-static-func"] = defaults - section_kinds["protected-static-attrib"] = defaults - - # package - defaults = new MemberDefaults("package", false, false) - section_kinds["package-type"] = defaults - section_kinds["package-func"] = defaults - section_kinds["package-attrib"] = defaults - # package static - defaults = new MemberDefaults("package", true, false) - section_kinds["package-static-func"] = defaults - section_kinds["package-static-attrib"] = defaults - - # private - defaults = new MemberDefaults("private", false, false) - section_kinds["private-type"] = defaults - section_kinds["private-func"] = defaults - section_kinds["private-attrib"] = defaults - section_kinds["private-slot"] = defaults - # private static - defaults = new MemberDefaults("private", true, false) - section_kinds["private-static-func"] = defaults - section_kinds["private-static-attrib"] = defaults - - # Special sections. - # TODO Do something these sections. - defaults = new MemberDefaults("public", true, true) - section_kinds["related"] = defaults - section_kinds["user-defined"] = defaults - # TODO Determine what `friend` and `prototype` mean. - end - - redef fun entity: Entity do return compound - - redef fun start_dox_element(local_name: String, atts: Attributes) do - if "compoundname" == local_name then - text.listen_until(dox_uri, local_name) - else if ["innerclass", "innernamespace", "basecompoundref"].has(local_name) then - prot = get_optional(atts, "prot", "") - text.listen_until(dox_uri, local_name) - if "basecompoundref" == local_name then - refid = get_optional(atts, "refid", "") - virt = get_optional(atts, "virt", "") - else - refid = get_required(atts, "refid") - end - else if "memberdef" == local_name then - read_member(atts) - else if "sectiondef" == local_name then - member_defaults = section_kinds[get_required(atts, "kind")] - if member_defaults.is_special then - super # TODO - end - else if "param" == local_name then - param_listener.listen_until(dox_uri, local_name) - else if "templateparamlist" != local_name then - super - end - end - - redef fun end_dox_element(local_name: String) do - if "compoundname" == local_name then - compound.doxyname = text.to_s - else if "innerclass" == local_name then - compound.doxygen_declare_class(refid, text.to_s, prot) - else if "innernamespace" == local_name then - compound.declare_namespace(refid, text.to_s) - else if "memberdef" == local_name then - if not (memberdef.member isa UnknownMember) then - compound.declare_member(memberdef.member) - end - else if "basecompoundref" == local_name then - compound.declare_super(refid, text.to_s, prot, virt) - else if "param" == local_name and compound isa ClassCompound then - compound.as(ClassCompound).add_type_parameter(param_listener.parameter) - else - super - end - end - - private fun read_member(atts: Attributes) do - var kind = get_required(atts, "kind") - - create_member(kind) - memberdef.member.model_id = get_required(atts, "id") - memberdef.member.visibility = get_optional(atts, "prot", - member_defaults.visibility) - end - - private fun create_member(kind: String) do - if kind == "variable" then - memberdef.member = new Attribute(compound.graph) - else if kind == "function" then - memberdef.member = new Method(compound.graph) - else - memberdef.member = new UnknownMember(compound.graph) - noop.listen_until(dox_uri, "memberdef") - return - end - memberdef.listen_until(dox_uri, "memberdef") - end -end - -# Default attributes for members in the current section. -private class MemberDefaults - var visibility: String - var is_static: Bool - var is_special: Bool -end diff --git a/contrib/neo_doxygen/src/doxml/doc_listener.nit b/contrib/neo_doxygen/src/doxml/doc_listener.nit deleted file mode 100644 index 05ecd35..0000000 --- a/contrib/neo_doxygen/src/doxml/doc_listener.nit +++ /dev/null @@ -1,94 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Documentation reading. -module doxml::doc_listener - -import listener -import html - -# Processes documentation. -class DocListener - super TextListener - - # The read documentation. - var doc = new Documentation is writable - - # Mapping between the type of a Doxygen element and the corresponding - # factory. - private var factories = new HashMap[String, HtmlElementFactory] - - private var element_stack = new Array[HTMLTag] - - # Does the next block have to be added to the detailed description? - private var in_detailed_description = false - - redef fun listen_until(uri, local_name) do - super - if local_name == "briefdescription" then - in_detailed_description = false - else - in_detailed_description = true - end - end - - redef fun start_dox_element(local_name, atts) do - super - var factory = factories.get_or_null(local_name) - if factory == null then return - element_stack.push(factory.create_element(local_name, atts)) - end - - redef fun end_dox_element(local_name) do - super - if not factories.has_key(local_name) then return - if element_stack.is_empty then return - var current_element = element_stack.pop - current_element.append(flush_buffer.trim) - if element_stack.is_empty then add_block(current_element.write_to_string) - end - - redef fun end_listening do - super - if not element_stack.is_empty then - var current_element = element_stack.first.write_to_string - add_block(current_element) - end - add_block(flush_buffer.trim) - element_stack.clear - end - - private fun add_block(block: String) do - if block.is_empty then return - if in_detailed_description then - doc.add(block) - else - doc.brief_description = block - in_detailed_description = true - end - end -end - -# Provides a mean to create a certain kind of HTML elements. -private abstract class HtmlElementFactory - # Create a new empty HTML element. - # - # Parameters: - # - # * `local_name`: Type of the Doxygen element that will be represented by - # the HTML element. - # * `attributes`: Attributes of the Doxygen element that will be - # represented by the HTML element. - fun create_element(local_name: String, attributes: Attributes): HTMLTag is abstract -end diff --git a/contrib/neo_doxygen/src/doxml/doxml.nit b/contrib/neo_doxygen/src/doxml/doxml.nit deleted file mode 100644 index 280334a..0000000 --- a/contrib/neo_doxygen/src/doxml/doxml.nit +++ /dev/null @@ -1,89 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Doxygen’s XML documents reading. -module doxml - -import compounddef - -# Reader for XML documents whose the schema is `compound.xsd`. -class CompoundFileReader - super DoxmlListener - - # The project graph. - var model: ProjectGraph - - # The language-specific strategies to use. - redef var source_language: SourceLanguage - - private var reader: XMLReader = new XophonReader - private var compounddef: CompoundDefListener is noinit - private var noop: NoopListener is noinit - - init do - compounddef = new CompoundDefListener(reader, self) - noop = new NoopListener(reader, self) - end - - redef fun graph do return model - - # Read the document at the specified path. - fun read(path: String) do - reader.content_handler = self - reader.parse_file(path) - compounddef.compound = new UnknownCompound(model) - end - - redef fun start_dox_element(local_name: String, atts: Attributes) do - if local_name == "compounddef" then - read_compound(atts) - else if "doxygen" != local_name then - noop.listen_until(dox_uri, local_name) - end - end - - private fun read_compound(atts: Attributes) do - var kind = get_required(atts, "kind") - - create_compound(kind) - # TODO Make all values of `kind` and `visibility` compatible with the Nit meta-model. - if get_bool(atts, "final") then - kind = "final {kind}" - end - if get_bool(atts, "sealed") then - kind = "sealed {kind}" - end - if get_bool(atts, "abstract") then - kind = "abstract {kind}" - end - compounddef.compound.kind = kind - compounddef.compound.model_id = get_required(atts, "id") - compounddef.compound.visibility = get_optional(atts, "prot", "") - end - - private fun create_compound(kind: String) do - if kind == "file" then - compounddef.compound = new FileCompound(model) - else if kind == "namespace" then - compounddef.compound = new Namespace(model) - else if kind == "class" or kind == "interface" or kind == "enum" then - compounddef.compound = new ClassCompound(model) - else - compounddef.compound = new UnknownCompound(model) - noop.listen_until(dox_uri, "compounddef") - return - end - compounddef.listen_until(dox_uri, "compounddef") - end -end diff --git a/contrib/neo_doxygen/src/doxml/doxyname.nit b/contrib/neo_doxygen/src/doxml/doxyname.nit deleted file mode 100644 index 65637df..0000000 --- a/contrib/neo_doxygen/src/doxml/doxyname.nit +++ /dev/null @@ -1,79 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Adds a methods to convert Doxygen’s names into short names. -module doxml::doxyname - -import model - -redef class Compound - - # Separator used by Doxygen to separate name’s components. - protected fun doxyname_separator: String do return "::" - - # Set the `name` using the specified name generated by Doxygen. - fun doxyname=(doxyname: String) do - name = doxyname.to_short_name(doxyname_separator) - end - - # Declare an inner class. - # - # Note: Althought Doxygen indicates that both arguments are optional, - # declarations with an empty ID are not supported yet. - # - # Parameters: - # - # * `id`: `model_id` of the inner class. - # * `doxyname`: qualified name of the inner class, as generated by Doxygen. - # * `prot`: visibility (proctection). - # - # TODO: Handle cases where only the `doxyname` is available. - fun doxygen_declare_class(id: String, doxyname: String, prot: String) do - declare_class(id, doxyname.to_short_name(doxyname_separator), prot) - end -end - -redef class Namespace - # Set the `name` and the `full_name` using the specified name generated by Doxygen. - # - # Warning: This method assumes that `model_id` is already set. - redef fun doxyname=(doxyname: String) do - full_name = doxyname - super - if doxyname == name and model_id != "" then - # Doxygen does not represent the root namespace. - # So, we have to link the root namespace with its children manually. - graph.by_id[""].as(Namespace).declare_namespace(model_id, doxyname) - end - end -end - -redef class FileCompound - redef fun doxyname_separator do return "/" -end - -redef class Text - # Return the substring that come after the last occurrence of `separator`. - # - # Return the whole string if `sperator` is not present. - private fun to_short_name(separator: String): SELFTYPE do - var m = search_last(separator) - - if m == null then - return self - else - return substring_from(m.after) - end - end -end diff --git a/contrib/neo_doxygen/src/doxml/entitydef.nit b/contrib/neo_doxygen/src/doxml/entitydef.nit deleted file mode 100644 index aa6968c..0000000 --- a/contrib/neo_doxygen/src/doxml/entitydef.nit +++ /dev/null @@ -1,129 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Common SAX listeners for entity definitions. -module doxml::entitydef - -import doc_listener - -# Processes the content of an entity definition. -abstract class EntityDefListener - super StackableListener - - # The inner `TextListener`. - protected var text: TextListener is noinit - - # The inner `DocListener`. - protected var doc: DocListener is noinit - - # The inner `NoopListener`. - protected var noop: NoopListener is noinit - - init do - super - text = new TextListener(reader, self) - doc = new DocListener(reader, self) - noop = new NoopListener(reader, self) - end - - # The current entity. - protected fun entity: Entity is abstract - - redef fun start_dox_element(local_name, atts) do - if ["briefdescription", "detaileddescription", "inbodydescription"].has(local_name) then - doc.doc = entity.doc - doc.listen_until(dox_uri, local_name) - else if "location" == local_name then - entity.location = get_location(atts) - else - noop.listen_until(dox_uri, local_name) - end - end - - redef fun end_listening do - super - entity.put_in_graph - end - - # Parse the attributes of a `location` element. - protected fun get_location(atts: Attributes): neo_doxygen::Location do - var location = new neo_doxygen::Location - - location.path = atts.value_ns("", "bodyfile") or else atts.value_ns("", "file") - # Doxygen may indicate `[generated]`. - if "[generated]" == location.path then location.path = null - var line_start = atts.value_ns("", "bodystart") or else atts.value_ns("", "line") or else null - if line_start != null then location.line_start = line_start.to_i - var line_end = atts.value_ns("", "bodyend") - if line_end != null then location.line_end = line_end.to_i - var column_start = atts.value_ns("", "column") - if column_start != null then location.column_start = column_start.to_i - if location.line_start == location.line_end then - location.column_end = location.column_start - end - return location - end -end - -# Processes the content of a `` element. -abstract class ParamListener[T: Parameter] - super EntityDefListener - - # The current parameter. - var parameter: T is noinit - - private var type_listener: TypeListener is noinit - - init do - super - type_listener = new TypeListener(reader, self) - end - - redef fun entity do return parameter - - redef fun listen_until(uri, local_name) do - super - parameter = create_parameter - end - - # Create a new parameter. - protected fun create_parameter: T is abstract - - redef fun start_dox_element(local_name, atts) do - if "declname" == local_name then - text.listen_until(dox_uri, local_name) - else if "type" == local_name then - type_listener.listen_until(dox_uri, local_name) - else - super - end - end - - redef fun end_dox_element(local_name) do - if "declname" == local_name then - parameter.name = text.to_s - else if "type" == local_name then - source_language.apply_parameter_type(parameter, type_listener.linked_text) - else - super - end - end -end - -# Processes the content of a `` element in a `` element. -class TypeParamListener - super ParamListener[TypeParameter] - - redef fun create_parameter do return new TypeParameter(graph) -end diff --git a/contrib/neo_doxygen/src/doxml/language_specific.nit b/contrib/neo_doxygen/src/doxml/language_specific.nit deleted file mode 100644 index 9566f9e..0000000 --- a/contrib/neo_doxygen/src/doxml/language_specific.nit +++ /dev/null @@ -1,192 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Handle language-specific parts of the importation. -module doxml::language_specific - -import model - -# Various importation logics that depend on the project’s language. -abstract class SourceLanguage - - # Apply the information deduced from `type_text` to `member`. - # - # `type_text` is the content of the `` element. - fun apply_member_type(member: Member, type_text: RawType) do - if type_text["text"] != null then - member.static_type = type_text - end - end - - # Apply the information deduced from `type_text` to `parameter`. - # - # `type_text` is the content of the `` element. - fun apply_parameter_type(parameter: Parameter, type_text: RawType) do - if type_text["text"] != null then - parameter.static_type = type_text - end - end - - # Extract the specified keyword at the beginning of the specified text. - # - # If the keyword is at the beginning of the specified text, return `true` - # and remove the keyword. Else, return false. - # - # Used to extract some keywords that Doxygen puts in the type. - # - # class DummySource - # super JavaSource - # # - # fun test(text: LinkedText, keyword: String): Bool do - # return extract_keyword(text, keyword) - # end - # end - # # - # var text = new RawType(new ProjectGraph("")) - # var dummy = new DummySource - # var res: Bool - # # - # text.add_part("abstract final", "") - # res = dummy.test(text, "static") - # assert not res - # res = dummy.test(text, "abstract") - # assert res - # assert "final" == text["text"].as(JsonArray).first - # res = dummy.test(text, "final") - # assert res - # assert text["text"] == null - # res = dummy.test(text, "abstract") - # assert not res - protected fun extract_keyword(text: LinkedText, keyword: String): Bool do - var text_array = text["text"] - if text_array == null then return false - assert text_array isa JsonArray - if text_array.is_empty then return false - - var content = text_array.first.as(String).l_trim - var link = text.links.first - var found = false - - if link == null and content.has_prefix(keyword) then - if keyword.length == content.length then - content = "" - found = true - else if content.chars[keyword.length] <= ' ' then - content = content.substring_from(keyword.length).l_trim - found = true - end - if "" == content then - text.shift_part - else if found then - text.set_part(0, content, "") - end - end - return found - end - - # Extract the specified suffix in the specified text. - # - # If the suffix is at the end of the specified text, return `true` - # and remove the suffix. Else, return false. - # - # Used to extract stuff like `...` that Doxygen puts in the type. - # - # class DummySource - # super JavaSource - # # - # fun test(text: LinkedText, s: String): Bool do - # return extract_suffix(text, s) - # end - # end - # # - # var text = new RawType(new ProjectGraph("")) - # var dummy = new DummySource - # var res: Bool - # # - # text.add_part("Object...+++", "") - # res = dummy.test(text, "...") - # assert not res - # res = dummy.test(text, "+++") - # assert res - # assert "Object..." == text["text"].as(JsonArray).first - # res = dummy.test(text, "...") - # assert res - # assert "Object" == text["text"].as(JsonArray).first - protected fun extract_suffix(text: LinkedText, suffix: String): Bool do - var text_array = text["text"] - if text_array == null then return false - assert text_array isa JsonArray - if text_array.is_empty then return false - - var content = text_array.last.as(String).r_trim - var link = text.links.first - - if link == null and content.has_suffix(suffix) then - content = content.substring(0, content.length - suffix.length).r_trim - if "" == content then - text.pop_part - else - text.set_part(0, content, "") - end - return true - else - return false - end - end -end - -# The default importation logics. -# -# Do nothing special. -class DefaultSource - super SourceLanguage -end - -# Importation logics for Java. -class JavaSource - super SourceLanguage - - redef fun apply_member_type(member, type_text) do - # For abstract members, Doxygen put `abstract` at the beginning of the type. - # We assume that Doxygen do not put annotations in the type (it seems to - # be the case). - if extract_keyword(type_text, "abstract") then - member.is_abstract = true - end - # TODO final - # TODO void - # TODO Avoid using `RawType` when possible. Only use `RawType` as a fallback. - super - end - - redef fun apply_parameter_type(parmeter, type_text) do - # We assume that Doxygen do not put annotations in the type (it seems to - # be the case). - # TODO final - # TODO Avoid using `RawType` when possible. Only use `RawType` as a fallback. - parmeter.is_vararg = extract_suffix(type_text, "...") - super - end -end - -# Importation logics for Python. -class PythonSource - super SourceLanguage - - redef fun apply_member_type(member, type_text) do - # Doxygen may forgot to remove the `def` keyword on methods. - extract_keyword(type_text, "def") - super - end -end diff --git a/contrib/neo_doxygen/src/doxml/listener.nit b/contrib/neo_doxygen/src/doxml/listener.nit deleted file mode 100644 index 40d021f..0000000 --- a/contrib/neo_doxygen/src/doxml/listener.nit +++ /dev/null @@ -1,288 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Basic SAX listeners. -module doxml::listener - -import saxophonit -import model -import language_specific - -# Common abstractions for SAX listeners reading XML documents generated by Doxygen. -abstract class DoxmlListener - super ContentHandler - - # The locator setted by calling `document_locator=`. - protected var locator: nullable SAXLocator = null - - # The project graph. - fun graph: ProjectGraph is abstract - - # The language-specific strategies to use. - fun source_language: SourceLanguage is abstract - - redef fun document_locator=(locator: SAXLocator) do - self.locator = locator - end - - # The Doxygen’s namespace IRI. - protected fun dox_uri: String do return "" - - redef fun start_element(uri: String, local_name: String, qname: String, - atts: Attributes) do - super - if uri != dox_uri then return # None of our business. - start_dox_element(local_name, atts) - end - - # Process the start of an element in the Doxygen’s namespace. - # - # See `ContentHandler.start_element` for the description of the parameters. - protected fun start_dox_element(local_name: String, atts: Attributes) do end - - redef fun end_element(uri: String, local_name: String, qname: String) do - super - if uri != dox_uri then return # None of our business. - end_dox_element(local_name) - end - - # Process the end of an element in the Doxygen’s namespace. - # - # See `ContentHandler.start_element` for the description of the parameters. - protected fun end_dox_element(local_name: String) do end - - # Get the boolean value of the specified attribute. - # - # `false` by default. - protected fun get_bool(atts: Attributes, local_name: String): Bool do - return get_optional(atts, local_name, "no") == "yes" - end - - # Get the value of an optional attribute. - # - # Parameters: - # - # * `atts`: attribute list. - # * `local_name`: local name of the attribute. - # * `default`: value to return when the specified attribute is not found. - protected fun get_optional(atts: Attributes, local_name: String, - default: String): String do - return atts.value_ns(dox_uri, local_name) or else default - end - - # Get the value of an required attribute. - # - # Parameters: - # - # * `atts`: attribute list. - # * `local_name`: local name of the attribute. - protected fun get_required(atts: Attributes, local_name: String): String do - var value = atts.value_ns(dox_uri, local_name) - if value == null then - throw_error("The `{local_name}` attribute is required.") - return "" - else - return value - end - end - - redef fun end_document do - locator = null - end - - # Throw an error with the specified message by prepending the current location. - protected fun throw_error(message: String) do - var e: SAXParseException - - if locator != null then - e = new SAXParseException.with_locator(message, locator.as(not null)) - else - e = new SAXParseException(message) - end - e.throw - end -end - -# A `DoxmlListener` that read only a part of a document. -# -# Temporary redirect events to itself until it ends processing its part. -abstract class StackableListener - super DoxmlListener - - # The associated reader. - var reader: XMLReader - - # The parent listener. - var parent: DoxmlListener - - # Namespace’s IRI of the element at the root of the part to process. - private var root_uri: String = "" - - # Local name of the element at the root of the part to process. - private var root_local_name: String = "" - - # The number of open element of the same type than the root of the part to process. - private var depth = 0 - - # The project graph. - private var p_graph: ProjectGraph is noinit - - # The language-specific strategies to use. - private var p_source: SourceLanguage is noinit - - - init do - super - p_graph = parent.graph - p_source = parent.source_language - end - - redef fun graph do return p_graph - redef fun source_language do return p_source - - # Temporary redirect events to itself until the end of the specified element. - fun listen_until(uri: String, local_name: String) do - root_uri = uri - root_local_name = local_name - depth = 1 - reader.content_handler = self - locator = parent.locator - end - - redef fun start_element(uri: String, local_name: String, qname: String, - atts: Attributes) do - super - if uri == root_uri and local_name == root_local_name then - depth += 1 - end - end - - redef fun end_element(uri: String, local_name: String, qname: String) do - super - if uri == root_uri and local_name == root_local_name then - depth -= 1 - if depth <= 0 then - end_listening - parent.end_element(uri, local_name, qname) - end - end - end - - # Reset the reader’s listener to the parent. - fun end_listening do - reader.content_handler = parent - locator = null - end - - redef fun end_document do - end_listening - end -end - -# A SAX listener that skips any event except the end of the part to process. -# -# Used to skip an entire element. -class NoopListener - super StackableListener -end - -# Concatenates any text node found. -class TextListener - super StackableListener - - # The read text. - protected var buffer: Buffer = new FlatBuffer - - # Is the last read chunk was ignorable white space? - private var sp: Bool = false - - redef fun listen_until(uri: String, local_name: String) do - buffer.clear - sp = false - super - end - - redef fun characters(str: String) do - if sp then - if buffer.length > 0 then buffer.append(" ") - sp = false - end - buffer.append(str) - end - - redef fun ignorable_whitespace(str: String) do - sp = true - end - - # Flush the buffer. - protected fun flush_buffer: String do - var s = buffer.to_s - - buffer.clear - sp = false - return s - end - - redef fun to_s do return buffer.to_s -end - -# Processes a content of type `linkedTextType`. -abstract class LinkedTextListener[T: LinkedText] - super TextListener - - # The read text. - var linked_text: T is noinit - - private var refid = "" - - # Create a new instance of `T`. - protected fun create_linked_text: T is abstract - - redef fun listen_until(uri: String, local_name: String) do - linked_text = create_linked_text - refid = "" - super - end - - redef fun start_dox_element(local_name: String, atts: Attributes) do - super - push_part - if "ref" == local_name then refid = get_required(atts, "refid") - end - - redef fun end_dox_element(local_name: String) do - super - push_part - if "ref" == local_name then refid = "" - end - - private fun push_part do - var s = flush_buffer - - if not s.is_empty then - linked_text.add_part(s, refid) - end - end - - redef fun to_s do return linked_text.to_s -end - -# Processes the content of a `` element. -class TypeListener - super LinkedTextListener[RawType] - - private var raw_type: RawType is noinit - - redef fun create_linked_text do return new RawType(graph) -end diff --git a/contrib/neo_doxygen/src/doxml/memberdef.nit b/contrib/neo_doxygen/src/doxml/memberdef.nit deleted file mode 100644 index 5249404..0000000 --- a/contrib/neo_doxygen/src/doxml/memberdef.nit +++ /dev/null @@ -1,70 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# `memberdef` element reading. -module doxml::memberdef - -import entitydef - -# Processes the content of a `` element. -class MemberDefListener - super EntityDefListener - - # The current member. - var member: Member is writable, noinit - - private var type_listener: TypeListener is noinit - private var param_listener: MemberParamListener is noinit - - init do - super - type_listener = new TypeListener(reader, self) - param_listener = new MemberParamListener(reader, self) - end - - redef fun entity do return member - - redef fun start_dox_element(local_name: String, atts: Attributes) do - if "name" == local_name then - text.listen_until(dox_uri, local_name) - else if "reimplements" == local_name then - member.reimplement(get_required(atts, "refid")) - else if "type" == local_name then - type_listener.listen_until(dox_uri, local_name) - else if "param" == local_name then - param_listener.listen_until(dox_uri, local_name) - else - super - end - end - - redef fun end_dox_element(local_name: String) do - if "name" == local_name then - member.name = text.to_s - else if "type" == local_name then - source_language.apply_member_type(member, type_listener.linked_text) - else if "param" == local_name then - member.add_parameter(param_listener.parameter) - else - super - end - end -end - -# Processes the content of a `` element in a `` element. -class MemberParamListener - super ParamListener[MemberParameter] - - redef fun create_parameter do return new MemberParameter(graph) -end diff --git a/contrib/neo_doxygen/src/graph_store.nit b/contrib/neo_doxygen/src/graph_store.nit deleted file mode 100644 index 0c396d3..0000000 --- a/contrib/neo_doxygen/src/graph_store.nit +++ /dev/null @@ -1,111 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A storage medium for a graph. -module graph_store - -import neo4j -import console - -# A storage medium for a graph. -# -# Provides a way to save a Neo4j graph. -abstract class GraphStore - - # Escape control sequence to save the cursor position. - private var term_save_cursor: String = (new TermSaveCursor).to_s - - # Escape control sequence to rewind to the last saved cursor position. - private var term_rewind: String = "{new TermRestoreCursor}{new TermEraseDisplayDown}" - - # Is the storage medium already contains at least one node with the specified label? - fun has_node_label(name: String): Bool is abstract - - # Save all specified Neo4j entities. - fun save_all(neo_entities: Collection[NeoEntity]) is abstract - - # Prepare the output to show the progress. - # - # This method must be called before the first call to `show_progress` or - # `show_done`. - protected fun prepare_display do printn "{term_save_cursor} " - - # Show the progress, in percentage. - # - # For use in the implementation of `save_all` only. - protected fun show_progress(progress: Int) do - printn "{term_rewind} {progress}% " - end - - # Show a message to indicate that the task finished with success. - # - # For use in the implementation of `save_all` only. - protected fun show_done do - print "{term_rewind} Done." - end -end - -# An actual Neo4j database as a storage medium. -class Neo4jStore - super GraphStore - - # How many operations can be executed in one batch? - private var batch_max_size = 1000 - - # The Neo4j client to use. - var client: Neo4jClient - - redef fun has_node_label(name) do - var query = new CypherQuery.from_string( - "match n where \{name\} in labels(n) return count(n)") - query.params["name"] = name - var data = client.cypher(query).as(JsonObject)["data"] - var result = data.as(JsonArray).first.as(JsonArray).first.as(Int) - return result > 0 - end - - redef fun save_all(neo_entities) do - var batch = new NeoBatch(client) - var len = neo_entities.length - var sum = 0 - var i = 1 - - prepare_display - for nentity in neo_entities do - batch.save_entity(nentity) - if i == batch_max_size then - do_batch(batch) - sum += batch_max_size - show_progress(sum * 100 / len) - batch = new NeoBatch(client) - i = 1 - else - i += 1 - end - end - do_batch(batch) - show_done - end - - # Execute `batch` and check for errors. - # - # Abort if `batch.execute` returns errors. - private fun do_batch(batch: NeoBatch) do - var errors = batch.execute - if not errors.is_empty then - for e in errors do sys.stderr.write("{sys.program_name}: {e}\n") - exit(1) - end - end -end diff --git a/contrib/neo_doxygen/src/model/class_compound.nit b/contrib/neo_doxygen/src/model/class_compound.nit deleted file mode 100644 index b0f2096..0000000 --- a/contrib/neo_doxygen/src/model/class_compound.nit +++ /dev/null @@ -1,224 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Nodes for classes. -module model::class_compound - -import graph -import member -import type_entity - -# A class. -class ClassCompound - super Compound - - # The corresponding type. - # - # In the case of a generic class, defines bounds for type parameters. - var class_type: ClassType is noinit - - # The definition. - var class_def: ClassDef is noinit - - init do - super - class_type = new ClassType(graph) - class_type.class_compound = self - class_def = new ClassDef(graph, self) - self.labels.add("MClass") - kind = "class" - visibility = "public" - end - - # Return the number of type parameters. - fun arity: Int do return class_type.arity - - redef fun name=(name) do - super - class_type.name = name - class_def.name = name - end - - redef fun location=(location) do - super - class_def.location = location - end - - redef fun set_mdoc do - super - class_def["mdoc"] = doc - end - - redef fun declare_super(id, full_name, prot, virt) do - class_def.declare_super(id, full_name, prot, virt) - end - - redef fun declare_member(member) do - class_def.declare_member(member) - end - - # Append the specified type parameter. - fun add_type_parameter(parameter: TypeParameter) do - class_type.arguments.add(parameter) - end - - redef fun put_in_graph do - super - class_type.put_in_graph - class_def.put_in_graph - end - - redef fun put_edges do - super - graph.add_edge(self, "CLASSTYPE", class_type) - if arity > 0 then - var names = new JsonArray - - for p in class_type.arguments do - names.add(p.name) - end - self["parameter_names"] = names - end - end -end - -# The `MClassDef` node of a class. -class ClassDef - super CodeBlock - - # The defined class. - var class_compound: ClassCompound - - # The `model_id` of the base classes. - var supers: SimpleCollection[String] = new Array[String] - - # The set of the introduced/redefined members. - # - # Includes inner classes. - # - # Filled by `declare_member` and `declare_class`. - # - # Note: `declare_class` is defined by the `inner_class` module. - # - # SEE: `declare_member` - # SEE: `declare_class` - var members: SimpleCollection[MemberOrInner] = new Array[MemberOrInner] - - init do - super - self.labels.add("MClassDef") - self["is_intro"] = true - end - - # Declare a base compound (usually, a base class). - # - # Parameters: - # - # * `id`: `model_id` of the base compound. May be empty. - # * `full_name`: qualified name of the base compound. May be empty. - # * `prot`: visibility (proctection) of the relationship. - # * `virt`: level of virtuality of the relationship. - fun declare_super(id: String, full_name: String, prot: String, - virt: String) do - # TODO prot, virt, full_name - if "" != id then - supers.add(id) - end - end - - # Append the specified member. - fun declare_member(member: Member) do - members.add(member) - end - - redef fun put_edges do - super - graph.add_edge(self, "BOUNDTYPE", class_compound.class_type) - graph.add_edge(self, "MCLASS", class_compound) - for s in supers do - graph.add_edge(self, "INHERITS", graph.by_id[s].as(ClassCompound).class_type) - end - for m in members do - if m.is_intro then - var intro = m.introducer.as(not null) - graph.add_edge(self, "INTRODUCES", intro) - graph.add_edge(intro, "INTRO_CLASSDEF", self) - end - graph.add_edge(self, "DECLARES", m) - end - end -end - -# A type defined by a class. -class ClassType - super TypeEntity - - # The associated class. - # - # You may use this attribute or `class_compound_id` to specify the class. - var class_compound: nullable ClassCompound = null is writable - - # The `model_id` of the associated class. - # - # You may use this attribute or `class_compound` to specify the class. - var class_compound_id: String = "" is writable - - # The type arguments or the type parameters. - var arguments = new Array[TypeEntity] - - init do - super - self.labels.add("MClassType") - end - - # Return the number of arguments. - fun arity: Int do return arguments.length - - # Is the class generic? - fun is_generic: Bool do return arity > 0 - - redef fun put_in_graph do - super - if is_generic then - self.labels.add("MGenericType") - else - var i = self.labels.index_of("MGenericType") - if i >= 0 then self.labels.remove_at(i) - end - end - - redef fun put_edges do - var cls = class_compound - - if cls == null and class_compound_id != "" then - cls = graph.by_id[class_compound_id].as(ClassCompound) - end - assert cls != null - - super - graph.add_edge(self, "CLASS", cls) - assert cls.arity == self.arity - for i in [0..arguments.length[ do - var a = arguments[i] - if cls.class_type != self then - a.name = cls.class_type.arguments[i].name - end - if a isa TypeParameter then - a.rank = i - graph.add_edge(a, "CLASS", cls) - end - graph.add_edge(self, "ARGUMENT", a) - end - end -end diff --git a/contrib/neo_doxygen/src/model/descriptions.nit b/contrib/neo_doxygen/src/model/descriptions.nit deleted file mode 100644 index 66341f3..0000000 --- a/contrib/neo_doxygen/src/model/descriptions.nit +++ /dev/null @@ -1,118 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Documentation associated to an entity. -module model::descriptions - -import json::static -import json - -# Documentation associated to an entity. -# -# The documentation is written in Markdown format. -# -# ~~~nit -# var doc = new Documentation -# -# doc.brief_description = "Do something." -# doc.detailed_description = ["Do not lunch a rocket."] -# assert doc.brief_description == "Do something." -# assert doc.detailed_description == ["Do not lunch a rocket."] -# assert doc.to_json == """["Do something.","Do not lunch a rocket."]""" -# -# doc.brief_description = "" -# doc.detailed_description = ["The answer is `42`."] -# assert doc.brief_description == "The answer is `42`." -# assert doc.detailed_description == ["The answer is `42`."] -# assert doc.to_json == """["The answer is `42`."]""" -# -# doc.detailed_description = ["The answer is `42`."] -# doc.brief_description = "" -# assert doc.brief_description == "The answer is `42`." -# assert doc.detailed_description == ["The answer is `42`."] -# assert doc.to_json == """["The answer is `42`."]""" -# -# doc.detailed_description = new Array[String] -# doc.brief_description = "" -# assert doc.is_empty -# assert doc.brief_description == "" -# assert doc.detailed_description == new Array[String] -# assert doc.to_json == "[]" -# ~~~ -class Documentation - super Serializable - - private var content = new JsonStringArray - private var has_brief_description: Bool = false - - # The brief description. - # - # If it is empty, the first element of `detailed_description` will be used - # as brief description. - fun brief_description=(brief_description: String) do - if brief_description.is_empty then - if has_brief_description then - content.shift - has_brief_description = false - end - else if has_brief_description then - content.first = brief_description - else - content.unshift(brief_description) - has_brief_description = true - end - end - - # The brief description. - fun brief_description: String do - if not is_empty then return content.first - return "" - end - - # The detailed description. - # - # Each element should represent a block. - fun detailed_description=(detailed_description: SequenceRead[String]) do - if has_brief_description then - while content.length > 1 do content.pop - else - content.clear - end - content.add_all(detailed_description) - end - - # The detailed description. - # - # Each element should represent a block. - fun detailed_description: SequenceRead[String] do - if not has_brief_description then return content - if content.length > 1 then return content.subarray(1, content.length - 1) - return new Array[String] - end - - # Add a block of detailed description. - fun add(block: String) do content.add block - - # Is the documentation empty? - fun is_empty: Bool do return content.is_empty - - redef fun serialize_to(v) do content.serialize_to v - redef fun accept_json_serializer(v) do content.serialize_to v -end - -# A `Serializable` array of strings. -private class JsonStringArray - super JsonSequenceRead[String] - super Array[String] -end diff --git a/contrib/neo_doxygen/src/model/graph.nit b/contrib/neo_doxygen/src/model/graph.nit deleted file mode 100644 index 9df491a..0000000 --- a/contrib/neo_doxygen/src/model/graph.nit +++ /dev/null @@ -1,364 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Graphs and basic entities. -module model::graph - -import neo4j -import more_collections -import location -import descriptions - -# A Neo4j graph. -class NeoGraph - # All the nodes in the graph. - var all_nodes: SimpleCollection[NeoNode] = new Array[NeoNode] - - # All the edges in the graph. - var all_edges: SimpleCollection[NeoEdge] = new Array[NeoEdge] - - # Add a relationship between two nodes. - # - # Parameters are the same than for the constructor of `NeoEdge`. - fun add_edge(from: NeoNode, rel_type: String, to: NeoNode) do - all_edges.add(new NeoEdge(from, rel_type, to)) - end -end - -# A project’s graph. -# -# Here is the usual steps to build a project graph: -# -#
    -#
  • Instantiate `ProjectGraph` by giving the name that will label the project.
  • -#
  • For each compound: -#
      -#
    • Instantiate the compound.
    • -#
    • Provide all the related data.
    • -#
    • Call the `put_in_graph` method of the compound.
    • -#
  • -#
  • Call the `add_global_modules` method of the project’s graph (defined in -# the `module_compound` module). This permits to take global classes into -# account correctly.
  • -#
  • Call the `put_edges` method of the project’s graph.
  • -#
-class ProjectGraph - super NeoGraph - - # The project’s name. - var project_name: String - - # The node reperesenting the project. - # - # Once the project’s graph is initialized, this node must not be edited. - var project = new NeoNode - - # Entities by `model_id`. - var by_id: Map[String, Entity] = new HashMap[String, Entity] - - # Namespaces by `full_name`. - var namespaces: Map[String, Namespace] = new HashMap[String, Namespace] - - # For each `ClassCompound` in the graph, the mapping between its `model_id` and its namespace. - # - # Defaults to the root namespace. An entry is added each time - # `Namespace.declare_class` is called. - # - # Note: In the graph, there is no direct link between a namespace and a - # class. It is the role of a module (created internally by a `FileCompound`) - # to link a class with its namespace. So, this collection is used by modules - # to know which class in a file belong to their related namespace. It is - # also used by `FileCompound` to detect classes in the root namespace. - var class_to_ns: Map[String, Namespace] is noinit - - # Initialize a new project graph using the specified project name. - # - # The specified name will label all nodes of the project’s graph. - init do - project.labels.add(project_name) - project.labels.add("MEntity") - project.labels.add("MProject") - project["name"] = project_name - all_nodes.add(project) - - var root = new RootNamespace(self) - root.put_in_graph - by_id[""] = root - class_to_ns = new DefaultMap[String, Namespace](root) - end - - # Request to all nodes in the graph to add their related edges. - # - # Note: For the rare cases where a node need to wait the `put_edges` to add - # an implicit node, this method makes sure to call the `put_edges` method - # of the newly added nodes only after processing all the nodes that was - # already there. - fun put_edges do - all_edges.clear - add_edge(project, "ROOT", by_id[""]) - for n in all_nodes do - if n isa Entity then - n.put_edges - end - end - end -end - -# A model’s entity. -# -# In practice, this is the base class of every node in a `ProjectGraph`. -abstract class Entity - super NeoNode - - # Graph that will embed the entity. - var graph: ProjectGraph - - # ID of the entity in the model. - # - # Is empty for entities without an ID. - var model_id: String = "" is writable - - # The full (qualified) name, as presented by the original model. - # - # Fully independant of `name`. By default, equals to `""` for the root - # namespace. - var full_name: nullable String = null is writable - - # Associated documentation. - var doc = new Documentation is writable - - init do - self.labels.add(graph.project_name) - self.labels.add("MEntity") - end - - # The short (unqualified) name. - fun name=(name: String) do - self["name"] = name - end - - # The short (unqualified) name. - fun name: String do - var name = self["name"] - assert name isa String - return name - end - - # Include the documentation of `self` in the graph. - protected fun set_mdoc do - self["mdoc"] = doc - end - - # The namespace separator of Nit/C++. - # - # Used to join two or more names when we need to work around some - # limitations of the Nit model. - fun ns_separator: String do return "::" - - # Set the location of the entity in the source code. - fun location=(location: nullable neo_doxygen::Location) do - self["location"] = location - end - - # Get the location of the entity in the source code. - fun location: nullable neo_doxygen::Location do - return self["location"].as(nullable neo_doxygen::Location) - end - - # Put the entity in the graph. - # - # Called by the loader when it has finished to read the entity. - fun put_in_graph do - if not doc.is_empty then - set_mdoc - end - graph.all_nodes.add(self) - if model_id != "" then graph.by_id[model_id] = self - end - - # Put the related edges in the graph. - # - # This method is called on each node by `ProjectGraph.put_edges`. - # - # Note: Even at this step, the entity may modify its own attributes and - # inner entities’ ones because some values are only known once the entity - # know its relationships with the rest of the graph. - fun put_edges do end -end - -# An entity whose the location is mandatory. -abstract class CodeBlock - super Entity - - init do - self["location"] = new neo_doxygen::Location - end - - redef fun location=(location) do - if location == null then - super(new neo_doxygen::Location) - else - super - end - end -end - -# A compound. -# -# Usually corresponds to a `` element in of the XML output of -# Doxygen. -abstract class Compound - super Entity - - # Set the declared visibility (the protection) of the compound. - fun visibility=(visibility: String) do - self["visibility"] = visibility - end - - # Set the specific kind of the compound. - fun kind=(kind: String) do - self["kind"] = kind - end - - # Declare an inner namespace. - # - # Note: Although Doxygen indicates that the name is optional, - # declarations with an empty name are not supported yet, except for the root - # namespace. For the root namespace, both arguments are empty. - # - # Parameters: - # - # * `id`: `model_id` of the inner namespace. May be empty. - # * `full_name`: qualified name of the inner namespace. Use an empty name - # for the root namespace. - fun declare_namespace(id: String, full_name: String) do end - - # Declare an inner class. - # - # Note: Although Doxygen indicates that both arguments are optional, - # declarations with an empty ID are not supported yet. - # - # Parameters: - # - # * `id`: `model_id` of the inner class. - # * `name`: short name of the inner class. - # * `prot`: visibility (proctection). - fun declare_class(id: String, name: String, prot: String) do end - - # Declare a base compound (usually, a base class). - # - # Parameters: - # - # * `id`: `model_id` of the base compound. May be empty. - # * `full_name`: qualified name of the base compound. May be empty. - # * `prot`: visibility (proctection) of the relationship. - # * `virt`: level of virtuality of the relationship. - fun declare_super(id: String, full_name: String, prot: String, - virt: String) do end -end - -# An unrecognized compound. -# -# Used to simplify the handling of ignored entities. -class UnknownCompound - super Compound - - redef fun put_in_graph do end - redef fun put_edges do end -end - -# A namespace. -# -# Corresponds to a group in Nit. -class Namespace - super Compound - - # The inner namespaces. - var inner_namespaces: SimpleCollection[NamespaceRef] = new Array[NamespaceRef] - - init do - super - self.labels.add("MGroup") - end - - redef fun declare_namespace(id, full_name) do - inner_namespaces.add new NamespaceRef(id, full_name) - end - - redef fun declare_class(id, name, prot) do - assert not id.is_empty else - sys.stderr.write "Inner class declarations without ID are not yet supported.\n" - end - graph.class_to_ns[id] = self - end - - redef fun put_in_graph do - super - var full_name = self.full_name - if full_name isa String then graph.namespaces[full_name] = self - end - - redef fun put_edges do - super - graph.add_edge(self, "PROJECT", graph.project) - for ns in inner_namespaces do - var node = ns.seek_in(graph) - graph.add_edge(node, "PARENT", self) - graph.add_edge(self, "NESTS", node) - end - end -end - -# A reference to a namespace. -class NamespaceRef - # The `model_id` of the target. - # - # Empty when unknown or for the root namespace. - var model_id: String - - # The `full_name` of the target. - # - # Empty only for the root namespace. - var full_name: String - - # Look for the targeted namespace in the specified graph. - fun seek_in(graph: ProjectGraph): Namespace do - var ns_compound: Namespace - - if model_id.is_empty and not full_name.is_empty then - # ID unspecified. => We have to look by name - assert graph.namespaces.has_key(full_name) else - sys.stderr.write "Namespace `{full_name}` not found." - end - ns_compound = graph.namespaces[full_name] - else - ns_compound = graph.by_id[model_id].as(Namespace) - end - return ns_compound - end -end - -# The root namespace of a `ProjectGraph`. -# -# This the only entity in the graph whose `model_id` is really `""`. -# Added automatically at the initialization of a `ProjectGraph`. -class RootNamespace - super Namespace - - init do - super - full_name = "" - name = graph.project_name - end -end diff --git a/contrib/neo_doxygen/src/model/inner_class.nit b/contrib/neo_doxygen/src/model/inner_class.nit deleted file mode 100644 index 9476739..0000000 --- a/contrib/neo_doxygen/src/model/inner_class.nit +++ /dev/null @@ -1,121 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Adds the possibility to define inner classses. -module model::inner_class - -import member -import class_compound - -# An inner class. -class InnerClass - super MemberOrInner - - redef type INTRODUCER_TYPE: InnerClassIntroducer - - # The outer class definition. - # - # Used to correct the short name of the inner class definition when - # `put_edges` is called. - # - # SEE: The notice concerning `name` in `/src/neo.nit`. - var outer: ClassDef - - # The `model_id` of the actual inner class (`ClassCompound`). - var inner: String - - init do - super - self.labels.add("MInnerClassDef") - end - - redef fun is_intro do return true - redef fun create_introducer do return new InnerClassIntroducer(graph, self) - redef fun resolve_introducer do return introducer - - redef fun put_edges do - super - var inner = graph.by_id[self.inner] - assert inner isa ClassCompound - var inner_def = inner.class_def - # Correct the short name of `inner` to avoid name collisions in a module. - inner_def.name = "{outer.name}{ns_separator}{name}" - graph.add_edge(self, "NESTS", inner_def) - end -end - -# A `MProperty` node for an inner class. -class InnerClassIntroducer - super MemberIntroducer - - # The definition. - var def: InnerClass - - init do - super - self.labels.add("MInnerClass") - end - - redef fun put_edges do - super - var inner = graph.by_id[def.inner] - assert inner isa ClassCompound - var outer = def.outer.class_compound - # Correct the short name of `inner` to avoid name collisions in a module. - inner.name = "{outer.name}{ns_separator}{name}" - graph.add_edge(self, "NESTS", inner) - end -end - -# Implements `declare_class`. -redef class ClassCompound - redef fun declare_class(id, name, prot) do - class_def.declare_class(id, name, prot) - end -end - -# Implements `declare_class`. -redef class ClassDef - - # The set of the defined inner classes. - # - # All `InnerClass` entities registred here are automatically added to the - # graph with the `ClassDef`. - # - # To ensure that each inner class will be correctly linked, - # `declare_class` should be used to add each inner class. - var inner_classes: SimpleCollection[InnerClass] = new Array[InnerClass] - - # Declare an inner class. - # - # Parameters: - # - # * `id`: `model_id` of the inner class definition. - # * `name`: name of the inner class definition. - # * `prot`: visibility (proctection). - fun declare_class(id: String, name: String, prot: String) do - var member = new InnerClass(graph, self, id) - member.name = name - member.visibility = prot - members.add member - inner_classes.add member - end - - redef fun put_in_graph do - super - for member in inner_classes do - member.put_in_graph - end - end -end diff --git a/contrib/neo_doxygen/src/model/linked_text.nit b/contrib/neo_doxygen/src/model/linked_text.nit deleted file mode 100644 index 83fa3b8..0000000 --- a/contrib/neo_doxygen/src/model/linked_text.nit +++ /dev/null @@ -1,164 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A text with links. -module model::linked_text - -import graph - -# A text with links. -abstract class LinkedText - super Entity - - # All link in the text. - # - # Do not edit directly. - var links: Sequence[nullable Link] = new Array[nullable Link] - - # Remove all the parts. - fun clear_parts do - self["text"] = null - links.clear - end - - # Remove the first part. - fun shift_part do - var text = self["text"] - assert text isa JsonArray - text.shift - links.shift - if text.is_empty then - self["text"] = null - end - end - - # Remove the last part. - fun pop_part do - var text = self["text"] - assert text isa JsonArray - text.pop - links.pop - if text.is_empty then - self["text"] = null - end - end - - # Remove the part at the specified index. - fun remove_part_at(index: Int) do - var text = self["text"] - assert text isa JsonArray - text.remove_at(index) - links.remove_at(index) - if text.is_empty then - self["text"] = null - end - end - - # Change a part of text. - # - # Parameters: - # - # * `index` : the index of the part. - # * `content` : textual content. - # * `refid` : `model_id` of the linked entity or `""`. - fun set_part(index: Int, content: String, refid: String) do - var text = self["text"] - assert text isa JsonArray - text[index] = content - if not refid.is_empty then - links[index] = create_link(links.length, refid) - else - links[index] = null - end - end - - # Append a part of text. - # - # Parameters: - # - # * `content` : textual content. - # * `refid` : `model_id` of the linked entity or `""`. - fun add_part(content: String, refid: String) do - var text = self["text"] - - if text == null then - text = new JsonArray - self["text"] = text - end - assert text isa JsonArray - text.add(content) - if not refid.is_empty then - links.add(create_link(links.length, refid)) - else - links.add(null) - end - end - - # Create a link to the specified entity. - protected fun create_link(rank:Int, refid: String): Link is abstract - - redef fun to_s do - var text = self["text"] - - if text isa JsonArray then - return text.join - else - return "UNDEFINED" - end - end - - redef fun put_in_graph do - super - for link in links do - if link isa Link then - link.put_in_graph - end - end - end - - redef fun put_edges do - super - for i in [0..links.length[ do - var link = links[i] - if link isa Link then - link["rank"] = i - graph.add_edge(self, "LINK", link) - end - end - end -end - -# A link. -abstract class Link - super Entity - - # * `refid` : `model_id` of the linked entity. - var refid: String - - init do - super - self["rank"] = -1 - end - - redef fun put_edges do - graph.add_edge(self, "TARGET", graph.by_id[refid]) - end - - # Specify the rank (index) of the parameter in the signature. - # - # Called by `LinkedText.put_edges`. - private fun rank=(rank: Int) do - self["rank"] = rank - end -end diff --git a/contrib/neo_doxygen/src/model/location.nit b/contrib/neo_doxygen/src/model/location.nit deleted file mode 100644 index 4e58af0..0000000 --- a/contrib/neo_doxygen/src/model/location.nit +++ /dev/null @@ -1,48 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This module is used to model locations in source files. -module location - -import json - -# A location inside a source file. -class Location - super Serializable - - # The file’s path. - var path: nullable String = null is writable - - # The one-based index of the first line. - var line_start: Int = 1 is writable - - # The one-based index of the last line. - var line_end: Int = 1 is writable - - # The one-based column index of the first character. - var column_start: Int = 1 is writable - - # The one-based column index of the last character. - var column_end: Int = 1 is writable - - redef fun to_s do - var path = path - var file_part = "/dev/null:" - if path != null and path.length > 0 then file_part = "{path}:" - return "{file_part}{line_start},{column_start}--{line_end},{column_end}" - end - - redef fun serialize_to(v) do to_s.serialize_to v - redef fun accept_json_serializer(v) do to_s.serialize_to v -end diff --git a/contrib/neo_doxygen/src/model/member.nit b/contrib/neo_doxygen/src/model/member.nit deleted file mode 100644 index 05b82cb..0000000 --- a/contrib/neo_doxygen/src/model/member.nit +++ /dev/null @@ -1,303 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Members. -module model::member - -import graph -import type_entity - -# A member or an inner class. -abstract class MemberOrInner - super CodeBlock - - # The type of the introducer. - type INTRODUCER_TYPE: MemberIntroducer - - # The node used to represent the `MProperty` node. - # - # Only defined if `self` is at the root of a reimplementation graph, and - # only once `put_in_graph` is called. - var introducer: nullable INTRODUCER_TYPE = null - - init do - super - self.labels.add("MPropDef") - end - - # Does this member introduce the property? - fun is_intro: Bool is abstract - - redef fun put_in_graph do - super - self["is_intro"] = is_intro - if is_intro then - var visibility = self["visibility"] - var name = self["name"] - - introducer = create_introducer - if name isa String then - introducer.name = name - end - if visibility isa String then - introducer.visibility = visibility - end - introducer.put_in_graph - end - end - - redef fun put_edges do - super - var intro = resolve_introducer - - assert intro != null - graph.add_edge(self, "DEFINES", intro) - end - - # Set the visibility. - fun visibility=(visibility: String) do - self["visibility"] = visibility - if introducer != null then - introducer.as(not null).visibility = visibility - end - end - - # Get the visibility. - # - # Return `""` by default. - fun visibility: String do - var visibility = self["visibility"] - if visibility isa String then return visibility - return "" - end - - redef fun name=(name: String) do - super - if introducer != null then - introducer.as(not null).name = name - end - end - - # Create an instance of `MemberIntroducer` that will be linked to `self`. - protected fun create_introducer: INTRODUCER_TYPE is abstract - - # Find the nearest reimplementation root. - fun resolve_introducer: nullable INTRODUCER_TYPE is abstract -end - -# A member. -abstract class Member - super MemberOrInner - - # Members that this member redefines/reimplements. - var reimplemented: SimpleCollection[String] = new Array[String] - - # Set the static type. - fun static_type=(static_type: nullable TypeEntity) is abstract - - # Get the static type. - fun static_type: nullable TypeEntity is abstract - - # Append the specified parameter to the signature. - fun add_parameter(parameter: MemberParameter) do end - - # Append a member that is reimplemeneted by `self`. - fun reimplement(parent: String) do - reimplemented.add(parent) - end - - redef fun is_intro do return reimplemented.length <= 0 - - # Is the member abstract? - fun is_abstract=(is_abstract: Bool) do - self["is_abstract"] = is_abstract - end - - # Find the nearest reimplementation root. - # - # var g = new ProjectGraph("foo") - # var m1 = new Attribute(g) - # var m2 = new Attribute(g) - # var m3 = new Attribute(g) - # # - # m1.model_id = "1" - # m1.put_in_graph - # m2.reimplement("1") - # m2.put_in_graph - # assert m1.resolve_introducer == m1.introducer - # assert m2.resolve_introducer == m1.introducer - # # - # m3.model_id = "3" - # m3.reimplement("3") - # m3.put_in_graph - # assert m3.resolve_introducer == null - redef fun resolve_introducer do - if introducer == null then - var member_queue = new List[String] - var visited = new HashSet[Member] - var member: Member - - member_queue.add_all(reimplemented) - while not member_queue.is_empty do - member = graph.by_id[member_queue.shift].as(Member) - if visited.has(member) then - return null - else if member.is_intro then - return member.introducer - else - visited.add(member) - member_queue.add_all(member.reimplemented) - end - end - return null - else - return introducer - end - end -end - -# An unrecognized member. -# -# Used to simplify the handling of ignored entities. -class UnknownMember - super Member - - redef fun put_in_graph do end - redef fun put_edges do end -end - -# A local definition of a method. -class Method - super Member - - redef type INTRODUCER_TYPE: MethodIntroducer - - # The method’s signature. - var signature: Signature is noinit, writable - - init do - super - self.labels.add("MMethodDef") - self["is_intern"] = false # TODO - self["is_extern"] = false # TODO - signature = new Signature(graph) - is_abstract = false - end - - # Set the return type. - redef fun static_type=(static_type: nullable TypeEntity) do - signature.return_type = static_type - end - - # Get the return type. - redef fun static_type: nullable TypeEntity do return signature.return_type - - redef fun add_parameter(parameter: MemberParameter) do - signature.parameters.add(parameter) - end - - redef fun create_introducer do return new MethodIntroducer(graph) - - redef fun put_in_graph do - super - signature.put_in_graph - end - - redef fun put_edges do - super - graph.add_edge(self, "SIGNATURE", signature) - end -end - -# A local definition of an attribute. -class Attribute - super Member - - redef type INTRODUCER_TYPE: AttributeIntroducer - - # The declared type. - redef var static_type: nullable TypeEntity = null is writable - - init do - super - self.labels.add("MAttributeDef") - end - - redef fun create_introducer do return new AttributeIntroducer(graph) - - redef fun put_in_graph do - super - if static_type != null then - static_type.as(not null).put_in_graph - end - end - - redef fun put_edges do - super - if static_type != null then - graph.add_edge(self, "TYPE", static_type.as(not null)) - end - end -end - -# The `MProperty` node of a root of a reimplementation graph. -abstract class MemberIntroducer - super Entity - - init do - super - self.labels.add("MProperty") - self["visibility"] = "public" - end - - # Set the visibility. - fun visibility=(visibility: String) do - self["visibility"] = visibility - end - - # Get the visibility. - # - # Return `""` by default. - fun visibility: String do - var visibility = self["visibility"] - if visibility isa String then return visibility - return "" - end -end - -# A `MProperty` node for a method. -class MethodIntroducer - super MemberIntroducer - - init do - super - self.labels.add("MMethod") - self["is_init"] = false # TODO - end -end - -# A `MProperty` node for an attribute. -class AttributeIntroducer - super MemberIntroducer - - init do - super - self.labels.add("MAttribute") - end -end - -redef class Compound - # Append the specified member. - fun declare_member(member: Member) do end -end diff --git a/contrib/neo_doxygen/src/model/model.nit b/contrib/neo_doxygen/src/model/model.nit deleted file mode 100644 index 8ad7e5e..0000000 --- a/contrib/neo_doxygen/src/model/model.nit +++ /dev/null @@ -1,25 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# The model used to populate the Neo4j graph. -module model - -import location -import linked_text -import graph -import class_compound -import module_compound -import member -import inner_class -import namespace_members diff --git a/contrib/neo_doxygen/src/model/module_compound.nit b/contrib/neo_doxygen/src/model/module_compound.nit deleted file mode 100644 index aca8dfc..0000000 --- a/contrib/neo_doxygen/src/model/module_compound.nit +++ /dev/null @@ -1,191 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Nodes for modules and files. -module model::module_compound - -import graph -import class_compound -import namespace_members - -# A source file. -# -# Creates one modules by inner namespace. The full name of the modules begin -# with the namespace’s full name, and end with the unqualified name of the file, -# without the extension. -# -# Note: If a module associated to the root namespace is needed, it is added to -# the graph only when `put_edges` is called. -class FileCompound - super Compound - super CodeBlock - - # Modules corresponding to the namespaces defined/redefined in the file. - private var inner_namespaces = new Array[Module] - - # `model_id` of the classes declared in the file. - private var inner_classes = new Array[String] - - # The last component of the path, without the extension. - # - # Used as the unqualified name of the modules. - private var basename: String = "" - - init do - super - end - - redef fun location=(location) do - super - for m in inner_namespaces do m.location = location - end - - redef fun name=(name) do - # Example: `MyClass.java` - super - var match = name.search_last(".") - - if match == null then - basename = name - else - basename = name.substring(0, match.from) - end - # Update the modules’ name. - for m in inner_namespaces do m.update_name - end - - redef fun declare_namespace(id, full_name) do - var m: Module - - assert not full_name.is_empty or id.is_empty else - sys.stderr.write "Inner mamespace declarations without name are not yet supported (except for the root namespace).\n" - end - m = new Module(graph, self, new NamespaceRef(id, full_name)) - m.location = location - inner_namespaces.add m - end - - redef fun declare_class(id, name, prot) do - assert not id.is_empty else - sys.stderr.write "Inner class declarations without ID are not yet supported.\n" - end - inner_classes.add id - end - - redef fun put_in_graph do - # Do not add `self` to the Neo4j graph... - # ... but add its modules... - for m in inner_namespaces do m.put_in_graph - # ... and add `self` to the indexes. - if model_id != "" then graph.by_id[model_id] = self - graph.files.add self - end - - # If the file contains some classes in the root namespace, add an implicit - # module to handle them. - # - # This method is called by `ProjectGraph.add_global_modules` and assumes - # that all the namespaces are already fully set and put in the graph. - fun declare_root_namespace do - if has_globals then - declare_namespace("", "") - inner_namespaces.last.put_in_graph - end - end - - # Does this file contain classes in the root namespace? - private fun has_globals: Bool do - var root = graph.by_id[""] - for c in inner_classes do - if graph.class_to_ns[c] == root then return true - end - return false - end -end - -# A `MModule` node. -# -# For each file, there is one module by inner namespace. -private class Module - super Compound - super CodeBlock - - # The file that declares the module. - var file_compound: FileCompound - - # The namespace defined or redefined by the module. - var namespace: NamespaceRef - - init do - super - self.labels.add("MModule") - update_name - end - - # Update the `name`. - # - # Update the short name of the module to the `basename` of the file that - # declares it. - fun update_name do name = file_compound.basename - - redef fun put_edges do - var ns_compound = namespace.seek_in(graph) - var self_class = ns_compound.self_class - var class_count = 0 - var last_class: nullable ClassCompound = null - - graph.add_edge(ns_compound, "DECLARES", self) - - for c in file_compound.inner_classes do - if graph.class_to_ns[c] != ns_compound then continue - var class_compound = graph.by_id[c].as(ClassCompound) - last_class = class_compound - class_count += 1 - graph.add_edge(self, "INTRODUCES", class_compound) - graph.add_edge(self, "DEFINES", class_compound.class_def) - end - - if self_class isa SelfClass then - # We assume that only one file is linked to the namespace. - # TODO When Doxygen will provide a way to know which file defines which member, use it. - self_class.location = file_compound.location - graph.add_edge(self, "INTRODUCES", self_class) - graph.add_edge(self, "DEFINES", self_class.class_def) - end - - if doc.is_empty and class_count == 1 then - doc = last_class.as(not null).doc - end - if doc.is_empty then doc = file_compound.doc - if doc.is_empty then doc = ns_compound.doc - if not doc.is_empty then set_mdoc - end -end - -# Adds the `add_global_modules` phase to `ProjectGraph`. -redef class ProjectGraph - - # Project’s source files. - var files: SimpleCollection[FileCompound] = new Array[FileCompound] - - # Add the modules that define the root namespace. - # - # **Must** be called before any call to `put_edges`, and after all the - # namespaces are fully set and put in the graph. - # - # Note: This method is not idempotent so it has to be called only once. - fun add_global_modules do - for f in files do f.declare_root_namespace - end -end diff --git a/contrib/neo_doxygen/src/model/namespace_members.nit b/contrib/neo_doxygen/src/model/namespace_members.nit deleted file mode 100644 index 4c85d5a..0000000 --- a/contrib/neo_doxygen/src/model/namespace_members.nit +++ /dev/null @@ -1,73 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Add support for namespace’s members. -module model::namespace_members - -import class_compound -import member - -redef class Namespace - # The class that contains the namespace’s direct members. - # - # Left `null` for the root namespace and for any namespace with no direct - # member. Automatically put in the graph with the namespace. - # - # Note: In the graph, the `self_class` not linked directly to the namespace. - # This is the role of the modules implicitly created by `FileCompound`s to - # link a namespace to its `self_class`. - # - # SEE: `declare_member` - var self_class: nullable SelfClass = null - - # Add the specified member as a direct children of the namespace. - redef fun declare_member(member) do - if self_class == null then self_class = new SelfClass(graph, self) - self_class.as(not null).declare_member(member) - end - - redef fun put_in_graph do - super - var self_class = self.self_class - if self_class isa SelfClass then self_class.put_in_graph - end -end - -redef class RootNamespace - redef fun declare_member(member) do - assert false else - # TODO Check how Doxygen modelize member of the root namespace. - # Note: Doxygen does not modelize the root namespace. - sys.stderr.write "The addition of a member to the root namespace is not supported yet." - end - end -end - -# A class that contains a namespace’s direct members. -class SelfClass - super ClassCompound - - # The namespace of the members - var namespace: Namespace - - init do - super - name = "(self)" - end - - redef fun put_in_graph do - if doc.is_empty then doc = namespace.doc - super - end -end diff --git a/contrib/neo_doxygen/src/model/type_entity.nit b/contrib/neo_doxygen/src/model/type_entity.nit deleted file mode 100644 index d8ea8c0..0000000 --- a/contrib/neo_doxygen/src/model/type_entity.nit +++ /dev/null @@ -1,166 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Typing and parameters. -module model::type_entity - -import graph -import linked_text - -# Base class of all types and signatures. -abstract class TypeEntity - super Entity - - init do - super - self.labels.add("MType") - end -end - -# A type parameter or a type argument. -# -# Note : The class relationship and the rank are set by `MClassType.put_edges`. -class TypeParameter - super TypeEntity - super Parameter - - init do - super - self.labels.add("MParameterType") - end -end - - -# A type described by a text. -class RawType - super TypeEntity - super LinkedText - - init do - super - self.labels.add("MRawType") - end - - redef fun create_link(rank, refid) do return new TypeLink(graph, refid) -end - -# A link in a `RawType`. -class TypeLink - super Link - - init do - super - self.labels.add("MTypePart") - end -end - - -# A signature of a method. -class Signature - super TypeEntity - - # The parameters. - var parameters = new Array[MemberParameter] - - # The static type of the returned value. - var return_type: nullable TypeEntity = null is writable - - init do - super - self.labels.add("MSignature") - end - - redef fun put_in_graph do - super - if return_type isa TypeEntity then - return_type.as(TypeEntity).put_in_graph - end - for p in parameters do - p.put_in_graph - end - end - - redef fun put_edges do - super - if parameters.length > 0 then - var names = new JsonArray - - for i in [0..parameters.length[ do - var p = parameters[i] - p.rank = i - names.add(p.name) - graph.add_edge(self, "PARAMETER", p) - end - self["parameter_names"] = names - end - if return_type != null then - graph.add_edge(self, "RETURNTYPE", return_type.as(not null)) - end - end -end - -# A parameter or an argument. -abstract class Parameter - super Entity - - # The static type of the parameter. - var static_type: nullable TypeEntity = null is writable - - init do - super - self["is_vararg"] = false - self["rank"] = -1 - end - - # Is the parameter a “vararg”? - fun is_vararg=(is_vararg: Bool) do - self["is_vararg"] = is_vararg - end - - # Is the parameter a “vararg”? - fun is_vararg: Bool do - var value = self["is_vararg"] - assert value isa Bool - return value - end - - # Set the rank (index) of the parameter in the signature. - fun rank=(rank: Int) do - self["rank"] = rank - end - - redef fun put_in_graph do - super - if static_type != null then - static_type.as(not null).put_in_graph - end - end - - redef fun put_edges do - super - graph.add_edge(self, "TYPE", static_type.as(not null)) - end -end - -# A parameter of a member. -# -# Note : The rank are set by `Signature.put_edges`. -class MemberParameter - super Parameter - - init do - super - self.labels.add("MParameter") - end -end diff --git a/contrib/neo_doxygen/src/neo_doxygen.nit b/contrib/neo_doxygen/src/neo_doxygen.nit deleted file mode 100644 index 30421eb..0000000 --- a/contrib/neo_doxygen/src/neo_doxygen.nit +++ /dev/null @@ -1,292 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Doxygen XML to Neo4j. -# -# Converts a Doxygen XML output into a model in Neo4j that is readable by the -# `nx` tool. -module neo_doxygen - -import model -import doxml -import graph_store -import console -import opts - -# An importation task. -class NeoDoxygenJob - - # The storage medium to use. - var store: GraphStore - - # The loaded project graph. - var model: ProjectGraph is noinit - - # Escape control sequence to save the cursor position. - private var term_save_cursor: String = (new TermSaveCursor).to_s - - # Escape control sequence to rewind to the last saved cursor position. - private var term_rewind: String = "{new TermRestoreCursor}{new TermEraseDisplayDown}" - - # Generate a graph from the specified project model. - # - # Parameters: - # - # * `name`: project name. - # * `dir`: Doxygen XML output directory path. - # * `source`: The language-specific logics to use. - fun load_project(name: String, dir: String, source: SourceLanguage) do - check_name name - model = new ProjectGraph(name) - var reader = new CompoundFileReader(model, source) - # Queue for sub-directories. - var directories = new Array[String] - var file_count = 0 - - if dir == "" then - printn "Reading the current directory... " - else - printn "Reading {dir}... " - end - loop - for f in list_files(dir) do - var path = dir/f - if path.file_stat.as(not null).is_dir then - directories.push(path) - else if f.has_suffix(".xml") and f != "index.xml" then - reader.read(path) - file_count += 1 - end - end - if directories.length <= 0 then break - dir = directories.pop - end - model.add_global_modules - print "Done." - if file_count < 2 then - print "{file_count} file read." - else - print "{file_count} files read." - end - end - - # List files in a directory. - # - # This method may be redefined to force the order in which the files - # are read by `load_project`. - protected fun list_files(dir: String): Collection[String] do - return dir.files - end - - # Check the project’s name. - private fun check_name(name: String) do - assert name_valid: not name.chars.first.is_upper else - sys.stderr.write("{sys.program_name}: The project’s name must not" + - " begin with an upper case letter. Got `{name}`.\n") - end - assert name_unused: not store.has_node_label(name) else - sys.stderr.write("{sys.program_name}: The label `{name}` is already" + - " used in the specified graph.\n") - end - end - - # Save the graph. - fun save do - sys.stdout.write "Linking nodes...{term_save_cursor} " - model.put_edges - print "{term_rewind} Done." - var nodes = model.all_nodes - sys.stdout.write "Saving {nodes.length} nodes..." - store.save_all(nodes) - var edges = model.all_edges - sys.stdout.write "Saving {edges.length} edges..." - store.save_all(edges) - end -end - -# The main class. -class NeoDoxygenCommand - - # Invalid arguments - var e_usage = 64 - - # Available options for `--src-lang`. - var sources = new HashMap[String, SourceLanguage] - - # The synopsis. - var synopsis: String = "[--dest ] [--src-lang ]\n" + - " [--] " - - # The synopsis for the help page. - var help_synopsis = "[-h|--help]" - - # The default destination. - var default_dest = "http://localhost:7474" - - # Processes the options. - var option_context = new OptionContext - - # The `--src-lang` option. - var opt_src_lang: OptionEnum is noinit - - # The `--dest` option. - var opt_dest: OptionString is noinit - - # The `-h|--help` option. - var opt_help: OptionBool is noinit - - init do - sources["any"] = new DefaultSource - sources["java"] = new JavaSource - sources["python"] = new PythonSource - - var prefix = new OptionText(""" -{{{"NAME".bold}}} - {{{sys.program_name}}} — Doxygen XML to Neo4j. - -{{{"SYNOPSIS".bold}}} - {{{sys.program_name}}} {{{synopsis}}} - {{{sys.program_name}}} {{{help_synopsis}}} - -{{{"DESCRIPTION".bold}}} - Convert a Doxygen XML output into a model in Neo4j that is readable by the - `nx` tool. - -{{{"ARGUMENTS".bold}}} - The internal name of the project. Must the same name as the - one specified to the `nx` tool. Must not begin by an upper - case letter. - - The directory where the XML documents generated by Doxygen are - located. - -{{{"OPTIONS".bold}}} -""") - option_context.add_option(prefix) - - opt_dest = new OptionString("The URL of the destination graph. `{default_dest}` by default.", - "--dest") - opt_dest.default_value = default_dest - option_context.add_option(opt_dest) - - opt_help = new OptionBool("Show the help (this page).", - "-h", "--help") - option_context.add_option(opt_help) - - var keys = new Array[String].from(sources.keys) - opt_src_lang = new OptionEnum(keys, - "The programming language to assume when processing chunks in the declarations left as-is by Doxygen. Use `any` (the default) to disable any language-specific processing.", - keys.index_of("any"), "--src-lang") - option_context.add_option(opt_src_lang) - end - - # Start the application. - fun main: Int do - if args.is_empty then - show_help - return e_usage - end - option_context.parse(args) - - var errors = option_context.errors - var rest = option_context.rest - - if errors.is_empty and not opt_help.value and rest.length != 2 then - errors.add "Unexpected number of additional arguments. Expecting 2; got {rest.length}." - end - if not errors.is_empty then - for e in errors do print_error(e) - show_usage - return e_usage - end - if opt_help.value then - show_help - return 0 - end - - var source = sources[opt_src_lang.value_name] - var dest = opt_dest.value - var project_name = rest[0] - var dir = rest[1] - var neo = new NeoDoxygenJob(create_store(dest or else default_dest)) - - neo.load_project(project_name, dir, source) - neo.save - return 0 - end - - # Create an instance of `GraphStore` for the specified destination. - protected fun create_store(dest: String): GraphStore do - return new Neo4jStore(new Neo4jClient(dest)) - end - - # Show the help. - fun show_help do - option_context.usage - end - - # Show the usage. - fun show_usage do - sys.stderr.write "Usage: {sys.program_name} {synopsis}\n" - sys.stderr.write "For details, run `{sys.program_name} --help`.\n" - end - - # Print an error. - fun print_error(e: String) do - sys.stderr.write "{sys.program_name}: {e}\n" - end -end - -# Add handling of multi-line descriptions. -# -# Note: The algorithm is naive and do not handle internationalisation, -# multi-byte characters and control characters. -redef class Option - - redef fun pretty(off) do - var s = super - - if s.length > 80 and off < 80 then - var column_length = 80 - off - var left = 0 - var right = 80 - var buf = new FlatBuffer - var prefix = "\n{" " * off}" - - loop - while right > left and s.chars[right] != ' ' do - right -= 1 - end - if left == right then - buf.append s.substring(left, column_length) - right += column_length - else - buf.append s.substring(left, right - left) - right += 1 - end - buf.append prefix - left = right - right += column_length - if right >= s.length then break - end - buf.append s.substring_from(left) - buf.append "\n" - return buf.to_s - else - return "{s}\n" - end - end -end - -exit((new NeoDoxygenCommand).main) diff --git a/contrib/neo_doxygen/src/tests/README.md b/contrib/neo_doxygen/src/tests/README.md deleted file mode 100644 index fbb4393..0000000 --- a/contrib/neo_doxygen/src/tests/README.md +++ /dev/null @@ -1,7 +0,0 @@ -Test scripts for `neo_doxygen`. - -The name of each test script is prefixed by `neo_doxygen_` to avoid name -conflicts in `/tests/sav` and `/tests/out`. The expected output of each script -is saved as a `*.res` file in `/tests/sav`. - -Note: All paths indicated here are relative to the root of the repository. diff --git a/contrib/neo_doxygen/src/tests/neo_doxygen_doc_module_class.nit b/contrib/neo_doxygen/src/tests/neo_doxygen_doc_module_class.nit deleted file mode 100644 index 48f73d5..0000000 --- a/contrib/neo_doxygen/src/tests/neo_doxygen_doc_module_class.nit +++ /dev/null @@ -1,43 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import tests -intrude import model::module_compound - -var graph = new ProjectGraph("foo") -var file = new FileCompound(graph) -var bar_class = new ClassCompound(graph) -var a_ns = new Namespace(graph) - -file.full_name = "Baz.java" -file.declare_class("classa_bar", "a::Bar", "public") -file.declare_namespace("namespacea", "a") -file.doc.brief_description = "A file." -file.put_in_graph - -a_ns.full_name = "a" -a_ns.model_id = "namespacea" -a_ns.declare_class("classa_bar", "a::Bar", "public") -a_ns.doc.brief_description = "A namespace." -a_ns.put_in_graph - -bar_class.model_id = "classa_bar" -bar_class.full_name = "a::Bar" -bar_class.doc.brief_description = "A class." -bar_class.put_in_graph - -graph.add_global_modules -graph.put_edges - -assert file.inner_namespaces[0]["mdoc"] == bar_class.doc diff --git a/contrib/neo_doxygen/src/tests/neo_doxygen_dump.nit b/contrib/neo_doxygen/src/tests/neo_doxygen_dump.nit deleted file mode 100644 index f594de9..0000000 --- a/contrib/neo_doxygen/src/tests/neo_doxygen_dump.nit +++ /dev/null @@ -1,58 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A variant of the `neo_doxygen` program that produces a debugging output of the graph instead of saving it. -# -# Note: The `--dest` option is ignored. -module tests::neo_doxygen_dump - -import tests -import neo_doxygen - -redef class Sys - redef fun program_name do return "%PROGRAM_NAME%" -end - -redef class NeoDoxygenJob - redef fun list_files(dir) do - var a = super.to_a - default_comparator.sort(a) - return a - end -end - -redef class NeoDoxygenCommand - redef fun create_store(url) do return new DebugStore -end - -# Dummy storage medium that write a debugging output to the standard output. -# -# For testing purposes only. -class DebugStore - super GraphStore - - redef fun has_node_label(name) do return false - - redef fun save_all(neo_entities) do - print "" - for n in neo_entities do - if n isa NeoEdge then - var buffer = new Buffer - n.debug buffer - print buffer - end - end - print "---===DONE===---" - end -end diff --git a/contrib/neo_doxygen/src/tests/neo_doxygen_file_compound.nit b/contrib/neo_doxygen/src/tests/neo_doxygen_file_compound.nit deleted file mode 100644 index a9dae43..0000000 --- a/contrib/neo_doxygen/src/tests/neo_doxygen_file_compound.nit +++ /dev/null @@ -1,103 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import tests -import model::module_compound - -var graph = new ProjectGraph("foo") -var file = new FileCompound(graph) -var file_2 = new FileCompound(graph) -var bar_class = new ClassCompound(graph) -var baz_class = new ClassCompound(graph) -var a_ns = new Namespace(graph) -var b_ns = new Namespace(graph) -var c_ns = new Namespace(graph) -var d_ns = new Namespace(graph) -var buffer = new Buffer -var root_ns = graph.by_id[""].as(Namespace) -var location - -file.name = "Bar.java" -file.model_id = "_Bar_8java" -location = new neo_doxygen::Location -location.path = "a/b/Bar.java" -file.location = location -file.declare_class("classa_b_bar", "a::b::Bar", "package") -file.declare_class("classbaz", "Baz", "") -file.declare_namespace("", "a::b") -file.doc.brief_description = "The first file." -file.put_in_graph - -file_2.name = "Bar.java" -file_2.model_id = "_Bar_8java_2" -location = new neo_doxygen::Location -location.path = "Bar.java" -file_2.location = location -file_2.declare_namespace("namespacec", "c") -file_2.declare_namespace("", "d") -file_2.put_in_graph - -bar_class.model_id = "classa_b_bar" -bar_class.name = "Bar" -location = new neo_doxygen::Location -location.path = "a/b/Bar.class" -location.line_start = 5 -location.column_start = 1 -location.line_end = 100 -location.column_end = 10 -bar_class.location = location -bar_class.put_in_graph - -baz_class.model_id = "classbaz" -baz_class.name = "Baz" -location = new neo_doxygen::Location -location.path = "Baz.jar" -baz_class.location = location -baz_class.put_in_graph - -root_ns.declare_namespace("", "a") -root_ns.declare_namespace("namespacec", "c") -root_ns.declare_namespace("", "d") - -a_ns.name = "a" -a_ns.full_name = "a" -a_ns.declare_namespace("", "a::b") -a_ns.put_in_graph - -b_ns.name = "b" -b_ns.full_name = "a::b" -b_ns.declare_class("classa_b_bar", "", "") -b_ns.put_in_graph - -c_ns.model_id = "namespacec" -c_ns.name = "c" -c_ns.full_name = "c" -c_ns.put_in_graph - -d_ns.model_id = "namespaced" -d_ns.name = "d" -d_ns.full_name = "d" -d_ns.put_in_graph - -print "---===WITHOUT GLOBALS===---" -graph.put_edges -graph.debug buffer -print buffer - -print "---===WITH GLOBALS===---" -buffer.clear -graph.add_global_modules -graph.put_edges -graph.debug buffer -print buffer diff --git a/contrib/neo_doxygen/src/tests/neo_doxygen_namespace_members.nit b/contrib/neo_doxygen/src/tests/neo_doxygen_namespace_members.nit deleted file mode 100644 index bf0a62f..0000000 --- a/contrib/neo_doxygen/src/tests/neo_doxygen_namespace_members.nit +++ /dev/null @@ -1,44 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import tests -import model - -var graph = new ProjectGraph("foo") -var file = new FileCompound(graph) -var root_ns = graph.by_id[""].as(Namespace) -var ns = new Namespace(graph) -var member = new Attribute(graph) -var buffer = new Buffer - -file.name = "foo.py" -file.model_id = "_foo_8py" -file.declare_namespace("namespacefoo", "foo") -file.put_in_graph - -member.name = "bar" -member.put_in_graph - -ns.model_id = "namespacefoo" -ns.name = "foo" -ns.declare_member(member) -ns.doc.brief_description = "A documented namespace." -ns.put_in_graph - -root_ns.declare_namespace("namespacefoo", "") - -graph.add_global_modules -graph.put_edges -graph.debug buffer -print buffer diff --git a/contrib/neo_doxygen/src/tests/tests.nit b/contrib/neo_doxygen/src/tests/tests.nit deleted file mode 100644 index b1481b3..0000000 --- a/contrib/neo_doxygen/src/tests/tests.nit +++ /dev/null @@ -1,83 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Base module for tests related to `neo_doxygen`. -module tests::tests - -import model::graph - -# Adds debugging output to graphs. -redef class NeoGraph - - # Append the debugging output of all relationships to the specified buffer. - fun debug(buffer: Buffer) do - buffer.append "# Graph\n" - for edge in all_edges do - edge.debug buffer - end - end -end - -# Adds debugging output to relationships. -redef class NeoEdge - - # Append the debugging output of this relationship to the specified buffer. - # - # Append the relationship type, the properties, and the debugging output of - # both extremities. - fun debug(buffer: Buffer) do - var rel_type = self.rel_type or else "?" - buffer.append "Edge\n" - buffer.append "=type={rel_type.length}:{rel_type}\n" - buffer.append "=properties=JsonObject({properties.length}):\n" - buffer.append properties.to_json - buffer.append "\n----\n=from=" - from.debug buffer - buffer.append "----\n=to=" - to.debug buffer - buffer.append "\n" - end -end - -# Adds debugging output to nodes. -redef class NeoNode - - # Append the debugging output of this node to the specified buffer. - # - # Append the labels and the properties. - fun debug(buffer: Buffer) do - buffer.append "Node\n" - buffer.append "=labels=Array({labels.length}):\n" - for lab in labels do buffer.append "{lab.length}:{lab}\n" - buffer.append "=properties=JsonObject({properties.length}):\n" - buffer.append properties.to_json - buffer.append "\n" - end -end - -# Adds debugging output to entities. -redef class Entity - - # Append the debugging output of this entity to the specified buffer. - # - # Append the `model_id`, the labels and the properties. - redef fun debug(buffer) do - buffer.append "Entity#{model_id.length}:{model_id}\n" - buffer.append "=labels=Array({labels.length}):\n" - for lab in labels do buffer.append "{lab.length}:{lab}\n" - buffer.append "=properties=JsonObject({properties.length}):\n" - buffer.append properties.to_json - buffer.append "\n" - end -end diff --git a/contrib/neo_doxygen/tests/.gitattributes b/contrib/neo_doxygen/tests/.gitattributes deleted file mode 100644 index ab22f42..0000000 --- a/contrib/neo_doxygen/tests/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/*/xml/* -diff diff --git a/contrib/neo_doxygen/tests/.gitignore b/contrib/neo_doxygen/tests/.gitignore deleted file mode 100644 index ad8b991..0000000 --- a/contrib/neo_doxygen/tests/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/*/Makefile -/*/.nx_config diff --git a/contrib/neo_doxygen/tests/Makefile b/contrib/neo_doxygen/tests/Makefile deleted file mode 100644 index d90195d..0000000 --- a/contrib/neo_doxygen/tests/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# All the dummy projects. -PROJECTS=$(dir $(wildcard ./*/Doxyfile)) - -.PHONY: xml bootstrap - -# Regenerate the XML documents. -xml: bootstrap - for p in $(PROJECTS); do $(MAKE) -C "$$p" xml || exit; done - -# Generate the Makefiles in the sub-directories. -bootstrap: - for p in $(PROJECTS); do { \ - echo '# FILE GENERATED BY ../Makefile'"\n" > "$$p/Makefile" || exit; \ - cat doxyproject.mk >> "$$p/Makefile" || exit; \ - } ; done diff --git a/contrib/neo_doxygen/tests/README.md b/contrib/neo_doxygen/tests/README.md deleted file mode 100644 index 5c2c616..0000000 --- a/contrib/neo_doxygen/tests/README.md +++ /dev/null @@ -1,8 +0,0 @@ -Data files for tests. - -For test scripts, see `../src/tests`. To regenerate the XML documents, run -`make`. - -## Required to Generate the XML documents - -* [Doxygen](http://www.doxygen.org/) diff --git a/contrib/neo_doxygen/tests/doxyproject.mk b/contrib/neo_doxygen/tests/doxyproject.mk deleted file mode 100644 index b6ce8e0..0000000 --- a/contrib/neo_doxygen/tests/doxyproject.mk +++ /dev/null @@ -1,35 +0,0 @@ -# This file is part of NIT ( http://www.nitlanguage.org ). -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -.PHONY: clean doxygen strip_paths xml - -# Regenerate the XML documents. -xml: strip_paths - -clean: - rm -rf xml - -doxygen: clean - doxygen Doxyfile - -# Get rid of the absolute paths in the generated files. -# -# Doxygen ignores the `STRIP_FROM_PATH` setting when generating a XML output. -# So, we have to replace the paths manually in order to get reproducible -# results. -# -# WARNING: FOR USE ON TEST DATA ONLY. -strip_paths: doxygen - . ../../sh-lib/more_sed.sh; \ - replace `readlink -f -- ./src` '%SOURCE_DIRECTORY%' xml/*.xml diff --git a/contrib/neo_doxygen/tests/empty-project/Doxyfile b/contrib/neo_doxygen/tests/empty-project/Doxyfile deleted file mode 100644 index bd06324..0000000 --- a/contrib/neo_doxygen/tests/empty-project/Doxyfile +++ /dev/null @@ -1,2381 +0,0 @@ -# Doxyfile 1.8.8 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = "Test Project" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation. The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy -# the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = - -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII -# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode -# U+3044. -# The default value is: NO. - -ALLOW_UNICODE_NAMES = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = YES - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new -# page for each member. If set to NO, the documentation of a member will be part -# of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = YES - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. -# -# Note: For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO, -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. If set to YES, local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO, only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO, these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES, the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo -# list. This list is created by putting \todo commands in the documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test -# list. This list is created by putting \test commands in the documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES, the -# list will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. See also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. -# Note: If this tag is empty the current directory is searched. - -INPUT = src - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.idl \ - *.ddl \ - *.odl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.cs \ - *.d \ - *.php \ - *.php4 \ - *.php5 \ - *.phtml \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.py \ - *.f90 \ - *.f \ - *.for \ - *.tcl \ - *.vhd \ - *.vhdl \ - *.ucf \ - *.qsf \ - *.as \ - *.js - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = NO - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra stylesheet files is of importance (e.g. the last -# stylesheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler (hhc.exe). If non-empty, -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated -# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it -# enables the Previous and Next buttons. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /