473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

scaner program!......plz

hi!...i have a project in university about programing...can anyone send me a program of Scaner that recognize identifire and ...?...this program should be simple.....thx alot :x
Apr 6 '07 #1
6 1866
Ganon11
3,652 Expert 2GB
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

Please read the Posting Guidelines and particularly the Coursework Posting Guidlines.

Then when you are ready post a new question in this thread.

MODERATOR

A Scanner is something used in Java...are you in the wrong forum?
Apr 6 '07 #2
thx for your attention
i'll try...and i'll do it!...and i'll take it here in future
and i ask my question if i found a problem
thx
Apr 7 '07 #3
Actually, what is your problem. I couldn't understand the program specification and function.


Have you finished the program. If not, we can discuss together.

Thanks for your explanation.
Apr 11 '07 #4
What is a scanner?
The first step each PUMA application does is analysing the structure of the C/C++ source code. This analysis is divided into a lexical and a syntactical analysis. Well, the task of a scanner2.1 is to do the lexical analysis of the code. But what means lexical analysis in detail? The scanner reads the source code character by character and implements the following tasks:


recognizing of basic symbols (tokens) like C++ and preprocessor keywords,
encoding the tokens (map to integer) and
associating a token to a class of tokens - the language it belongs to (e.g. preprocessor and C++).
By the way the location the token occured in the source code will be stored. The result of the scan process is a logical unit of the tokens belonging to the input source of the scanner

...but I dont write in yet!...thx
Apr 15 '07 #5
OP, you're asking quite a difficult question... you must be in an automata course or maybe a compiler course...

Maybe you've covered something like this in the class?
http://en.wikipedia.org/wiki/Left_recursion
Apr 15 '07 #6
I study computer :)

#include <iostream.h>
#include <conio.h>

main()
{{

int state=0,i;
char array[80],ch;
cin >>array[i];

l3:
for(int i=0;array[i]!='\0';i++){
switch(state){
case 0:
ch=array[i];
if(ch=='0' || ch=='1'|| ch=='2' || ch=='3' || ch=='4' || ch=='5' || ch=='6' || ch=='7' || ch=='8' || ch=='9')
state=3;

else if(ch=='a' || ch=='b'|| ch=='c' || ch=='d' || ch=='e' || ch=='f' || ch=='g' || ch=='h' || ch=='i' || ch=='j'|| ch=='k'|| ch=='l' || ch=='m' || ch=='n' || ch=='p' || ch=='q' || ch=='r' || ch=='s' || ch=='t'|| ch=='u'|| ch=='v' || ch=='w' || ch=='x' || ch=='y' || ch=='z' )
state=1;

else if(ch=='+')
state=12;

else if(ch=='-')
state=13;

else if(ch=='<')
state=14;

else if(ch=='!')
state=17;

else if(ch=='/')
state=20;

else if(ch==';')
state=25;

else if(ch=='*')
state=28;

else if(ch=='"')
state=29;

else if(ch=='>')
state=30;

else if(ch=='=')
state=33;


else if(ch==' ')
state=39;

else cout<<"!";

goto l3;
break;




----its frist state! :)...i think
Apr 17 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: edgrsprj | last post by:
PROPOSED EARTHQUAKE FORECASTING COMPUTER PROGRAM DEVELOPMENT EFFORT Posted July 11, 2005 My main earthquake forecasting Web page is: http://www.freewebz.com/eq-forecasting/Data.html ...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
11
by: christopher diggins | last post by:
I am wondering if any can point me to any open-source library with program objects for C++ like there is in Java? I would like to be able to write things like MyProgram1 >> MyProgram2 >>...
1
by: Eric Whittaker | last post by:
hi all, im trying to write my first c++ program. a success, but i can't get the window to stay open after user enters input. it just automatically closes. right now the end of my program looks...
9
by: Hemal | last post by:
Hi All, I need to know the memory required by a c program. Is there any tool/utility which can give me the memory usage in terms of DATA segment, TEXT segment, BSS segment etc. I am working...
7
by: ibtc209 | last post by:
I just started programming in C, and I need some help with this problem. Your program will read the information about one MiniPoker hand, namely the rank and suit of the hand’s first card, and...
2
Banfa
by: Banfa | last post by:
Posted by Banfa The previous tutorial discussed what programming is, what we are trying to achieve, the answer being a list of instructions constituting a valid program. Now we will discuss how...
0
amitpatel66
by: amitpatel66 | last post by:
There is always a requirement that in Oracle Applications, the Concurrent Program need to be execute programatically based on certain conditions/validations: Concurrent programs can be executed...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
jinu1996
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...
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.