Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Java assignment processor

trejozach
trejozach 


Write a Java program that simulates the actions of a preprocessor to will detected if certain Java constructs are syntactically correct Attachments Tags Clarifications

Answers

Java Assignment processor

sudheer488
sudheer488 



I have attached the code along with output screenshots . Attachments
myprepocessor.rar (1 K) Download
Preview
p.stackexample(str); } }catch(Exception e){ // if any error occurs e.printStackTrace(); }finally{ // closes the stream and releases system resources if(fr!=null) fr.close(); if(lnr!=null) lnr.close(); } String error= p.showError(); System.out.println("output : \t"+error);

Preview
i++) { char s1=s.charAt(i); if(s1=='{') { showpush(st, s1); leftf=leftf+1; } else if(s1=='}') { showpush(st,s1); rightf=rightf+1; } else if(s1=='(') { showpush(st,s1); rbrack=rbrack+1; } else if(s1==')') { showpush(st,s1); lbrack=lbrack+1; } else if(s1=='[') { showpush(st,s1); cbrackl=cbrackl+1; } else if(s1==']') { showpush(st,s1);

Preview
void display(int n) { int arr[ ] =

output.doc (590 K) Download
output1.PNG (72 K) Download Preview

output2.PNG (65 K) Download Preview

ouput3.PNG (22 K) Download Preview

Screenshots
Screenshot
Screenshot
Screenshot
Purchase Answer

Java preprocessor

felo
felo 



Please find attached files plus an example of a java program that its constructs have been analysed by this preprocessor Attachments
JavaPreprocessor.rar (8 K) Download







Preview
If there is delay in creation of object then the threads might create multiple instances Thread.sleep(8); INSTANCE = new Singleton(); } catch (InterruptedException ie) { ie.printStackTrace(); } return INSTANCE;

Preview
public class

Preview
== '+') {token = PLUS; nextChar();} else if (c == '-') {token = MINUS; nextChar();} else if (c == ';') {token = SEMICOLON; nextChar();} else if (c == ':') { //check that next char is '=' to find assignment token ":=" nextChar(); if (c ==

Preview
java.io.*; import java.util.*; public class Preprocessor { private static SyntaticAnalyzer syn; private static String

Preview
java.io.*; import java.util.*; public class SyntaticAnalyzer { private Lexer lex; private Hashtable symbolTable; public SyntaticAnalyzer(String inputFile) { lex = new Lexer(inputFile); symbolTable = new Hashtable(); symbolTable.put("zero", new Integer(0) ); symbolTable.put("one", new Integer(1) ); symbolTable.put("ten", new Integer(10) ); }

preprocessor.png (104 K) Download Preview

Screenshots
Screenshot
Purchase Answer