This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Semantico implements Constants | |
{ | |
private TabelaHashSimbolos tabelaSimbolos; | |
private boolean expressaoUnicoOperando; | |
private Integer nivelAtual; | |
private Integer deslocamento; | |
/**Armazena o tipo da expressao que esta sendo analisada */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package simbolos; | |
public class Simbolo { | |
private String nome; | |
public Simbolo() { | |
} | |
public String getNome() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package simbolos; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import gals.SemanticError; | |
import gals.Token; | |
import utils.Logger; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Programa válido Sintáticamente | |
programa testeValido; | |
// Declaração de variáveis | |
inteiro quant; | |
real[5] probabilidades = @idQualquer; | |
cadeia[falso][@dimensao] texto; //semânticamente inválido |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Visão: Posts with Actions | |
-- Descrição: Retorna a tabela posts com as colunas número de likes, shares (reblogs) e replies | |
CREATE OR REPLACE VIEW posts_with_actions AS | |
SELECT p.id, p.title, p.content, p.blog_id, p.creator_id, p.published_at, | |
p.url, p.image_path, p.created_at, p.updated_at, | |
sum( | |
CASE | |
WHEN a.kind = 1 THEN 1 | |
ELSE 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Tabela: Actions | |
-- Descrição: Guarda todas as ações feitas num post. Ex: like (1), reply (2), share (3) | |
CREATE TABLE actions | |
( | |
id serial NOT NULL, | |
text text, | |
creator_id integer, | |
post_id integer, | |
kind integer NOT NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Consulta: News Feed | |
-- Descrição: Busca todos os posts dos blogs que o usuário segue | |
SELECT posts.* | |
FROM posts_with_actions posts | |
JOIN blogs ON blogs.id = posts.blog_id | |
JOIN relationships ON relationships.followed_id = blogs.id AND relationships.follower_id = 7 | |
ORDER BY created_at DESC | |
-- Consulta: Blog posts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void criaNovoEstado(Estado estado, Automato automato, String terminal) { | |
String nomeAFND; | |
Estado novoEstado; | |
List<Estado> transicoes; | |
List<Estado> conjunto = estado.getEstadosConjunto(); | |
List<Estado> listE = new ArrayList<Estado>(); | |
if (conjunto != null) { | |
for (Estado parte : conjunto) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void estadosIniciais(List<Estado> estados) { | |
HashSet<Estado> set = new HashSet<Estado>(); | |
for (Estado estado : estados) { | |
List<Estado> conjuto = estado.getEstadosConjunto(); | |
if (conjuto != null && conjuto.size() > 0) { | |
for (Estado parte : conjuto) { | |
set.add(parte); | |
} | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (key === 90) | |
{ | |
console.log(this.opts.buffer) | |
if (this.opts.buffer !== false) | |
{ | |
e.preventDefault(); | |
console.log(this.getBuffer()); | |
} | |
else if (e.shiftKey) | |
{ |
NewerOlder