Hello every one..
I am planning to make a lexcial analyzer in C++, the keywords, opertators etc for the language that the lexer would take lexmes from are all given to us as a set of requirements.
I wanted to know how do i go about making this..
Thanks
Ap
6 4414
Hello every one..
I am planning to make a lexcial analyzer in C++, the keywords, opertators etc for the language that the lexer would take lexmes from are all given to us as a set of requirements.
I wanted to know how do i go about making this..
Thanks
Ap
Have you started thinking this through yet? What type of things do you need? What would the basic layout for a program be?
JosAH 11,448
Recognized Expert MVP
Hello every one..
I am planning to make a lexcial analyzer in C++, the keywords, opertators etc for the language that the lexer would take lexmes from are all given to us as a set of requirements.
I wanted to know how do i go about making this..
Thanks
Ap
The magic word is 'regular expressions'; well, ok, that makes two magic words.
kind regards,
Jos
Start with a Bachus-Nauer diagram.
TRScheel 638
Recognized Expert Contributor
Start with a Bachus-Nauer diagram.
You made me look that up... started with Brachus-Nauer. Got nothing useful. Then went Brachus-Nauer diagram. Found almost nothing. Then tried Brachus Nauer diagram. A little better, though I got hints at Brachus Nauer form. Looked that up, and found this: Brachus Nauer Form
And I hope that is what you mean.
Yep. That's where you start.
All of your lexical rules and tokens will be in the form. Then you design your software
JosAH 11,448
Recognized Expert MVP
Yep. That's where you start.
All of your lexical rules and tokens will be in the form. Then you design your software
Backus-Naur (not "Nauer") form for general grammars would be overkill for simple
linear grammars. Those linear grammars are all that is needed for lexers and
they can be easily expressed by regular expressions.
Backus-Naur form notation for context free grammars comes in handy for the
parser part of compilers etc. (ref: Yacc, Bison, ANTLR etc.).
kind regards,
Jos
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Simon Foster |
last post by:
Anyone have any experience or pointers to how to go about creating
a parser lexer for assemble in Python. I was thinking of using PLY
but wonder whether it's too heavyweight for what I want. Anyone have
any thoughts?
--
Simon Foster
Somewhere in the West of England
|
by: Thorsten Claus |
last post by:
Hi,
what's the environment variable for in the scite configuration file for the
currently used lexer/syntax highlight? I want to have the current markup in
the statusbar...
Thorsten
|
by: noridotjabi |
last post by:
Is there any way in C to write source which would make an executable
that excepted modifications. For instance say we have modable program
that excepts plugins. That starts with a menu.
1)Add 2)Subtract 0)Add Mod
::
When entering zero:
Mod Source
::(whatever.c or maybe .o would be better)
Say the mod we put in was to add a divide option to the main menu.
|
by: Mike C# |
last post by:
Hi all,
Can anyone recommend a good and *easy to use* lexer and parser generator?
Preferably one that was written specifically for VC++ and not mangled
through 20 different platforms. I've had it up to here (funny hand gesture)
with trying to compile the bullet-riddled code that GNU Flex and Bison keep
spitting out for even the simplest of grammars (really funny hand gesture).
Thanks
|
by: Neil Cerutti |
last post by:
I'm a royal n00b to writing translators, but you have to start
someplace.
In my Python project, I've decided that writing the dispatch code
to sit between the Glulx virtual machine and the Glk API will be
best done automatically, using the handy prototypes.
Below is the prototype of the lexer, and I'd like some comments
in case I'm doing something silly already.
| |
by: Java1963 |
last post by:
Need help with writting an application that prompt for and read a double value representing a monetary amount.
--------------------------------------------------------------------------------
Hello all, I am new to this Java stuff and, I need help in writting an application will prompt for and read a double value representing a monetary amount.Then determine the fewest numbers of each bill and coin needed to represent that amount,...
|
by: rahulbsbs |
last post by:
Sir how can i get the ip address of the remote system by writting a java code,ie i want to get ip address of the remote system that is connected to my server computer ,the ip address must be obtained by writting a java program.Is there any class for that.Please give me an example for getting this.
|
by: Thomas Mlynarczyk |
last post by:
Hello,
I started to write a lexer in Python -- my first attempt to do something
useful with Python (rather than trying out snippets from tutorials). It
is not complete yet, but I would like some feedback -- I'm a Python
newbie and it seems that, with Python, there is always a simpler and
better way to do it than you think.
### Begin ###
|
by: latif87 |
last post by:
An example of how the XML file is structured:
<xml>
<farm name="NAME1">
<size x="INTEGER1" y="INTEGER2" />
<neighbor name="NAME2" />
<crop name="PLANT" area="INTEGER3" />
<crop … />
…
</farm>
<farm name="NAME2" …>
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |