Ask Question
3 May, 11:23

3) Write code in a language of your choice that checks a source file (input file in plain text format) that separates lexemes by white space and special characters. This lexical analyzer will only have tokens for special characters and alphanumeric strings. Ie: 2345 6tgbsauhd9sa67*I{OPKDSl; jaklhl Would be 2345 6tgbsauhd9sa67 * I { OPKDSl; jaklhl

+2
Answers (1)
  1. 3 May, 11:45
    0
    CODE:

    import java. io.*;

    class Test

    {

    public static void main (String[] args) {

    File file = new File ("input. txt");

    try{

    BufferedReader b = new BufferedReader (new FileReader (file));

    String line;

    while ((line = b. readLine ()) ! = null)

    {

    for (int i=0; i
    (c>='a' && c<='z')

    }

    }

    catch (Exception e)

    {

    System. out. println (e);

    }

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “3) Write code in a language of your choice that checks a source file (input file in plain text format) that separates lexemes by white ...” in 📗 Business if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers