├── .gitignore ├── .travis.yml ├── .vscode ├── c_cpp_properties.json ├── launch.json ├── settings.json └── tasks.json ├── Doxyfile ├── README.md ├── compiler └── compiler.lisp ├── docs ├── doxystyle │ ├── customdoxygen.css │ ├── doxy-boot.js │ ├── doxygen-layout.xml │ ├── footer.html │ └── header.html └── html │ └── logo.png ├── examples ├── a.lisp ├── basic.lisp ├── bench.lisp ├── compilable_maze.lisp ├── diff_benchmark.lisp ├── functions.lisp └── init.lisp ├── img ├── ftv2doc.png ├── ftv2folderclosed.png ├── ftv2folderopen.png ├── logo.png └── performances.png ├── include ├── meson.build ├── pibuiltin.h ├── picell.h ├── pichecks.h ├── picore.h ├── pierror.h ├── pifile.h ├── piinit.h ├── pilisp.h ├── piparser.h ├── piprint.h ├── piremove.h ├── pisettings.h ├── pistack.h ├── pitestutils.h └── piutils.h ├── meson.build ├── src ├── main.c ├── meson.build ├── pibuiltin.c ├── picell.c ├── pichecks.c ├── picore.c ├── pierror.c ├── pifile.c ├── piinit.c ├── pilisp.c ├── piparser.c ├── piprint.c ├── piremove.c ├── pistack.c ├── pitestutils.c └── piutils.c └── test ├── bad_prints_test.c ├── expressions ├── atom.lisp ├── atoms.lisp ├── badexpressions │ ├── closedpar.lisp │ ├── complicate.lisp │ └── unfinished.lisp ├── dotexpressions.lisp ├── listnotation1.lisp ├── listnotation2.lisp ├── tokens.lisp └── void.lisp ├── lisp_program_load_test.c ├── lisp_program_test.c ├── lisp_programs ├── compilable_diff.lisp ├── diff.lisp ├── factorial.lisp ├── ibeforee.lisp ├── list_operations.lisp ├── loadtest.lisp ├── maps.lisp ├── max.lisp ├── maze.lisp ├── maze_let.lisp └── maze_old.lisp ├── meson.build ├── parser_accepted_strings_test.c ├── parser_rejected_strings_test.c ├── print_lexer_test.c ├── print_test.c ├── recursive_structure_print_test.c └── sexpr_copy_test.c /.gitignore: -------------------------------------------------------------------------------- 1 | # Pilisp files 2 | .piinit 3 | .picompile* 4 | .picompiler* 5 | 6 | # CLion 7 | .idea/ 8 | 9 | # Build dir 10 | build/ 11 | 12 | # npm 13 | node_modules/ 14 | 15 | # Coverage files 16 | *.gcov 17 | 18 | # Doxygen documentation 19 | # docs/html/ 20 | docs/latex/ 21 | docs/xml/ 22 | 23 | # IDE 24 | # .vscode/ 25 | 26 | # Prerequisites 27 | *.d 28 | 29 | # Object files 30 | *.o 31 | *.ko 32 | *.obj 33 | *.elf 34 | 35 | # Linker output 36 | *.ilk 37 | *.map 38 | *.exp 39 | 40 | # Precompiled Headers 41 | *.gch 42 | *.pch 43 | 44 | # Libraries 45 | *.lib 46 | *.a 47 | *.la 48 | *.lo 49 | 50 | # Shared objects (inc. Windows DLLs) 51 | *.dll 52 | *.so 53 | *.so.* 54 | *.dylib 55 | 56 | # Executables 57 | *.exe 58 | *.out 59 | *.app 60 | *.i*86 61 | *.x86_64 62 | *.hex 63 | 64 | # Debug files 65 | *.dSYM/ 66 | *.su 67 | *.idb 68 | *.pdb 69 | 70 | # Kernel Module Compile Results 71 | *.mod* 72 | *.cmd 73 | .tmp_versions/ 74 | modules.order 75 | Module.symvers 76 | Mkfile.old 77 | dkms.conf 78 | 79 | 80 | # User-specific stuff 81 | .idea/**/workspace.xml 82 | .idea/**/tasks.xml 83 | .idea/**/usage.statistics.xml 84 | .idea/**/dictionaries 85 | .idea/**/shelf 86 | 87 | # Sensitive or high-churn files 88 | .idea/**/dataSources/ 89 | .idea/**/dataSources.ids 90 | .idea/**/dataSources.local.xml 91 | .idea/**/sqlDataSources.xml 92 | .idea/**/dynamic.xml 93 | .idea/**/uiDesigner.xml 94 | .idea/**/dbnavigator.xml 95 | 96 | # Gradle 97 | .idea/**/gradle.xml 98 | .idea/**/libraries 99 | 100 | # Gradle and Maven with auto-import 101 | # When using Gradle or Maven with auto-import, you should exclude module files, 102 | # since they will be recreated, and may cause churn. Uncomment if using 103 | # auto-import. 104 | # .idea/modules.xml 105 | # .idea/*.iml 106 | # .idea/modules 107 | 108 | # CMake 109 | cmake-build-*/ 110 | 111 | # Mongo Explorer plugin 112 | .idea/**/mongoSettings.xml 113 | 114 | # File-based project format 115 | *.iws 116 | 117 | # IntelliJ 118 | out/ 119 | 120 | # mpeltonen/sbt-idea plugin 121 | .idea_modules/ 122 | 123 | # JIRA plugin 124 | atlassian-ide-plugin.xml 125 | 126 | # Cursive Clojure plugin 127 | .idea/replstate.xml 128 | 129 | # Crashlytics plugin (for Android Studio and IntelliJ) 130 | com_crashlytics_export_strings.xml 131 | crashlytics.properties 132 | crashlytics-build.properties 133 | fabric.properties 134 | 135 | # Editor-based Rest Client 136 | .idea/httpRequests 137 | .idea/pilisp.iml 138 | .idea/misc.xml 139 | .idea/modules.xml 140 | .idea/vcs.xml 141 | .idea/codeStyles/Project.xml 142 | .idea/vcs.xml 143 | .idea/misc.xml 144 | .idea/modules.xml 145 | .idea/pilisp.iml 146 | .idea/codeStyles/Project.xml 147 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | language: c 3 | notifications: 4 | email: false 5 | before_install: 6 | - sudo apt-get update -qq 7 | - sudo apt-get install gcc 8 | - sudo apt-get install gcovr 9 | - sudo apt-get install python3 10 | - sudo apt-get install python3-pip 11 | - wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip 12 | - sudo unzip ninja-linux.zip -d /usr/local/bin/ 13 | - sudo update-alternatives --install /usr/bin/ninja ninja /usr/local/bin/ninja 1 --force 14 | - sudo pip3 install meson==0.44.0 15 | - sudo pip install codecov 16 | - sudo apt-get install doxygen 17 | - "sudo apt-get install graphviz" # required for drawing dependecy graphs 18 | - "sudo pip install --upgrade pip" # last version 19 | - "sudo pip install pydot-ng pyparsing" # required for drawing dependecy graphs 20 | after_success: 21 | - bash <(curl -s https://codecov.io/bash) -g '*test*' -g '*main*' -g '*piprint*' -g '*pichecks*' -g '*pierror*' -g '*pilisp*' 22 | script: 23 | - curl --data-binary @codecov.yml https://codecov.io/validate 24 | - meson build -Dc_args=-Og -Db_coverage=true # enable coverage 25 | - ninja -C build # build project 26 | - MESON_TESTTHREADS=1 ninja test -C build # run tests 27 | - gcovr -r . -e '.*/test/.*' -e '.*pitestutils*' -e '.*main*' -e '.*pilisp*' -e '.*pichecks*' -e '.*pierror*' 28 | - doxygen # auto generate documentation 29 | - mv img/ftv2doc.png docs/html/ 30 | - mv img/ftv2folderclosed.png docs/html/ 31 | - mv img/ftv2folderopen.png docs/html/ 32 | deploy: 33 | provider: pages 34 | local-dir: docs/html 35 | skip-cleanup: true 36 | file_glob: true 37 | file: docs/* 38 | overwrite: true 39 | github-token: $GITHUB_TOKEN 40 | on: 41 | branch: master 42 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Mac", 5 | "includePath": [ 6 | "/usr/include", 7 | "/usr/local/include", 8 | "${workspaceRoot}", 9 | "${workspaceFolder}/include" 10 | ], 11 | "defines": [], 12 | "intelliSenseMode": "clang-x64", 13 | "browse": { 14 | "path": [ 15 | "/usr/include", 16 | "/usr/local/include", 17 | "${workspaceRoot}" 18 | ], 19 | "limitSymbolsToIncludedHeaders": true, 20 | "databaseFilename": "" 21 | }, 22 | "macFrameworkPath": [ 23 | "/System/Library/Frameworks", 24 | "/Library/Frameworks" 25 | ], 26 | "compilerPath": "/usr/bin/clang", 27 | "cStandard": "c11", 28 | "cppStandard": "c++17" 29 | }, 30 | { 31 | "name": "Linux", 32 | "includePath": [ 33 | "/usr/include", 34 | "/usr/local/include", 35 | "${workspaceRoot}", 36 | "${workspaceRoot}/include" 37 | ], 38 | "defines": [], 39 | "intelliSenseMode": "clang-x64", 40 | "browse": { 41 | "path": [ 42 | "/usr/include", 43 | "/usr/local/include", 44 | "${workspaceRoot}", 45 | "${workspaceRoot}/include", 46 | "${workspaceRoot}/src", 47 | "${workspaceRoot}/test" 48 | ], 49 | "limitSymbolsToIncludedHeaders": true, 50 | "databaseFilename": "" 51 | }, 52 | "compilerPath": "/usr/bin/clang", 53 | "cStandard": "c11", 54 | "cppStandard": "c++17", 55 | "compileCommands": "${workspaceFolder}/build/compile_commands.json" 56 | }, 57 | { 58 | "name": "Win32", 59 | "includePath": [ 60 | "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*", 61 | "C:/Program Files (x86)/Windows Kits/10/Include/10.0.14393.0/um", 62 | "C:/Program Files (x86)/Windows Kits/10/Include/10.0.14393.0/ucrt", 63 | "C:/Program Files (x86)/Windows Kits/10/Include/10.0.14393.0/shared", 64 | "C:/Program Files (x86)/Windows Kits/10/Include/10.0.14393.0/winrt", 65 | "C:/MinGW/include", 66 | "C:/MinGW/mingw32/include", 67 | "C:/MinGW/msys/1.0/include", 68 | "C:/MinGW/lib/gcc/mingw32/5.3.0/include", 69 | "C:/MinGW/lib/gcc/mingw32/5.3.0/include-fixed", 70 | "C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++", 71 | "C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++/mingw32", 72 | "${workspaceRoot}" 73 | ], 74 | "defines": [ 75 | "_DEBUG", 76 | "UNICODE" 77 | ], 78 | "intelliSenseMode": "msvc-x64", 79 | "browse": { 80 | "path": [ 81 | "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*", 82 | "C:/Program Files (x86)/Windows Kits/10/Include/10.0.14393.0/um", 83 | "C:/Program Files (x86)/Windows Kits/10/Include/10.0.14393.0/ucrt", 84 | "C:/Program Files (x86)/Windows Kits/10/Include/10.0.14393.0/shared", 85 | "C:/Program Files (x86)/Windows Kits/10/Include/10.0.14393.0/winrt", 86 | "C:/MinGW/include", 87 | "C:/MinGW/mingw32/include", 88 | "C:/MinGW/msys/1.0/include", 89 | "C:/MinGW/lib/gcc/mingw32/5.3.0/include", 90 | "C:/MinGW/lib/gcc/mingw32/5.3.0/include-fixed", 91 | "C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++", 92 | "C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++/mingw32", 93 | "${workspaceRoot}" 94 | ], 95 | "limitSymbolsToIncludedHeaders": true, 96 | "databaseFilename": "" 97 | }, 98 | "compilerPath": "/usr/bin/clang", 99 | "cStandard": "c11", 100 | "cppStandard": "c++17" 101 | } 102 | ], 103 | "version": 4 104 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "(gdb) Test", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${workspaceFolder}/build/test/lisp_program_test", 12 | "args": [], 13 | "stopAtEntry": false, 14 | "cwd": "${workspaceFolder}", 15 | "environment": [], 16 | "externalConsole": true, 17 | "MIMode": "gdb", 18 | "setupCommands": [ 19 | { 20 | "description": "Enable pretty-printing for gdb", 21 | "text": "-enable-pretty-printing", 22 | "ignoreFailures": true 23 | } 24 | ] 25 | }, 26 | { 27 | "name": "(gdb) Launch", 28 | "type": "cppdbg", 29 | "request": "launch", 30 | "program": "${workspaceFolder}/build/pilisp", 31 | "args": [], 32 | "stopAtEntry": false, 33 | "cwd": "${workspaceFolder}", 34 | "environment": [], 35 | "externalConsole": true, 36 | "MIMode": "gdb", 37 | "setupCommands": [ 38 | { 39 | "description": "Enable pretty-printing for gdb", 40 | "text": "-enable-pretty-printing", 41 | "ignoreFailures": true 42 | } 43 | ] 44 | } 45 | ] 46 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.enabled": true, 3 | "files.associations": { 4 | "exception": "c", 5 | "type_traits": "c", 6 | "pitestutils.h": "c", 7 | "pilisp.h": "c", 8 | "typeinfo": "c", 9 | "pierror.h": "c", 10 | "picell.h": "c", 11 | "string.h": "c", 12 | "error.h": "c", 13 | "stdbool.h": "c", 14 | "setjmp.h": "c", 15 | "piparser.h": "c", 16 | "pibuiltin.h": "c", 17 | "piinit.h": "c", 18 | "array": "c", 19 | "initializer_list": "c", 20 | "utility": "c", 21 | "*.tcc": "c", 22 | "chrono": "c", 23 | "functional": "c", 24 | "ratio": "c", 25 | "tuple": "c", 26 | "pifile.h": "c", 27 | "pistack.h": "c" 28 | }, 29 | "cSpell.enabledLanguageIds": [ 30 | "asciidoc", 31 | "c", 32 | "cpp", 33 | "csharp", 34 | "css", 35 | "go", 36 | "handlebars", 37 | "html", 38 | "jade", 39 | "javascript", 40 | "javascriptreact", 41 | "json", 42 | "latex", 43 | "less", 44 | "markdown", 45 | "php", 46 | "plaintext", 47 | "pub", 48 | "python", 49 | "restructuredtext", 50 | "rust", 51 | "scss", 52 | "text", 53 | "typescript", 54 | "typescriptreact", 55 | "yml" 56 | ] 57 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "Build", 8 | "type": "shell", 9 | "command": "ninja", 10 | "group": { 11 | "kind": "build", 12 | "isDefault": true 13 | }, 14 | "options": { 15 | "cwd": "${workspaceRoot}/build" 16 | }, 17 | "presentation": { 18 | "echo": true, 19 | "reveal": "always", 20 | "focus": true, 21 | "panel": "shared" 22 | }, 23 | "problemMatcher": { 24 | "base":"$gcc", 25 | "fileLocation" : ["relative", "${workspaceRoot}/build"] 26 | } 27 | }, 28 | { 29 | "label": "Scan", 30 | "type": "shell", 31 | "command": "ninja -C build && ninja scan-build -C build", 32 | "presentation": { 33 | "echo": true, 34 | "reveal": "always", 35 | "focus": true, 36 | "panel": "dedicated" 37 | }, 38 | "problemMatcher": { 39 | "base":"$gcc", 40 | "fileLocation" : ["relative", "${workspaceRoot}/build/meson-private/tmpsm350_09"] 41 | } 42 | }, 43 | { 44 | "label": "Run", 45 | "type": "shell", 46 | "presentation": { 47 | "echo": true, 48 | "reveal": "always", 49 | "focus": true, 50 | "panel": "new" 51 | }, 52 | "command": "ninja -C build && ./build/pilisp", 53 | "problemMatcher": [ 54 | "$gcc" 55 | ] 56 | }, 57 | { 58 | "label": "Test", 59 | "type": "shell", 60 | "group": { 61 | "kind": "test", 62 | "isDefault": true 63 | }, 64 | "presentation": { 65 | "echo": true, 66 | "reveal": "always", 67 | "focus": true, 68 | "panel": "shared" 69 | }, 70 | "options": { 71 | "cwd": "${workspaceRoot}/build" 72 | }, 73 | "command": "ninja && MESON_TESTTHREADS=1 ninja test", 74 | "problemMatcher":{ 75 | "base":"$gcc", 76 | "fileLocation" : ["relative", "${workspaceRoot}/build"] 77 | } 78 | } 79 | ] 80 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pilisp # 2 | 3 | [](https://travis-ci.com/parof/pilisp) [](https://codecov.io/gh/parof/pilisp) [](https://parof.github.io/pilisp/) 4 | 5 | * [Introduction](#introduction) 6 | * [Language](#language) 7 | * [Documentation](#documentation) 8 | * [Installation](#installation) 9 | 10 | ## Introduction ## 11 | 12 | Pilisp aims to be a small LISP interpreter for the 1.5 version of the language described [here](http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf). 13 | 14 | ### Features ### 15 | 16 | * **Lambdas**: (lambda ({args}) {body}) syntax allowed 17 | * **Garbage Collector**: mark and sweep garbage collector 18 | * **Bytecode virtual machine interpreter**: some simple lambdas can be compiled to a bytecode faster version 19 | * **Memory dump builtin**: (md) prints the structure of the allocated memory 20 | 21 | ### Performance ### 22 | 23 | These are the performances compared to other Lisp interpreters: [CLisp](https://clisp.sourceforge.io/), Yoctolisp (similar performances to [Femtolisp](https://github.com/JeffBezanson/femtolisp)) and [SBCL](http://www.sbcl.org/). 24 | 25 | 26 |  27 | 28 | 29 | ## Language ## 30 | 31 | The language accepted by the interpreter is inspired to the [Common Lisp](https://en.wikipedia.org/wiki/Common_Lisp), but keeps the _homoiconicity_ feature of the original definition of the LISP 1.5: data and instructions are kept together in the same data structure, the _cons cell_. 32 | 33 | ### Builtin functions ### 34 | 35 | * Lisp basic functions 36 | * car 37 | * cdr 38 | * cons 39 | * atom 40 | * eq 41 | * quote 42 | * cond 43 | * Arithmetic 44 | * \+ 45 | * \- 46 | * \* 47 | * \/ 48 | * Logic 49 | * or 50 | * and 51 | * not 52 | * Comparison 53 | * \> 54 | * \>= 55 | * \< 56 | * \<= 57 | * integerp 58 | * symbolp 59 | * Lists operations 60 | * list 61 | * reverse 62 | * member 63 | * nth 64 | * concatenate 65 | * append 66 | * length 67 | * subseq 68 | * Common Lisp inherited functions 69 | * set 70 | * write 71 | * load 72 | * bye 73 | * Macros 74 | * setq 75 | * defun 76 | * let 77 | * dotimes 78 | * map 79 | * time 80 | * defmacro 81 | * Pilisp special functions 82 | * md: prints the memory 83 | * env: prints the global env 84 | * cg: calls the garbage collector 85 | 86 | ### Bytecode instruction set ### 87 | 88 | You can optionally produce one mid-representation for some expression. The bytecode will run faster than normal LISP code. 89 | To achieve this goal Pilisp interpreter adds these instructions to the language: 90 | 91 | * **plc**: PiLisp Compiler. Called on one sexpression tries to produce the corresponding bytecode of one quoted expression. 92 | 93 | ``` 94 | (plc '(car '(a))) => (ASM "!$B" (A) CAR) 95 | ``` 96 | 97 | * **asm**: c-like notation for assembly. This instruction can be interpreted. The first arg is the machine code. Refer [here](#instructionset) for the list of codes. The other arguments are the parameters. 98 | 99 | ``` 100 | (ASM "!$B" (A) CAR) 101 | ``` 102 | has to be read as: `load a const -> that const is (A) -> apply a builtin function -> That function is car -> That function has 1 parameter -> Put the result on the top of the stack` . The result of a computation is always the top of the stack. 103 | 104 | * **lasm**: lambda-asm. Represents a asm computation that accepts input parameters: it is a compiled lambda. The first parameter represents the number of parameters. The rest of the parameters are the same as asm. 105 | 106 | ``` 107 | ((LASM 1 "@A!$C" 1 +) 2) 108 | ``` 109 | The last is an example of the 1+ function compiled and applied to the number 2 110 | 111 | * **compile**: tries to compile one function. If this is possible the new definition will be substituted to the old one. 112 | 113 | ``` 114 | (defun id (x) x) 115 | (compile id) 116 | ``` 117 | will produce a new and faster identity function. 118 | 119 | 120 | #### Instruction set #### 121 | | Code | Meaning | 122 | | :---: | :---: | 123 | | ! | load constant | 124 | | ? | load symbol | 125 | | @ | load name from stack | 126 | | $ | apply builtin lambda | 127 | | \[A-Z\] | numbers from 0 to 25 | 128 | 129 | 130 | ## Documentation ## 131 | 132 | Full code documentation can be found on [github pages](https://parof.github.io/pilisp/). It is automatically generated using [Doxygen](http://www.stack.nl/~dimitri/doxygen/), with [Bootstrap](https://getbootstrap.com/) CSS (using [this](https://github.com/Velron/doxygen-bootstrapped) guide). The code documentation is generated every push with [Travis CI](https://travis-ci.org/), so it should be always up to date. 133 | 134 | ## Installation ## 135 | 136 | ### Prerequisites ### 137 | 138 | * [Meson](http://mesonbuild.com/) (version 0.44 or newer) 139 | * [Python](https://www.python.org/) (version 3.5 or newer) 140 | * [Ninja](https://ninja-build.org/) (version 1.5 or newer) 141 | 142 | ### Installing with Meson ### 143 | 144 | These commands should run on any OS. To build the `ninja.build` file run. The `-Dc_args` will add optimizations. 145 | 146 | ``` 147 | meson build -Dc_args=-Og 148 | ``` 149 | 150 | To build the executable in the `build` directory run 151 | 152 | ``` 153 | ninja -C build 154 | ``` 155 | 156 | To install `pilisp` run with root permissions 157 | 158 | ``` 159 | ninja install -C build 160 | ``` 161 | 162 | To run tests use 163 | 164 | ``` 165 | ninja test -C build 166 | ``` 167 | 168 | By default Meson won't allow debugging: if you want to run a debbuger you have to write: 169 | ``` 170 | meson build -Db_coverage=true 171 | ``` 172 | 173 | Run with Valngrid: 174 | ``` 175 | meson test --wrap=valgrind 'testname' 176 | ``` 177 | -------------------------------------------------------------------------------- /compiler/compiler.lisp: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; ;; 3 | ;; 88""Yb 88 88 88 .dP"Y8 88""Yb dP""b8 dP"Yb 8b d8 88""Yb 88 88 888888 88""Yb ;; 4 | ;; 88__dP 88 88 88 `Ybo." 88__dP dP `" dP Yb 88b d88 88__dP 88 88 88__ 88__dP ;; 5 | ;; 88""" 88 88 .o 88 o.`Y8b 88""" Yb Yb dP 88YbdP88 88""" 88 88 .o 88"" 88"Yb ;; 6 | ;; 88 88 88ood8 88 8bodP' 88 YboodP YbodP 88 YY 88 88 88 88ood8 888888 88 Yb ;; 7 | ;; ;; 8 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 9 | 10 | 11 | ; (plc '[EXPRESSION]) -> (asm [ASM_STRING] {ARGS_LIST}) 12 | (defun plc (not_evaluated_expression) 13 | ( get_interpretable_code 14 | ( _compile not_evaluated_expression nil) 15 | not_evaluated_expression)) 16 | 17 | ;; **************************************************************** 18 | ;; *=================== Instructions Generator ===================* 19 | ;; **************************************************************** 20 | 21 | 22 | ; Instructions: 23 | ; :loadconst -> load one const followed by the const 24 | ; :loadstack -> load one stack parameter followed by the position 25 | ; :loadsymbol -> load one symbol followed by the symbol 26 | ; :argsnum -> start of a lambda with n parameters 27 | ; :cbs -> call builtin stack function 28 | ; 29 | ; If the expression is not compilable the result will be: 30 | ; :notcompilable 31 | ; 32 | 33 | (setq builtin_stack_lambdas 34 | '( car cdr cons atom eq list +)) 35 | 36 | (defun _compile (expr symbol_table) 37 | (cond 38 | ((atom expr) 39 | (list ( compile_atom expr symbol_table))) 40 | 41 | (( is_quoted_expression expr) 42 | (list ( compile_quote expr))) 43 | 44 | ((atom (car expr)) 45 | ( compile_atom_function expr symbol_table)) 46 | 47 | (( else) 48 | :notcompilable ))) 49 | 50 | ;; ==================== Atom or Quote Compiling ==================== 51 | 52 | (defun compile_atom (ato symbol_table) 53 | (cond 54 | (( null ato) 55 | (cons :loadconst ato)) 56 | ((eq ato t) 57 | (cons :loadconst ato)) 58 | (( has_value_in_stack ato symbol_table) 59 | (cons :loadstack ( get_stack_index ato symbol_table))) 60 | ((symbolp ato) 61 | ;; here search in the symbol table 62 | (cons :loadsymbol ato)) 63 | (( else) 64 | (cons :loadconst ato)))) 65 | 66 | (defun has_value_in_stack (name symbol_table) 67 | (cond 68 | ((null symbol_table) nil) 69 | ((eq name ( extract_first_symbol symbol_table)) t) 70 | (( else) ( has_value_in_stack name ( next symbol_table))))) 71 | 72 | (defun get_stack_index (name symbol_table) 73 | (cond 74 | ((null symbol_table) nil) ; unreachable 75 | ((eq name ( extract_first_symbol symbol_table)) 76 | ( extract_first_index symbol_table)) 77 | (( else) 78 | ( get_stack_index name ( next symbol_table))))) 79 | 80 | (defun extract_first_symbol (symbol_table) 81 | (car (car symbol_table))) 82 | 83 | (defun extract_first_index (symbol_table) 84 | (cdr (car symbol_table))) 85 | 86 | (defun compile_quote (quote_expression) 87 | (cons :loadconst ( extract_cons_cell quote_expression))) 88 | 89 | (defun extract_cons_cell (quote_expression) 90 | (car (cdr quote_expression))) 91 | 92 | ;; ==================== Atom function Compiling ==================== 93 | 94 | (defun compile_atom_function (expr symbol_table) 95 | ( compile_atom_function_name_args (car expr) (cdr expr) symbol_table)) 96 | 97 | (defun compile_atom_function_name_args (fun args symbol_table) 98 | (cond 99 | (( is_builtin_stack fun) 100 | ( compile_builtin_stack fun args symbol_table)) 101 | (( is_lambda fun) 102 | ( compile_lambda fun args symbol_table)) 103 | ;; (( is_cond fun) 104 | ;; ( compile_cond fun args symbol_table)) 105 | (( else) 106 | :notcompilable ))) 107 | 108 | (defun is_builtin_stack (fun) 109 | (member fun builtin_stack_lambdas)) 110 | 111 | (defun is_lambda (fun) 112 | (eq fun 'lambda)) 113 | 114 | ;; (defun is_cond (fun) 115 | ;; (eq fun 'cond)) 116 | 117 | ;; ==================== Builtin stack compiling ==================== 118 | 119 | (defun compile_builtin_stack (fun args_list symbol_table) 120 | ( compile_args_and_append_builtin_stack fun args_list ( count_args args_list) symbol_table)) 121 | 122 | ; why keep passing fun? -> no list surgery, but when found the botton 123 | ; naturally append the function apply 124 | (defun compile_args_and_append_builtin_stack (fun args_list initial_args_number symbol_table) 125 | (cond 126 | ((null args_list) 127 | ( create_builtin_stack_trailer fun initial_args_number)) 128 | (( else) 129 | ( let 130 | ((first_arg_compiled 131 | ( compile_first_arg args_list symbol_table)) 132 | (rest_of_the_args_compiled 133 | ( compile_remaining_list_and_append_builtin_stack fun args_list initial_args_number symbol_table))) 134 | ( compile_only_if_everything_is_compilable first_arg_compiled rest_of_the_args_compiled))))) 135 | 136 | (defun compile_only_if_everything_is_compilable (first_arg_compiled rest_of_the_args_compiled) 137 | (cond 138 | (( both_compilables first_arg_compiled rest_of_the_args_compiled) 139 | (append first_arg_compiled rest_of_the_args_compiled)) 140 | (( else) 141 | :notcompilable))) 142 | 143 | (defun compile_first_arg (args_list symbol_table) 144 | ( _compile (car args_list) symbol_table)) 145 | 146 | (defun compile_remaining_list_and_append_builtin_stack (fun args_list initial_args_number symbol_table) 147 | ( compile_args_and_append_builtin_stack fun ( next args_list) initial_args_number symbol_table)) 148 | 149 | (defun create_builtin_stack_trailer (fun initial_args_number) 150 | (list 151 | (cons :cbs fun) 152 | ( get_params_trailer initial_args_number))) 153 | 154 | (defun get_params_trailer (args_number) 155 | (cons :argsnum args_number)) 156 | 157 | ;; ==================== Lambda Compiling ==================== 158 | 159 | (defun compile_lambda (fun args symbol_table) 160 | (let ( 161 | (lambda_args ( extract_lambda_args args)) 162 | (lambda_body ( extract_lambda_body args)) 163 | (new_symbol_table ( build_symbol_table ( extract_lambda_args args) symbol_table))) 164 | (let ( 165 | (lambda_args_number_instruction ( build_lambda_args_number_instruction lambda_args)) 166 | (lambda_body_instruction_list ( build_lambda_body_instruction_list lambda_body new_symbol_table))) 167 | ( compile_lambda_only_if_compilable lambda_args_number_instruction lambda_body_instruction_list)))) 168 | 169 | (defun compile_lambda_only_if_compilable (lambda_args_number_instruction lambda_body_instructions_list) 170 | (cond 171 | (( is_compilable lambda_body_instructions_list) 172 | (cons 173 | lambda_args_number_instruction 174 | lambda_body_instructions_list)) 175 | (( else) 176 | :notcompilable))) 177 | 178 | ;; @ BUILD LAMBDA BODY 179 | (defun build_lambda_body_instruction_list (lambda_body symbol_table) 180 | ( _compile lambda_body symbol_table)) 181 | 182 | ;; @ SYMBOL TABLE 183 | ;; pushes on the top of the old symbol table the new symbols 184 | (defun build_symbol_table (lambda_args old_symbol_table) 185 | (let 186 | ((new_symbol_table_head 187 | (reverse ( build_symbol_table_with_position lambda_args 0)))) 188 | (append 189 | new_symbol_table_head 190 | old_symbol_table))) 191 | 192 | ; we need the position to set that number in the pair (x . 0) 193 | (defun build_symbol_table_with_position (lambda_args actual_position) 194 | (cond 195 | ((null lambda_args) nil) 196 | (( else) ( build_one_symbol_and_the_rest_of_the_list lambda_args actual_position)))) 197 | 198 | (defun build_one_symbol_and_the_rest_of_the_list (lambda_args actual_position) 199 | (cons 200 | ( build_one_symbol lambda_args actual_position) 201 | ( build_symbol_table_with_position ( next lambda_args) (1+ actual_position)))) 202 | 203 | (defun build_one_symbol (lambda_args actual_position) 204 | (cons (car lambda_args) actual_position)) 205 | 206 | (defun build_lambda_args_number_instruction (lambda_args) 207 | (cons :lambdanargs ( count_args lambda_args))) 208 | 209 | ; @param lambda cons -> ((x y z) (+ x y z)) 210 | (defun extract_lambda_args (lambda_cons) 211 | (car lambda_cons)) 212 | 213 | (defun extract_lambda_body (lambda_cons) 214 | (car (cdr lambda_cons))) 215 | 216 | ;; ***************************************************************** 217 | ;; *=================== Machine Code Generation ===================* 218 | ;; ***************************************************************** 219 | 220 | ; ((:[INSTRUCTION] . [PARAM]) {(:[INSTRUCTION] . [PARAM])} ) 221 | ; -> (ASM "{MACHINE_CODE_OPERATIONS}" {PARAMETERS}) 222 | (defun get_interpretable_code (compiled_expression original_expression) 223 | (cond 224 | ((eq compiled_expression :notcompilable) 225 | original_expression ) 226 | ((not ( is_lasm compiled_expression)) 227 | ; asm 228 | (cons 'asm 229 | ( build_interpretable_string_and_args compiled_expression))) 230 | (( else) 231 | ; lambda asm 232 | (cons 'lasm 233 | (cons 234 | (cdr (car compiled_expression)) 235 | ( build_interpretable_string_and_args ( next compiled_expression))))))) 236 | 237 | (defun is_lasm (compiled_expression) 238 | (eq :lambdanargs (car (car compiled_expression)))) 239 | 240 | (defun build_interpretable_string_and_args (compiled_expression) 241 | (cons 242 | ( extract_machine_code_string compiled_expression ) 243 | ( extract_args compiled_expression))) 244 | 245 | (defun extract_instruction_code (compiled_expression) 246 | (car (car compiled_expression))) 247 | 248 | (defun extract_arg (compiled_expression) 249 | (cdr (car compiled_expression))) 250 | 251 | ;; ==================== Args append ==================== 252 | 253 | (defun extract_args (compiled_expression) 254 | (cond 255 | ((null compiled_expression) nil) 256 | (( else) ( build_one_arg_and_extract_next compiled_expression)))) 257 | 258 | (defun build_one_arg_and_extract_next (compiled_expression) 259 | (cond 260 | (( must_ignore_arg compiled_expression) 261 | ( extract_args (cdr compiled_expression))) 262 | (( else) 263 | (cons 264 | ( extract_arg compiled_expression) 265 | ( extract_args (cdr compiled_expression)))))) 266 | 267 | ; case: (list 1 2 3 4) -> compilation -> 268 | ; ((:LOADCONST . 1) (:LOADCONST . 2) (:LOADCONST . 3) 269 | ; (:LOADCONST . 4) (:CBS0 . LIST) (:ARGSNUM . 4)) 270 | ; -> must not append the last 4 to the list 271 | (defun must_ignore_arg (compiled_expression) 272 | (cond 273 | ((eq :argsnum ( extract_instruction_code compiled_expression)) t) 274 | ((eq :loadstack ( extract_instruction_code compiled_expression)) t) 275 | (( else) nil))) 276 | 277 | ;; ==================== Machine code string generation ==================== 278 | 279 | (defun extract_machine_code_string (compiled_expression) 280 | (cond 281 | ((null compiled_expression) "") 282 | (( else) ( build_remaining_machine_code_string_char compiled_expression)))) 283 | 284 | (defun build_remaining_machine_code_string_char (compiled_expression) 285 | (concatenate 'string 286 | ( get_instruction_code compiled_expression) 287 | ( extract_machine_code_string ( next compiled_expression)))) 288 | 289 | (defun get_instruction_code (compiled_expression) 290 | ( translate_instruction_code 291 | ( extract_instruction_code compiled_expression) 292 | ( extract_arg compiled_expression))) 293 | 294 | ; ( :[keyword] argument ) -> "[MACHINE_CODE]{OPTIONAL_NUM}" 295 | (defun translate_instruction_code (code arg) 296 | (cond 297 | ((eq code :loadconst) "!") 298 | ((eq code :loadsymbol) "?") 299 | ((eq code :cbs) "$") 300 | ((eq code :loadstack) ( get_instruction_code_for_stack_load arg)) ; arg will be the index in the stack 301 | ((eq code :argsnum) ( translate_num_to_digit arg)) 302 | (( else) "__ERROR:UNKNOWN_INSTRUCTION_CODE__"))) 303 | 304 | ; this will be a pair 305 | (defun get_instruction_code_for_stack_load (stack_index) 306 | (concatenate 'string "@" ( translate_num_to_digit stack_index))) 307 | 308 | (defun translate_num_to_digit (args_number) 309 | (cond 310 | ((eq args_number 0) "A") 311 | ((eq args_number 1) "B") 312 | ((eq args_number 2) "C") 313 | ((eq args_number 3) "D") 314 | ((eq args_number 4) "E") 315 | ((eq args_number 5) "F") 316 | ((eq args_number 6) "G") 317 | ((eq args_number 7) "H") 318 | ((eq args_number 8) "I") 319 | ((eq args_number 9) "J") 320 | ((eq args_number 10) "K") 321 | ((eq args_number 11) "L") 322 | ((eq args_number 12) "M") 323 | ((eq args_number 13) "n") 324 | ((eq args_number 14) "O") 325 | ((eq args_number 15) "P") 326 | ((eq args_number 16) "Q") 327 | ((eq args_number 17) "R") 328 | ((eq args_number 18) "S") 329 | ((eq args_number 19) "T") 330 | ((eq args_number 20) "U") 331 | ((eq args_number 21) "V") 332 | ((eq args_number 22) "W") 333 | ((eq args_number 23) "X") 334 | ((eq args_number 24) "Y") 335 | ((eq args_number 25) "Z") 336 | (( else) "__ERROR:TOO_MANY_ARGS__"))) 337 | 338 | 339 | 340 | ;; ************************************************* 341 | ;; *=================== Utility ===================* 342 | ;; ************************************************* 343 | 344 | 345 | (defun is_quoted_expression (expr) 346 | (and (atom (car expr)) (eq 'quote (car expr)))) 347 | 348 | (defun is_compilable (expression) 349 | (not (eq expression :notcompilable))) 350 | 351 | (defun count_args (args_list) 352 | (length args_list)) 353 | 354 | (defun else () t) 355 | 356 | (defun next (l) (cdr l)) 357 | 358 | (defun both_compilables (first_sequence second_sequence) 359 | (and ( is_compilable first_sequence) 360 | ( is_compilable second_sequence))) 361 | 362 | T -------------------------------------------------------------------------------- /docs/doxystyle/customdoxygen.css: -------------------------------------------------------------------------------- 1 | h1, .h1, h2, .h2, h3, .h3{ 2 | font-weight: 200 !important; 3 | } 4 | 5 | #navrow1, #navrow2, #navrow3, #navrow4, #navrow5{ 6 | border-bottom: 1px solid #EEEEEE; 7 | } 8 | 9 | .adjust-right { 10 | margin-left: 30px !important; 11 | font-size: 1.15em !important; 12 | } 13 | .navbar{ 14 | border: 0px solid #222 !important; 15 | } 16 | table{ 17 | white-space:pre-wrap !important; 18 | } 19 | /* 20 | =========================== 21 | */ 22 | 23 | 24 | /* Sticky footer styles 25 | -------------------------------------------------- */ 26 | html, 27 | body { 28 | height: 100%; 29 | /* The html and body elements cannot have any padding or margin. */ 30 | } 31 | 32 | /* Wrapper for page content to push down footer */ 33 | #wrap { 34 | min-height: 100%; 35 | height: auto; 36 | /* Negative indent footer by its height */ 37 | margin: 0 auto -60px; 38 | /* Pad bottom by footer height */ 39 | padding: 0 0 60px; 40 | } 41 | 42 | /* Set the fixed height of the footer here */ 43 | #footer { 44 | font-size: 0.9em; 45 | padding: 8px 0px; 46 | background-color: #f5f5f5; 47 | } 48 | 49 | .footer-row { 50 | line-height: 44px; 51 | } 52 | 53 | #footer > .container { 54 | padding-left: 15px; 55 | padding-right: 15px; 56 | } 57 | 58 | .footer-follow-icon { 59 | margin-left: 3px; 60 | text-decoration: none !important; 61 | } 62 | 63 | .footer-follow-icon img { 64 | width: 20px; 65 | } 66 | 67 | .footer-link { 68 | padding-top: 5px; 69 | display: inline-block; 70 | color: #999999; 71 | text-decoration: none; 72 | } 73 | 74 | .footer-copyright { 75 | text-align: center; 76 | } 77 | 78 | 79 | @media (min-width: 992px) { 80 | .footer-row { 81 | text-align: left; 82 | } 83 | 84 | .footer-icons { 85 | text-align: right; 86 | } 87 | } 88 | @media (max-width: 991px) { 89 | .footer-row { 90 | text-align: center; 91 | } 92 | 93 | .footer-icons { 94 | text-align: center; 95 | } 96 | } 97 | 98 | /* DOXYGEN Code Styles 99 | ----------------------------------- */ 100 | 101 | 102 | a.qindex { 103 | font-weight: bold; 104 | } 105 | 106 | a.qindexHL { 107 | font-weight: bold; 108 | background-color: #9CAFD4; 109 | color: #ffffff; 110 | border: 1px double #869DCA; 111 | } 112 | 113 | .contents a.qindexHL:visited { 114 | color: #ffffff; 115 | } 116 | 117 | a.code, a.code:visited, a.line, a.line:visited { 118 | color: #4665A2; 119 | } 120 | 121 | a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { 122 | color: #4665A2; 123 | } 124 | 125 | /* @end */ 126 | 127 | dl.el { 128 | margin-left: -1cm; 129 | } 130 | 131 | pre.fragment { 132 | border: 1px solid #C4CFE5; 133 | background-color: #FBFCFD; 134 | padding: 4px 6px; 135 | margin: 4px 8px 4px 2px; 136 | overflow: auto; 137 | word-wrap: break-word; 138 | font-size: 9pt; 139 | line-height: 125%; 140 | font-family: monospace, fixed; 141 | font-size: 105%; 142 | } 143 | 144 | div.fragment { 145 | padding: 4px 6px; 146 | margin: 4px 8px 4px 2px; 147 | border: 1px solid #C4CFE5; 148 | } 149 | 150 | div.line { 151 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; 152 | font-size: 12px; 153 | min-height: 13px; 154 | line-height: 1.0; 155 | text-wrap: unrestricted; 156 | white-space: -moz-pre-wrap; /* Moz */ 157 | white-space: -pre-wrap; /* Opera 4-6 */ 158 | white-space: -o-pre-wrap; /* Opera 7 */ 159 | white-space: pre-wrap; /* CSS3 */ 160 | word-wrap: normal; /* IE 5.5+ */ 161 | text-indent: -53px; 162 | padding-left: 53px; 163 | padding-bottom: 0px; 164 | margin: 0px; 165 | -webkit-transition-property: background-color, box-shadow; 166 | -webkit-transition-duration: 0.5s; 167 | -moz-transition-property: background-color, box-shadow; 168 | -moz-transition-duration: 0.5s; 169 | -ms-transition-property: background-color, box-shadow; 170 | -ms-transition-duration: 0.5s; 171 | -o-transition-property: background-color, box-shadow; 172 | -o-transition-duration: 0.5s; 173 | transition-property: background-color, box-shadow; 174 | transition-duration: 0.5s; 175 | } 176 | div.line:hover{ 177 | background-color: #FBFF00; 178 | } 179 | 180 | div.line.glow { 181 | background-color: cyan; 182 | box-shadow: 0 0 10px cyan; 183 | } 184 | 185 | 186 | span.lineno { 187 | padding-right: 4px; 188 | text-align: right; 189 | color:rgba(0,0,0,0.3); 190 | border-right: 1px solid #EEE; 191 | border-left: 1px solid #EEE; 192 | background-color: #FFF; 193 | white-space: pre; 194 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace ; 195 | } 196 | span.lineno a { 197 | background-color: #FAFAFA; 198 | cursor:pointer; 199 | } 200 | 201 | span.lineno a:hover { 202 | background-color: #EFE200; 203 | color: #1e1e1e; 204 | } 205 | 206 | div.groupHeader { 207 | margin-left: 16px; 208 | margin-top: 12px; 209 | font-weight: bold; 210 | } 211 | 212 | div.groupText { 213 | margin-left: 16px; 214 | font-style: italic; 215 | } 216 | 217 | /* @group Code Colorization */ 218 | 219 | span.keyword { 220 | color: #008000 221 | } 222 | 223 | span.keywordtype { 224 | color: #604020 225 | } 226 | 227 | span.keywordflow { 228 | color: #e08000 229 | } 230 | 231 | span.comment { 232 | color: #800000 233 | } 234 | 235 | span.preprocessor { 236 | color: #806020 237 | } 238 | 239 | span.stringliteral { 240 | color: #002080 241 | } 242 | 243 | span.charliteral { 244 | color: #008080 245 | } 246 | 247 | span.vhdldigit { 248 | color: #ff00ff 249 | } 250 | 251 | span.vhdlchar { 252 | color: #000000 253 | } 254 | 255 | span.vhdlkeyword { 256 | color: #700070 257 | } 258 | 259 | span.vhdllogic { 260 | color: #ff0000 261 | } 262 | 263 | blockquote { 264 | background-color: #F7F8FB; 265 | border-left: 2px solid #9CAFD4; 266 | margin: 0 24px 0 4px; 267 | padding: 0 12px 0 16px; 268 | } 269 | 270 | /*---------------- Search Box */ 271 | 272 | #search-box { 273 | margin: 10px 0px; 274 | } 275 | #search-box .close { 276 | display: none; 277 | position: absolute; 278 | right: 0px; 279 | padding: 6px 12px; 280 | z-index: 5; 281 | } 282 | 283 | /*---------------- Search results window */ 284 | 285 | #search-results-window { 286 | display: none; 287 | } 288 | 289 | iframe#MSearchResults { 290 | width: 100%; 291 | height: 15em; 292 | } 293 | 294 | .SRChildren { 295 | padding-left: 3ex; padding-bottom: .5em 296 | } 297 | .SRPage .SRChildren { 298 | display: none; 299 | } 300 | a.SRScope { 301 | display: block; 302 | } 303 | a.SRSymbol:focus, a.SRSymbol:active, 304 | a.SRScope:focus, a.SRScope:active { 305 | text-decoration: underline; 306 | } 307 | span.SRScope { 308 | padding-left: 4px; 309 | } 310 | .SRResult { 311 | display: none; 312 | } 313 | 314 | /* class and file list */ 315 | .directory .icona, 316 | .directory .arrow { 317 | height: auto; 318 | } 319 | .directory .icona .icon { 320 | height: 16px; 321 | } 322 | .directory .icondoc { 323 | background-position: 0px 0px; 324 | height: 20px; 325 | } 326 | .directory .iconfopen { 327 | background-position: 0px 0px; 328 | } 329 | .directory td.entry { 330 | padding: 7px 8px 6px 8px; 331 | } 332 | 333 | .table > tbody > tr > td.memSeparator { 334 | line-height: 0; 335 | .table-hover; 336 | 337 | } 338 | 339 | .memItemLeft, .memTemplItemLeft { 340 | white-space: normal; 341 | } 342 | 343 | /* enumerations */ 344 | .panel-body thead > tr { 345 | background-color: #e0e0e0; 346 | } 347 | 348 | /* todo lists */ 349 | .todoname, 350 | .todoname a { 351 | font-weight: bold; 352 | } 353 | 354 | /* Class title */ 355 | .summary { 356 | margin-top: 25px; 357 | } 358 | .page-header { 359 | margin: 20px 0px !important; 360 | } 361 | .page-header .title { 362 | display: inline-block; 363 | } 364 | .page-header .pull-right { 365 | margin-top: 0.3em; 366 | margin-left: 0.5em; 367 | } 368 | .page-header .label { 369 | font-size: 50%; 370 | } 371 | -------------------------------------------------------------------------------- /docs/doxystyle/doxy-boot.js: -------------------------------------------------------------------------------- 1 | $( document ).ready(function() { 2 | 3 | $("div.headertitle").addClass("page-header"); 4 | $("div.title").addClass("h1"); 5 | 6 | $('li > a[href="index.html"] > span').before(" "); 7 | $('li > a[href="modules.html"] > span').before(" "); 8 | $('li > a[href="namespaces.html"] > span').before(" "); 9 | $('li > a[href="annotated.html"] > span').before(" "); 10 | $('li > a[href="classes.html"] > span').before(" "); 11 | $('li > a[href="inherits.html"] > span').before(" "); 12 | $('li > a[href="functions.html"] > span').before(" "); 13 | $('li > a[href="functions_func.html"] > span').before(" "); 14 | $('li > a[href="functions_vars.html"] > span').before(" "); 15 | $('li > a[href="functions_enum.html"] > span').before(" "); 16 | $('li > a[href="functions_eval.html"] > span').before(" "); 17 | $('img[src="ftv2ns.png"]').replaceWith('N '); 18 | $('img[src="ftv2cl.png"]').replaceWith('C '); 19 | 20 | $("ul.tablist").addClass("nav nav-pills nav-justified"); 21 | $("ul.tablist").css("margin-top", "0.5em"); 22 | $("ul.tablist").css("margin-bottom", "0.5em"); 23 | $("li.current").addClass("active"); 24 | $("iframe").attr("scrolling", "yes"); 25 | 26 | $("#nav-path > ul").addClass("breadcrumb"); 27 | 28 | $("table.params").addClass("table"); 29 | $("div.ingroups").wrapInner(""); 30 | $("div.levels").css("margin", "0.5em"); 31 | $("div.levels > span").addClass("btn btn-default btn-xs"); 32 | $("div.levels > span").css("margin-right", "0.25em"); 33 | 34 | $("table.directory").addClass("table table-striped"); 35 | $("div.summary > a").addClass("btn btn-default btn-xs"); 36 | $("table.fieldtable").addClass("table"); 37 | $(".fragment").addClass("well"); 38 | $(".memitem").addClass("panel panel-default"); 39 | $(".memproto").addClass("panel-heading"); 40 | $(".memdoc").addClass("panel-body"); 41 | $("span.mlabel").addClass("label label-info"); 42 | 43 | $("table.memberdecls").addClass("table"); 44 | $("[class^=memitem]").addClass("active"); 45 | 46 | $("div.ah").addClass("btn btn-default"); 47 | $("span.mlabels").addClass("pull-right"); 48 | $("table.mlabels").css("width", "100%") 49 | $("td.mlabels-right").addClass("pull-right"); 50 | 51 | $("div.ttc").addClass("panel panel-primary"); 52 | $("div.ttname").addClass("panel-heading"); 53 | $("div.ttname a").css("color", 'white'); 54 | $("div.ttdef,div.ttdoc,div.ttdeci").addClass("panel-body"); 55 | 56 | $('div.fragment.well div.line:first').css('margin-top', '2px'); 57 | $('div.fragment.well div.line:last').css('margin-bottom', '2px'); 58 | 59 | $('table.doxtable').removeClass('doxtable').addClass('table table-striped table-bordered').each(function(){ 60 | $(this).prepend(''); 61 | $(this).find('tbody > tr:first').prependTo($(this).find('thead')); 62 | 63 | $(this).find('td > span.success').parent().addClass('success'); 64 | $(this).find('td > span.warning').parent().addClass('warning'); 65 | $(this).find('td > span.danger').parent().addClass('danger'); 66 | }); 67 | 68 | 69 | 70 | if($('div.fragment.well div.ttc').length > 0) 71 | { 72 | $('div.fragment.well div.line:first').parent().removeClass('fragment well'); 73 | } 74 | 75 | $('table.memberdecls').find('.memItemRight').each(function(){ 76 | $(this).contents().appendTo($(this).siblings('.memItemLeft')); 77 | $(this).siblings('.memItemLeft').attr('align', 'left'); 78 | }); 79 | 80 | $('table.memberdecls').find('.memTemplItemRight').each(function(){ 81 | $(this).contents().appendTo($(this).siblings('.memTemplItemLeft')); 82 | $(this).siblings('.memTemplItemLeft').attr('align', 'left'); 83 | }); 84 | 85 | function getOriginalWidthOfImg(img_element) { 86 | var t = new Image(); 87 | t.src = (img_element.getAttribute ? img_element.getAttribute("src") : false) || img_element.src; 88 | return t.width; 89 | } 90 | 91 | $('div.dyncontent').find('img').each(function(){ 92 | if(getOriginalWidthOfImg($(this)[0]) > $('#content>div.container').width()) 93 | $(this).css('width', '100%'); 94 | }); 95 | 96 | 97 | /* responsive search box */ 98 | $('#MSearchBox').parent().remove(); 99 | 100 | var nav_container = $('
'); 101 | $('#navrow1').parent().prepend(nav_container); 102 | 103 | var left_nav = $(''); 104 | for (i = 0; i < 6; i++) { 105 | var navrow = $('#navrow' + i + ' > ul.tablist').detach(); 106 | left_nav.append(navrow); 107 | $('#navrow' + i).remove(); 108 | } 109 | var right_nav = $('').append('\ 110 |