Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-03-2008, 09:59 PM
Member
 
Join Date: Mar 2008
Posts: 1
chen8735 is on a distinguished road
anyone can give idea 2 my assignment?
Create a GUI program to trace out any braces and keep track of the line having wrong closure of any

braces dynamically and identify the previous line typed if error prone note some red symbol in the

marigin. The marigin however must dynamically increase the line count of the coding.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-05-2008, 06:07 AM
Member
 
Join Date: Mar 2008
Posts: 1
Tocs1001 is on a distinguished road
By braces do you mean [ { ( ???
Your "assignment" is so vague...
Do braces close between lines such as...

Code:
{Blah blah blah}
or just on each line..?

If anything is remotley similar your going to want to use a stack...

Everytime you find an open brace put it on the stack
if you find a closing brace. Make sure it matches the brace type, [ { (, if it does pop the top of the stack off. By doing this if you encounter a brace that does not match or reach the end of the file / line depending on the problem you know you have an error!

Example

given "[Lol is some text[fun]]"

Stack goes adds a [ stack is now "["
It skips over non-brace characters it finds another [ adds it to the stack. stack is now "[[" It continues skipping over more non brace characters. It finds a ] so it compares it to the top of the stack "[" they are the same type so it pops it off. Stack is now "[" it finds another ] it matches the top of the stack. So it pops it off. Stack is now " ". End of file...Text is fine!

given "[LOL some text..again [heh]"

Stack finds a [ adds it. Stack is now "[". Continues skipping non-brace characters. It finds another [. Adds it to the stack. Stack is now "[[" it continues skipping non-braces. it finds a ]. It matches the type of the top of the stack. Top of stack is removed. Stack is now "[". End of file/line. The stack is left with "[" there is an error.

Hope this helps....
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 03-08-2008, 08:03 PM
CaptainMorgan's Avatar
Moderator
 
Join Date: Dec 2007
Location: NewEngland, US
Posts: 841
CaptainMorgan will become famous soon enoughCaptainMorgan will become famous soon enough
Send a message via AIM to CaptainMorgan
Chen, please provide us your attempt at your own code- make a valid effort and many of us would be happy to assist. I know you said "ideas" but if you simply get started on your code, you will be surprised sometimes how ideas come to you- then if you run into problems let us know.

To both of your, welcome to the Java Forums!
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
to our beloved Java Forums!
(closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
!
Got a little Capt'n in you? (drink responsibly)
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Got an Idea, Just Share it! james Java Announcements 0 03-18-2008 02:09 PM
Need a idea on GridBagLayout ddsuresh AWT / Swing 1 01-29-2008 03:32 AM
Is there anyone can give a instruction about Myoodb ibmzz Database 0 01-19-2008 11:04 AM
i couid not get the idea: sivasayanth New To Java 2 01-18-2008 07:52 PM
give me a advise sireesha New To Java 3 12-11-2007 03:38 AM


All times are GMT +3. The time now is 10:19 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org