flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > Trying to make a higgh level language Goto page 1, 2 Next |
Author |
|
Kain 25 Aug 2006, 02:14
You might get better answers on a flex/bison related forum. You could also take a look at the HLA sources. HLA is a high-level Assembler that can generate FASM code and is built around C/Flex/Bison.
Better yet, forget about Flex/Bison and do the whole thing in FASM! If I remember correctly, someone wrote a tiny-c compiler in FASM which may come in handy. |
|||
25 Aug 2006, 02:14 |
|
bubach 26 Aug 2006, 13:47
Do you remeber where that tiny C compiler is? I would like to take a look at it.
|
|||
26 Aug 2006, 13:47 |
|
okasvi 26 Aug 2006, 14:10
I believe that tiny-'C' compiler in fasm is Context 2.0:
http://www.avhohlov.narod.ru/p9810en.htm |
|||
26 Aug 2006, 14:10 |
|
Kain 27 Aug 2006, 06:13
Here you can find a small-c compiler for Menuet
http://www.menuetos.org/stuff32.htm There is also an LCC port to Menuet http://meos.sysbin.com/viewtopic.php?t=535 |
|||
27 Aug 2006, 06:13 |
|
Jack 27 Aug 2006, 23:15
have a look BDS C http://www.bdsoft.com/resources/bdsc.html
Quote:
|
|||
27 Aug 2006, 23:15 |
|
Thaorius 28 Aug 2006, 02:52
I'm going to do it in C/C++ because i want it to run on linux platform as well.
Basically i want an hybrid between c++/c#/java/php/lua. I will look at the c compiler any way. As far as i now: -Lexer -Parser -Code Generation? do i need to do this if i just want to output fasm assembler? there is some program that generate the code generator like flex por lexer's and bison por parser's? Thanks |
|||
28 Aug 2006, 02:52 |
|
zubi 30 Aug 2006, 17:37
Hi,
I have passed through a similar process. I made a compiler that generates asm code to be compiled with fasm. I strongly recommend you to check out GOLD Parsing system, A Free, Multi-Programming Language, Parser at http://www.devincook.com/goldparser/. There are bunch of engines written for that program in different languages, that tokenize your input according to your grammar. I wrote a rudimentary assembly engine for GOLD which you can find at the downloads section of that site. Unfortunately it is written for MASM and it is buggy but if you decide to use that engine I can send you a bugfree version in obj format. Besides that, the source code is included so you can translate it to FASM, or modify to suit your needs. You can create your grammar files in windows only, but because the engines are separate from the grammar file generator it can run on other OSes providing that you use a suitable engine for each OS. regards |
|||
30 Aug 2006, 17:37 |
|
Thaorius 31 Aug 2006, 00:25
It look's nice, but i want to do it my self, not using third party programs or anything.
Did you have any related information? |
|||
31 Aug 2006, 00:25 |
|
zubi 31 Aug 2006, 09:09
Oh, I thought you were going to use flex/bison, so my suggestion was only an alternative to them. If you're going to write the parser/lexer yourself too and not going to use a 3rd party stuff to handle that, I wish you plenty of spare time and patience then
Related information upon compiler writing? Perhaps.. just tell me what areas of the whole process you are particularly interested in. I don't have much to say on writing a parser/lexer stuff as I never did that myself but I can provide some information about the other aspects such as building a parse tree, memory management and garbage collection, handling object oriented stuff and code generation... |
|||
31 Aug 2006, 09:09 |
|
ronware 31 Aug 2006, 14:43
Have you looked at Reva forth? It's written in FASM (and Reva). You can do something similar, or just write your language in Reva...
|
|||
31 Aug 2006, 14:43 |
|
Thaorius 31 Aug 2006, 15:34
zubi wrote: Oh, I thought you were going to use flex/bison, so my suggestion was only an alternative to them. If you're going to write the parser/lexer yourself too and not going to use a 3rd party stuff to handle that, I wish you plenty of spare time and patience then I need information about the whole process, about the lexer and parsers yes, it could be, i prefer to write my own parser/lexer but anyway i'm going to use flex and bison in a beggining. about goldparser, is gpl? if that the case i will look at the sources. And about Reva, i'm looking it right now. Thanks |
|||
31 Aug 2006, 15:34 |
|
Thaorius 31 Aug 2006, 16:46
Hey, here is a draft of my language:
Code: gimp API.IO; gimp API.Crypto; API.Runtime.State PilotMain( API.Runtime.Args ); { Printf("First draft\n"); return(API.Runtime.State.OK) } API - Main api group Runtime - Runtime group State - Return State class OK - Static variable on State class gimp - Group import(group = namespace) does anyone have suggestions or something? Thanks |
|||
31 Aug 2006, 16:46 |
|
rugxulo 01 Sep 2006, 03:28
Suggestions?
P.S. Read (or skim) the Crenshaw tutorial. P.P.S. Check out Draak (multi-language macro compiler). |
|||
01 Sep 2006, 03:28 |
|
zubi 01 Sep 2006, 11:11
the source for Goldparser is not avaialable but that is irrelevant because what it does is to create binary grammar file for you. There are many engines that actually parses your code according to the grammar and almost all of them has source code with it.
I also suggest not to start from scratch because I assure you that it is not going to be the world's simplest project. Crenshaw tutorial was the first thing that I read, it is really helpful. Another suggestion I may give is that never do cowboy coding until you completely know what features you will need. It is a general suggestion anyway, but it becomes incredibly important while you design the language. When you realize that some features or syntax is not coherent with the other parts, it becomes too late or require too much extra effort to change them, plus you waste significant amount of time and energy. I might also suggest you, for your spare time entertainment, to read information about garbage collection schemes, optimization in generated code, vtables and other stuff that you'll be using. |
|||
01 Sep 2006, 11:11 |
|
Thaorius 01 Sep 2006, 13:09
I'm basing it on C,C++,Java,C#,PalmOS develpment classess; anyway, of course I'm going to design the language before doing it.
Other thing, i wan't that the output executables can run without any virtual machine or runtime environment. So, i have to found the way to. Target systems? GNU/Linux, Micro$oft Windows To make the program run in the different oses, i want the main API package, so with minor modiffication, like paths, and executable format it will work on linux. I also get a copy of the Dragon book, it looks pretty interesting. Garbage collection, require a run time? About code generation and linking, for example, i can generate mscoff files and then link them, but how do i link them? and how the linker knows where is my PilotMain and how to start it. I think is beder a language that just have a single main file and includes everything from the include files like fasm programs, but for a modern language this is not a choice. Or not? and on linux platform what intermediate object format can i make with fasm? Oh, a last questions, the API should have, I/O,Sound,GUI,XML, what else? P/D: Looking at the links right now Thanks |
|||
01 Sep 2006, 13:09 |
|
Maverick 01 Sep 2006, 16:02
Why do you need Garbage Collection?
|
|||
01 Sep 2006, 16:02 |
|
Thaorius 01 Sep 2006, 16:09
I don't know :S, i don't think i really need it, because the user can delete by himself what hi doesn't use anymore. What is it functions exactly?
I Started reading the Dragon's Book, now is much more than pretty intresting |
|||
01 Sep 2006, 16:09 |
|
Maverick 01 Sep 2006, 16:46
The function and purpose of GC is to make the system less efficient and to make the programmer less experienced, less aware and more easily distractible. At such, GC is an invaluable tool, expecially when used together with Microsoft languages such as VisualBasic and C#.
|
|||
01 Sep 2006, 16:46 |
|
strcpy() 02 Sep 2006, 12:41
Hi!
hehhee i send you the compiler: principles techniques and tools some questions: Are you coding in C ? or are u using some kind of clon of Flex/Bison ? sourcer ? why do u choose to make a translator from your language to ASM ? im coding a compiler too, but in C# bye! |
|||
02 Sep 2006, 12:41 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.