Language: C

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.File;
import java.io.PrintStream;

public class Main {

	public static void main(String[] args) throws IOException {
		/**
		  try {
			System.setOut(new PrintStream(new File("result_b2.txt")));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		*/
		
		InputStreamReader reader = new InputStreamReader(System.in);
		int key,i,a[],flag;
		a=new int[100];
		key='.';
		key=reader.read();
		while(true){  //while outside
			//System.out.print((char)key+"-");
			//System.out.print("***");
			i=0;
			a[i]=0;
			
			if(key=='.')
				break;
			while(true){	//while inside
				if(key=='['||key=='('){
					i++;
					a[i]=key;
				}
				else if(key==']'){
					if(a[i]!='['){
						while(key!='.'){
							key=reader.read();
						}
						System.out.println("no");
						break;
					}
					i--;
				}
				else if(key==')'){
					if(a[i]!='('){
						while(key!='.'){
							key=reader.read();
						}
						System.out.println("no");
						break;
					}
					i--;
				}	

				key=reader.read();
				if(key=='.'){
					if(i==0){
						System.out.println("yes");
						break;
					}
					else{
						System.out.println("no");
						break;
					}
				}
			} //while(true) inside
			
			while(key!='\n'){
				key=reader.read();
			}
			//System.out.print((char)key);
			//if(key=='\n'){
			key=reader.read();
			//}
			//key=reader.read();
			
		} //while outside
	} //main
} //class

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.io.FileNotFoundException;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.io.FileNotFoundException;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.io.IOException;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.io.IOException;
      |            ^
main.c:3:1: error: unknown type name 'import'
    3 | import java.io.InputStream;
      | ^~~~~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | import java.io.InputStream;
      |            ^
main.c:4:1: error: unknown type name 'import'
    4 | import java.io.InputStreamReader;
      | ^~~~~~
main.c:4:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    4 | import java.io.InputStreamReader;
      |            ^
main.c:5:1: error: unknown type name 'import'
    5 | import java.io.File;
      | ^~~~~~
main.c:5:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    5 | import java.io.File;
      |            ^
main.c:6:1: error: unknown type name 'import'
    6 | import java.io.PrintStream;
      | ^~~~~~
main.c:6:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    6 | import java.io.PrintStream;
      |            ^
main.c:8:1: error: unknown type name 'public'
    8 | public class Main {
      | ^~~~~~
main.c:8:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    8 | public class Main {
      |              ^~~~