[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
I NEEDS EXPERTIES FROM JAVA EXPERT...  XML
Forum Index » Java Programming
Author Message
h77!

Newbie

Joined: 03/25/2006 10:50:09
Messages: 1
Offline


Hi, Guys..
how are you?. I'm bigenners in java lang so i'm registering here to become java expert like u. i want to{ build scanner based on RE .Show your DFA's code and run}.I have the algorithm which may be help us in this program .

/********************************************************/
stete = initial_state;
current_character = get_next_character ();
while ( true )
{ next_state = T[state,current_character];
if (next_state = T[state,current_character];
if(next_state == ERROR)
break;
state = next_state;
current_character = get_next_character();
if (is_final_state(state) )
'we have a valid token'
else 'report an error'

// this algorithm does not take into account the longest match disambiguation rule since it ends at EOF

/********************************************************/

//The following algorithm is more general since it does not expect EOF at
the end of token but still uses longest match disambiguation rule.

stete = initial_state;
final_state = ERROR;
current_character = get_next_character ();
while ( true )
{ next_state = T[state,current_character];
if (next_state = T[state,current_character];
if(next_state == ERROR)
break;
state = next_state;
if ( is_final_state(state(state) )
final_state = state;
if( current_character == EOF )
break;
};

if (final_state == ERROR )
'report an error'
else if ( state != final_state )
'we have a valid token but we need to backtrack
(to put characters back into the stream) '
else 'we have a valid token'
/********************************************************/

I needs your activaty in my request ....please
Thanks so much
 
Forum Index » Java Programming
Go to:   
Powered by JForum 2.1.9 © JForum Team
This site run by Scott Dunbar of Xigole Systems. © 2005-2011 - Scott Dunbar
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners
hotjoe.com, xigole.com, and Scott Dunbar have no affiliation with Oracle