Skip to content

An application identify a language composed by braces, brackets and parentheses

Notifications You must be signed in to change notification settings

barreto/brackets-language-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brackets Language Validator

This is a project to analyze and solve if any word within the given alphabet are valid or not, according to their structure. The main goal is to create a compiler capable of receiving some filename and generating another with the necessary analysis.

Given alphabet:

Char 1: {
Char 2: [
Char 3: ( 
Char 4: )
Char 5: ]
Char 6: }

Yes, the alphabet is composed by braces, brackets and parentheses.

Validation Required

For each symbol you open, you must close, respecting the hierarchy of symbols that open and close within and around itself.

The mission

Part I

Read a text file and mark each line with "OK" or "Inválido":

Input example:

{[]}
([)]
[{()()}[]]
{}()[()]]
)[{}]()(
(()[)]

Output example:

{[]} - OK

([)] - Inválido

[{()()}[]] - OK

{}()[()]] - Inválido

)[{}]()( - Inválido

(()[)] - Inválido

Part II

Create a java program that receives a text file with code via the command line, something like this:

$ java prog.txt  

Output: prog-check.txt

About

An application identify a language composed by braces, brackets and parentheses

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages