Can anyone tell me a book, videos, website, or journals that show a complete guide to create a compiler using pascal. Im confuse when looking for the Semantic Analyzer, intermediate code, to optimizing code
"Let's Build a Compiler" by Jack Crenshaw
Related
There's plenty of docs for python developers, but as a C++ developer very new to BCC/BPF i'm finding it very difficult to determine where to start in building and deploying BCC-based C++ apps.
Where do i start? I've looked at the examples but they don't give any idea on how to package up a BCC C++ app for deployment on a wide range of Linux distributions.
How do i go about doing this? what issues/concerns are there?
I have been developing a BPF tool in C++ (https://github.com/toru/h2olog), but I think there are few documents about it. I've learned C++ binding from examples/cpp and BPF.h.
However, I recommend using Python 3 binding for BCC unless you have performance issues on the BPF tools you'll develop. This is because C++ binding is hard to lean (as you are asking), and hard to use metaprogramming (thus we're using code generation).
There are ~500k code snippets written in proprietary language that I have to port to a new system also using its own proprietary language. I have the following with me
Vocabulary and grammar of source and destination languages
Sample of 1500 converted rules (for training if required) of different complexity
I am not looking for 100% automation but may be a transpiler that may automate part of it. Can it be done using NLP? Have already gone through this, this, Rascal , Haxe and Spoofax. I could not find much documentation on how to create a custom tranpiler.
Any help is appreciated. Thank you!
So I am trying to make a small programming language as a project. But the thing is I have no clue how to begin. I know how a compiler works and all but don't know how the code would be written for it. I searched everywhere for example for the code of any compiler but couldn't find anything. Where would I find this, or could someone explain to me the format and method I should use for creating the compiler? Also if you were wondering I am thinking of using c++ for writing the compiler.
I recommend taking a free online course in Compiler Construction. Guided material and thoughtfully designed coursework is the best way to ease into this sort of thing, in my opinion.
LLVM.org; open source modern C, C++, Objective-C and more
I have a website teaching C for beginners.
I'm trying to have a C compiler online version so that a user could easily compile their code online itself.
Are there any compilers available? If available, which is the best one?
I have found some compilers, but they have got no capability of taking input from the user, but they have the capability of just displaying the output.
There is no package that can just be added to a blog so people can try C online and see the results.
You could provide a link to gcc or another compiler so your readers can try it themselves.
If you were really serious, a CGI script could be created on the server side which:
Runs in a sandbox (this is critical to get right and is potentially dangerous if done incorrectly)
Compiles the source code
Runs the compiled code
Returns the results
Sorry that I can't give you an easy answer, but there it is.
do you know where I can find Windows Low Level Assembly examples programs?
I have some exemples using macros (NASM, MASM) but I want pure assembly, in order I can build a shellcode later.
Thanks a lot guys!
This tutorial might be usefull for you: winamtut
Also this topic in MASM forum is great too.
If your architeture is x64 so try this link too.
And finally if you're interested in some theory, maybe this link could be nice.
Doing Windows GUI stuff in assembly language is a lot of work. This is why the examples you've found use macros - it takes away some of the pain.
If you really want pure assembly language, a great way is to ask your compiler. Write some C code to call CreateWindow or whatever, and then generate an assembly listing from the compiler (or step through it with a debugger).
If by "pure assembly" you mean "not done as a macro or library" then this is what you have to do:
download the masm32 package
check through the copius amount of samples, there will be many using CreateWindow or CreateWindowEx
start your own program
link in windows.h
use the invoke macro to call CreateWindow or CreateWindowEx
if you don't want to use invoke then just push the parameters onto the stack and call the functions directly - as this is what invoke does for you anyway
You can also get lots of help using the MASM package from the masm forum.
The best way to really (and quickly) learn win32 assembly is to decompile simple win32 programs. You could download lena's reversing tutorials from tutsforyou.com. Alternative you could tryout the reverse me's from osix.net - they have some pretty straight forward programs for you to reverse, and the best part is you get to see the masm32 sourcecode after completing the level.
tools: ollydbg, masm32 etc.
books: win32 assembler coding by Goppit, the arteam's PE compendium, intel developers handbook
hxxp://osix.net
hxxp://tuts4you.com/download.php?list.17
hxxp://www.intel.com/products/processor/manuals/
I'm not very pleased with your "in order I can build a shellcode later." - it's stuff like that which gives assembly a bad name.
I'd suggesty you take a look at FASM instead of MASM, though, since it's "closer to the metal", and directly supports binary output.
For learning to build shellcode I would suggest creating a very simple c program that does what you want the shellcode to do and than disassemble that using IDA or Immunity (or whatever debugger / dissasembler that you are familiar with). Than you can see what the instructions are that are being used.
I would also recommend the following books:
Hacking: The Art of Exploitation (2nd Edition)
The Shellcoder's Handbook