import java.io.*; import java.io.BufferedReader; public class lexAnalyser { static String state; public static void main( String[] args ) throws IOException{ boolean match=true;//boolean for checking if the string in matched BufferedReader stdin = new BufferedReader( new InputStreamReader(System.in)); while(true){ System.out.println("Enter a word to match or press ENTER to exit"); String word= stdin.readLine(); if(word.length()>0) analyze(word); else break; //terminate the program } } static String a; static String b; public static void analyze(String word){ String temp= word.trim();// remove empty spaces at the end of the string int i = 0; boolean matcher = false; for(i=0;i