Go to Post There are no simple solutions, as every solution has its own problems. - M. Lillis [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 18-07-2002, 09:24
Unsung FIRST Hero
Matt Leese Matt Leese is offline
Been-In-FIRST-Too-Long
FRC #1438 (The Aztechs)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1998
Location: Long Beach, CA
Posts: 937
Matt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond repute
Send a message via AIM to Matt Leese
The main reason I wrote the program in C as opposed to C++ is the fact that the tools I used (Bison and Flex) output C code. They also happen to be fairly standard tools on Unix (going by the names Yacc and Lex). Flex is a tokenizer. It allows you to specify regular-expressions and the Flex command will take your input file (in emulationFIRST the file is pbasic.l) and create a tokenizer that you can call. Bison is a program that allows you to specify certain patterns of tokens and takes your input file (in emulationFIRST the file is pbasic.y) and outputs a C file. This C file is based around a state machine. Overall, the combination of Bison and Flex works wonders as it made a lot of the actually parsing much much easier.

The other reason that C was used over C++ is that I tend to prefer C a bit. For what was needed, C++ seemed like it would be overkill.

As far as a GUI goes, I've already written the program to separate the input from the actual processing. You can look at the file console.c (it runs the UI right now) and you can see that the parser never calls any function in console.c (except by using call-backs/function pointers). I'm planning to base my GUI on GTK 2.0 which was originally native for Linux but also has a Windows port (and may have a Mac port, I'm not sure). GTK is written in C so it makes it easier to interface with other C code.

If you have any questions or whatnot, please feel free to contact me.

Matt
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
emulationFIRST v0.04 Matt Leese Programming 7 09-07-2002 08:54
emulationFIRST v0.03 Matt Leese Programming 7 03-07-2002 13:00
emulationFIRST v0.02 Matt Leese Programming 3 02-07-2002 16:37
emulationFIRST (aka PBasic emulator) Matt Leese Programming 5 30-06-2002 12:06


All times are GMT -5. The time now is 07:59.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi