Exforsys

Online Training

Struck with this Task

This is a discussion on Struck with this Task within the C and C++ forums, part of the Programming Talk category; I have working knowledge in C and now I have read some concepts of compiler design and I am trying ...


Go Back   Exforsys > Programming Talk > C and C++

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-26-2007, 10:52 PM
Senior Member
 
Join Date: Apr 2006
Posts: 145
Rahulbatra is on a distinguished road
Struck with this Task

I have working knowledge in C and now I have read some concepts of compiler design and I am trying to implement the basics of these in my C program. I am struck with the task of breaking the given string into token for further analyzing them in parser. Can anyone suggest me a method for accomplishing this task?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-28-2007, 03:12 AM
Senior Member
 
Join Date: Apr 2006
Posts: 153
cyrus is on a distinguished road
Suppose you want to break the string every 2 bits and make it as tokens you can use the below code to do the same.

char a[20];
int l;
while((l = fread(a,2,f)) > 0)
display(buf,l);

By using the above code you can break the given string into token for further analyzing them in parser.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Struck Abstract with Abstract Class priyaraji C and C++ 2 05-01-2007 10:04 AM
Task Oriented Programming Thusitha Software Patterns 4 01-09-2005 12:13 PM
Comp.Sys.Acorn.FAQ part 1 of 4 Paul Vigay Tech FAQ 0 05-31-2004 09:00 PM
Comp.Sys.Acorn.FAQ part 1 of 4 Paul Vigay Tech FAQ 0 04-30-2004 09:00 PM


All times are GMT -4. The time now is 12:17 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.