Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How can I resolve the lex(String) is undefined for the type main? public class main { public static void main(String[] args) { //creating file object

How can I resolve the lex(String) is undefined for the type main?

public class main {

public static void main(String[] args) { //creating file object File file = new File("input.txt"); //scanner object to scan the input file Scanner sc = null; String input = ""; try { sc = new Scanner(file); //traversing the entire input file untile all the lines found while (sc.hasNextLine()) { input += sc.nextLine()+" "; } } catch (FileNotFoundException e) { System.out.println("File Not Found. Please Check Input File"); } // Create tokens and print them ArrayList tokens = lex(input); for (Token token : tokens) System.out.println(token); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

Question Can a self-employed person adopt a profit sharing plan?

Answered: 1 week ago