Fix html.
This commit is contained in:
@ -24,17 +24,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="main">
|
<div id="main">
|
||||||
<!-- insert the page content here -->
|
<!-- insert the page content here -->
|
||||||
<h1>Cling.. interprets C++</h1>
|
<h1>Cling interprets C++</h1>
|
||||||
<p>
|
<p>
|
||||||
<pre><code class = "cpp">
|
<pre><code class = "cpp">
|
||||||
****************** CLING ******************
|
****************** CLING ******************
|
||||||
* Type C++ code and press enter to run it *
|
* Type C++ code and press enter to run it *
|
||||||
* Type .q to exit *
|
* Type .q to exit *
|
||||||
*******************************************
|
*******************************************
|
||||||
[cling]$ #include <string>
|
[cling]$ #include <string>
|
||||||
[cling]$ std::string s("abc");
|
[cling]$ std::string s("abc");
|
||||||
[cling]$ s.find('b')
|
[cling]$ s.find('b')
|
||||||
(std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type) 1
|
(std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type) 1
|
||||||
[cling]$
|
[cling]$
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</p>
|
</p>
|
||||||
@ -56,10 +56,10 @@
|
|||||||
<li>Creating scripts
|
<li>Creating scripts
|
||||||
<p>
|
<p>
|
||||||
The power of an interpreter lays as well in the compactness and ease of repeatedly running a small snippet of code - aka a script. This can be done in cling by inserting the bash-like style line:
|
The power of an interpreter lays as well in the compactness and ease of repeatedly running a small snippet of code - aka a script. This can be done in cling by inserting the bash-like style line:
|
||||||
|
</p>
|
||||||
<pre><code>
|
<pre><code>
|
||||||
#!/usr/bin/cling
|
#!/usr/bin/cling
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</p>
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>Rapid Application Development (RAD)
|
<li>Rapid Application Development (RAD)
|
||||||
@ -87,6 +87,7 @@
|
|||||||
<p>
|
<p>
|
||||||
For compilation and linkage the application needs the path to the clang and llvm libraries and the invocation is order dependent since the linker cannot do backward searches.
|
For compilation and linkage the application needs the path to the clang and llvm libraries and the invocation is order dependent since the linker cannot do backward searches.
|
||||||
|
|
||||||
|
</p>
|
||||||
<pre><code>
|
<pre><code>
|
||||||
g++ embedcling.cxx -std=c++11 -L/usr/local/lib
|
g++ embedcling.cxx -std=c++11 -L/usr/local/lib
|
||||||
-lclingInterpreter -lclingUtils
|
-lclingInterpreter -lclingUtils
|
||||||
@ -99,10 +100,9 @@ g++ embedcling.cxx -std=c++11 -L/usr/local/lib
|
|||||||
-lz -pthread -ldl -ltinfo
|
-lz -pthread -ldl -ltinfo
|
||||||
-o embedcling
|
-o embedcling
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</p>
|
|
||||||
<p>
|
<p>
|
||||||
Embedding cling requires the creation of the interpreter. Optionally compiler arguments and the resource directory of llvm can be passed. An example is the following:
|
Embedding cling requires the creation of the interpreter. Optionally compiler arguments and the resource directory of llvm can be passed. An example is the following:
|
||||||
|
</p>
|
||||||
<pre><code>
|
<pre><code>
|
||||||
#include "cling/Interpreter/Interpreter.h"
|
#include "cling/Interpreter/Interpreter.h"
|
||||||
|
|
||||||
@ -113,7 +113,6 @@ int main(int argc, char** argv) {
|
|||||||
interp.declare("int p=0;");
|
interp.declare("int p=0;");
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -129,7 +128,6 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<iframe seamless src="footer.html"></iframe>
|
<iframe seamless src="footer.html"></iframe>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user