Skip to content

Instantly share code, notes, and snippets.

View melchisedech333's full-sized avatar
💚
O amor é o desejo de eternidade do ser amado - Santo Tomás de Aquino

Jessé Romero melchisedech333

💚
O amor é o desejo de eternidade do ser amado - Santo Tomás de Aquino
  • Stone Co
  • Mom's basement
View GitHub Profile
@melchisedech333
melchisedech333 / hello.v
Created March 21, 2022 01:09
Hello World!
Hello World!
@melchisedech333
melchisedech333 / code.l
Created March 27, 2022 01:12
Código Lex
%{
#include <stdio.h>
#include <string.h>
#include "y.tab.h"
void yyerror (char *c);
%}
/* Todos outros tokens não especificados. */
OTHERS .
@melchisedech333
melchisedech333 / code.y
Created March 27, 2022 01:13
Código Yacc
%{
#include <stdio.h>
#include <string.h>
void yyerror (char *c);
int yylex (void);
%}
%union {
struct {
@melchisedech333
melchisedech333 / code.l
Created March 27, 2022 02:19
Lexer - chave e valor
%{
#include <stdio.h>
#include <string.h>
#include "y.tab.h"
void yyerror (char *c);
%}
CHARS [a-zA-Z0-9]+
STRING \"{CHARS}\"
@melchisedech333
melchisedech333 / code.y
Created March 27, 2022 02:20
Processa chave e valor
%{
#include <stdio.h>
#include <string.h>
void yyerror (char *c);
int yylex (void);
%}
%union {
char *value;
@melchisedech333
melchisedech333 / code.l
Created March 27, 2022 04:14
Lex para analisar variáveis
%{
#include <stdio.h>
#include <string.h>
#include "y.tab.h"
void yyerror (char *c);
%}
CHARS [a-zA-Z0-9]+
STRING \"{CHARS}\"
@melchisedech333
melchisedech333 / code.y
Created March 27, 2022 04:14
Yacc para analisar variáveis
%{
#include <stdio.h>
#include <string.h>
void yyerror (char *c);
int yylex (void);
%}
%union {
char *value;
@melchisedech333
melchisedech333 / code.l
Created March 27, 2022 05:15
Lexer da análise dos arrays
%{
#include <stdio.h>
#include <string.h>
#include "y.tab.h"
void yyerror (char *c);
%}
CHARS [a-zA-Z0-9]+
STRING \"{CHARS}\"
@melchisedech333
melchisedech333 / code.y
Created March 27, 2022 05:16
Yacc da análise dos arrays.
%{
#include <stdio.h>
#include <string.h>
void yyerror (char *c);
int yylex (void);
%}
%union {
char *value;
@melchisedech333
melchisedech333 / main.cpp
Created March 28, 2022 17:41
Acessando elementos dos sub-níveis da ASY
#include <iostream>
#include "antlr4-runtime.h"
#include "TLexer.h"
#include "TParser.h"
#include "TParserBaseVisitor.h"
using namespace antlrcpptest;
using namespace antlr4;