Skip to content

Commit

Permalink
Merge pull request #23 from bryan967132/develop
Browse files Browse the repository at this point in the history
Version 1, Prefix
  • Loading branch information
bryan967132 authored Jun 6, 2023
2 parents 2a08909 + 3072e33 commit d5d541b
Show file tree
Hide file tree
Showing 29 changed files with 391 additions and 351 deletions.
11 changes: 5 additions & 6 deletions GramaticaLibreDeContexto.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ SPECIFIC ->
TK_char

OPERATION ->
OPERATION '.' OPERATION |
OPERATION '|' OPERATION |
OPERATION '*' |
OPERATION '+' |
OPERATION '?' |
'(' OPERATION ')' |
'.' OPERATION OPERATION |
'|' OPERATION OPERATION |
'*' OPERATION |
'+' OPERATION |
'?' OPERATION |
OPERAND

OPERAND ->
Expand Down
Binary file modified Images/ManualUsuario/Abierto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/ManualUsuario/Abrir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/ManualUsuario/Analizar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/ManualUsuario/GuardadoComo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/ManualUsuario/Guardar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/ManualUsuario/GuardarComo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/ManualUsuario/GuardarComoNombrar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/ManualUsuario/Nuevo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/ManualUsuario/NuevoCreado.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/ManualUsuario/NuevoNombrar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/ManualUsuario/Validar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 17 additions & 19 deletions ManualTecnico.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
4. [Cálculo De Siguientes](#4-cálculo-de-siguientes)
5. [Cálculo De Transiciones](#5-cálculo-de-transiciones)
6. [Método De Thompson](#6-método-de-thompson)
7. [Diagrama De Clases](#7-diagrama-de-clases)
7. [Método De Thompson](#7-diagrama-de-clases)

## 1. Análisis Léxico
* ### Tabla de Tokens
Expand Down Expand Up @@ -44,13 +44,13 @@

## 2. Análisis Sintáctico
* ### Expresion Regular en Notación Polaca
Los operadores se escriben entre los operandos para operadores binarios y al final para operadores unarios.
Los operadores se escriben antes que los operandos.
<br>Ejemplo:<br>
* operando | operando
* operando . operando
* operando \+
* operando \*
* operando ?
* | operando operando
* . operando operando
* \+ operando
* \* operando
* ? operando

* ### Gramática Libre del Contexto
```java
Expand Down Expand Up @@ -82,12 +82,11 @@ SPECIFIC ->
TK_char

OPERATION ->
OPERATION '.' OPERATION |
OPERATION '|' OPERATION |
OPERATION '*' |
OPERATION '+' |
OPERATION '?' |
'(' OPERATION ')' |
'.' OPERATION OPERATION |
'|' OPERATION OPERATION |
'*' OPERATION |
'+' OPERATION |
'?' OPERATION |
OPERAND

OPERAND ->
Expand Down Expand Up @@ -163,12 +162,11 @@ EVALUATION -> TK_id ':' TK_str ';'
IDS:regex TK_prompt OPERATION:op TK_semicolon {:addTree(regex,op);:} ;

OPERATION ::=
OPERATION:op1 TK_or OPERATION:op2 {:RESULT = buildTree("|",op1,op2,op1.anulable || op2.anulable,Type.OR); :} |
OPERATION:op1 TK_concat OPERATION:op2 {:RESULT = buildTree(".",op1,op2,op1.anulable && op2.anulable,Type.CONCAT);:} |
OPERATION:op1 TK_kleene {:RESULT = buildTree("*",op1,null,true,Type.KLEENE); :} |
OPERATION:op1 TK_positive {:RESULT = buildTree("+",op1,null,op1.anulable,Type.POSITIVE); :} |
OPERATION:op1 TK_optional {:RESULT = buildTree("?",op1,null,true,Type.OPTIONAL); :} |
TK_lpar OPERATION:op TK_rpar {:RESULT = op; :} |
TK_or OPERATION:op1 OPERATION:op2 {:RESULT = buildTree("|",op1,op2,op1.anulable || op2.anulable,Type.OR); :} |
TK_concat OPERATION:op1 OPERATION:op2 {:RESULT = buildTree(".",op1,op2,op1.anulable && op2.anulable,Type.CONCAT);:} |
TK_kleene OPERATION:op1 {:RESULT = buildTree("*",op1,null,true,Type.KLEENE); :} |
TK_positive OPERATION:op1 {:RESULT = buildTree("+",op1,null,op1.anulable,Type.POSITIVE); :} |
TK_optional OPERATION:op1 {:RESULT = buildTree("?",op1,null,true,Type.OPTIONAL); :} |
OPERAND:op {:RESULT = op; :} ;

OPERAND ::=
Expand Down
26 changes: 13 additions & 13 deletions ManualUsuario.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@ El reporte se genera y abre automáticamente al momento del análisis si se dete
[Subir](#exregan)

## 5. Expresión Regular
* ### Expresion Regular en Notación Infija
* ### Expresion Regular en Notación Polaca
Los operadores se escriben antes que los operandos.
<br>Ejemplo:<br>
* operando | operando
* operando . operando
* operando \+
* operando \*
* operando ?
* ### Ejemplos de Expresiones Regulares en Notación Infija
|Notación Infija|Notación Prefija|
* | operando operando
* . operando operando
* \+ operando
* \* operando
* ? operando
* ### Ejemplos de Expresiones Regulares en Notación Prefija o Polaca
|Notación Prefija|Notación Infija|
|----------------|---------------|
|((operando)* \| operando)+|+ \| * operando operando|
|(operando)+(operando \| operando)|. + operando \| operando operando|
|+ \| * operando operando|((operando)* \| operando)+|
|. + operando \| operando operando|(operando)+(operando \| operando)|

[Subir](#exregan)

Expand All @@ -128,9 +128,9 @@ CONJ: digit -> 0~9;
--------------COMENTARIO MULTILÍNEA--------------
!>
//Expresiones Regulares
REGEX1 -> ("1"?."2"*|"3"+."2"*)|("2"?."3"+."1"|"3"."1"*);
REGEX2 -> ("a"."b"."c")+|"a"?."x"."y"."z"|("0"|"1")+;
numero -> {digit}+.(".".{digit}+)?;
REGEX1 -> ||.?"1"*"2".+"3"*"2"|..?"2"+"3""1"."3"*"1";
REGEX2 -> ||+.."a""b""c"...?"a""x""y""z"+|"0""1";
numero -> .+{digit}?."."+{digit};

%%
//Validación de Cadenas
Expand Down
Binary file modified Proyecto1.jar
Binary file not shown.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ CONJ: digit -> 0~9;
--------------COMENTARIO MULTILÍNEA--------------
!>
//Expresiones Regulares
REGEX1 -> ("1"?."2"*|"3"+."2"*)|("2"?."3"+."1"|"3"."1"*);
REGEX2 -> ("a"."b"."c")+|"a"?."x"."y"."z"|("0"|"1")+;
numero -> {digit}+.(".".{digit}+)?;
REGEX1 -> ||.?"1"*"2".+"3"*"2"|..?"2"+"3""1"."3"*"1";
REGEX2 -> ||+.."a""b""c"...?"a""x""y""z"+|"0""1";
numero -> .+{digit}?."."+{digit};

%%
//Validación de Cadenas
Expand Down Expand Up @@ -58,12 +58,11 @@ SPECIFIC ->
TK_char

OPERATION ->
OPERATION '.' OPERATION |
OPERATION '|' OPERATION |
OPERATION '*' |
OPERATION '+' |
OPERATION '?' |
'(' OPERATION ')' |
'.' OPERATION OPERATION |
'|' OPERATION OPERATION |
'*' OPERATION |
'+' OPERATION |
'?' OPERATION |
OPERAND

OPERAND ->
Expand Down
Binary file modified bin/Files
Binary file not shown.
Binary file modified bin/Interface/IDE.class
Binary file not shown.
Binary file modified bin/Language/Parser$CUP$Parser$actions.class
Binary file not shown.
Binary file modified bin/Language/Parser.class
Binary file not shown.
14 changes: 5 additions & 9 deletions bin/Language/Parser.cup
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ non terminal String CHARACTER;
non terminal String IDS;

/* 5. Precedencias */
precedence left TK_or;
precedence left TK_concat;
precedence left TK_positive, TK_kleene, TK_optional;

/* 6. Gramatica Libre de Contexto */

Expand Down Expand Up @@ -155,12 +152,11 @@ CHARACTER ::=
TK_kleene :ch {:RESULT = ch;:} ;

OPERATION ::=
OPERATION:op1 TK_or OPERATION:op2 {:RESULT = buildTree("|",op1,op2,op1.anulable || op2.anulable,Type.OR); :} |
OPERATION:op1 TK_concat OPERATION:op2 {:RESULT = buildTree(".",op1,op2,op1.anulable && op2.anulable,Type.CONCAT);:} |
OPERATION:op1 TK_kleene {:RESULT = buildTree("*",op1,null,true,Type.KLEENE); :} |
OPERATION:op1 TK_positive {:RESULT = buildTree("+",op1,null,op1.anulable,Type.POSITIVE); :} |
OPERATION:op1 TK_optional {:RESULT = buildTree("?",op1,null,true,Type.OPTIONAL); :} |
TK_lpar OPERATION:op TK_rpar {:RESULT = op; :} |
TK_or OPERATION:op1 OPERATION:op2 {:RESULT = buildTree("|",op1,op2,op1.anulable || op2.anulable,Type.OR); :} |
TK_concat OPERATION:op1 OPERATION:op2 {:RESULT = buildTree(".",op1,op2,op1.anulable && op2.anulable,Type.CONCAT);:} |
TK_kleene OPERATION:op1 {:RESULT = buildTree("*",op1,null,true,Type.KLEENE); :} |
TK_positive OPERATION:op1 {:RESULT = buildTree("+",op1,null,op1.anulable,Type.POSITIVE); :} |
TK_optional OPERATION:op1 {:RESULT = buildTree("?",op1,null,true,Type.OPTIONAL); :} |
OPERAND:op {:RESULT = op; :} ;

OPERAND ::=
Expand Down
Binary file modified bin/Language/ParserF$CUP$ParserF$actions.class
Binary file not shown.
Binary file modified bin/Language/ParserF.class
Binary file not shown.
14 changes: 5 additions & 9 deletions bin/Language/ParserF.cup
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ non terminal String CHARACTER;
non terminal String IDS;

/* 5. Precedencias */
precedence left TK_or;
precedence left TK_concat;
precedence left TK_positive, TK_kleene, TK_optional;

/* 6. Gramatica Libre de Contexto */

Expand Down Expand Up @@ -93,12 +90,11 @@ CHARACTER ::=
TK_kleene :ch {:RESULT = ch;:} ;

OPERATION ::=
OPERATION TK_or :op {:painter.OPERATOR(opleft,opright);:} OPERATION |
OPERATION TK_concat :op {:painter.OPERATOR(opleft,opright);:} OPERATION |
OPERATION TK_kleene :op {:painter.OPERATOR(opleft,opright);:} |
OPERATION TK_positive:op {:painter.OPERATOR(opleft,opright);:} |
OPERATION TK_optional:op {:painter.OPERATOR(opleft,opright);:} |
TK_lpar OPERATION TK_rpar |
TK_or :op {:painter.OPERATOR(opleft,opright);:} OPERATION OPERATION |
TK_concat :op {:painter.OPERATOR(opleft,opright);:} OPERATION OPERATION |
TK_kleene :op {:painter.OPERATOR(opleft,opright);:} OPERATION |
TK_positive:op {:painter.OPERATOR(opleft,opright);:} OPERATION |
TK_optional:op {:painter.OPERATOR(opleft,opright);:} OPERATION |
OPERAND ;

OPERAND ::=
Expand Down
2 changes: 1 addition & 1 deletion src/Interface/IDE.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void addComponents() {
this.add(saveOLC);
}
void copyright() {
this.add(new Label(0,695,1390,15,"EXREGAN Infix",11));
this.add(new Label(0,695,1390,15,"EXREGAN Prefix",11));
this.add(new Label(0,710,1390,15,"© Danny Hugo Bryan Tejaxún Pichiyá",11));
}
void addToolBar() {
Expand Down
14 changes: 5 additions & 9 deletions src/Language/Parser.cup
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ non terminal String CHARACTER;
non terminal String IDS;

/* 5. Precedencias */
precedence left TK_or;
precedence left TK_concat;
precedence left TK_positive, TK_kleene, TK_optional;

/* 6. Gramatica Libre de Contexto */

Expand Down Expand Up @@ -155,12 +152,11 @@ CHARACTER ::=
TK_kleene :ch {:RESULT = ch;:} ;

OPERATION ::=
OPERATION:op1 TK_or OPERATION:op2 {:RESULT = buildTree("|",op1,op2,op1.anulable || op2.anulable,Type.OR); :} |
OPERATION:op1 TK_concat OPERATION:op2 {:RESULT = buildTree(".",op1,op2,op1.anulable && op2.anulable,Type.CONCAT);:} |
OPERATION:op1 TK_kleene {:RESULT = buildTree("*",op1,null,true,Type.KLEENE); :} |
OPERATION:op1 TK_positive {:RESULT = buildTree("+",op1,null,op1.anulable,Type.POSITIVE); :} |
OPERATION:op1 TK_optional {:RESULT = buildTree("?",op1,null,true,Type.OPTIONAL); :} |
TK_lpar OPERATION:op TK_rpar {:RESULT = op; :} |
TK_or OPERATION:op1 OPERATION:op2 {:RESULT = buildTree("|",op1,op2,op1.anulable || op2.anulable,Type.OR); :} |
TK_concat OPERATION:op1 OPERATION:op2 {:RESULT = buildTree(".",op1,op2,op1.anulable && op2.anulable,Type.CONCAT);:} |
TK_kleene OPERATION:op1 {:RESULT = buildTree("*",op1,null,true,Type.KLEENE); :} |
TK_positive OPERATION:op1 {:RESULT = buildTree("+",op1,null,op1.anulable,Type.POSITIVE); :} |
TK_optional OPERATION:op1 {:RESULT = buildTree("?",op1,null,true,Type.OPTIONAL); :} |
OPERAND:op {:RESULT = op; :} ;

OPERAND ::=
Expand Down
Loading

0 comments on commit d5d541b

Please sign in to comment.