├── .gitignore ├── 2020_3 ├── projeto1 │ ├── Grammar.g4 │ ├── Projeto de Compiladores.pdf │ ├── Readme_Windows.txt │ ├── antlr-4.7.2-complete.jar │ ├── inputs │ │ ├── 00.c │ │ ├── 02.c │ │ └── 03.c │ ├── makefile │ └── outputs │ │ ├── 00.png │ │ ├── 02.png │ │ └── 03.png ├── projeto2 │ ├── Grammar.g4 │ ├── GrammarCheckerVisitor.py │ ├── Projeto2 de Compiladores.pdf │ ├── Readme_Windows.txt │ ├── antlr-4.7.2-complete.jar │ ├── antlr4-python3-runtime-4.7.2 │ │ ├── MANIFEST.in │ │ ├── PKG-INFO │ │ ├── README.txt │ │ ├── RELEASE-4.5.txt │ │ ├── setup.cfg │ │ ├── setup.py │ │ └── src │ │ │ ├── antlr4 │ │ │ ├── BufferedTokenStream.py │ │ │ ├── CommonTokenFactory.py │ │ │ ├── CommonTokenStream.py │ │ │ ├── FileStream.py │ │ │ ├── InputStream.py │ │ │ ├── IntervalSet.py │ │ │ ├── LL1Analyzer.py │ │ │ ├── Lexer.py │ │ │ ├── ListTokenSource.py │ │ │ ├── Parser.py │ │ │ ├── ParserInterpreter.py │ │ │ ├── ParserRuleContext.py │ │ │ ├── PredictionContext.py │ │ │ ├── Recognizer.py │ │ │ ├── RuleContext.py │ │ │ ├── StdinStream.py │ │ │ ├── Token.py │ │ │ ├── TokenStreamRewriter.py │ │ │ ├── Utils.py │ │ │ ├── __init__.py │ │ │ ├── atn │ │ │ │ ├── ATN.py │ │ │ │ ├── ATNConfig.py │ │ │ │ ├── ATNConfigSet.py │ │ │ │ ├── ATNDeserializationOptions.py │ │ │ │ ├── ATNDeserializer.py │ │ │ │ ├── ATNSimulator.py │ │ │ │ ├── ATNState.py │ │ │ │ ├── ATNType.py │ │ │ │ ├── LexerATNSimulator.py │ │ │ │ ├── LexerAction.py │ │ │ │ ├── LexerActionExecutor.py │ │ │ │ ├── ParserATNSimulator.py │ │ │ │ ├── PredictionMode.py │ │ │ │ ├── SemanticContext.py │ │ │ │ ├── Transition.py │ │ │ │ └── __init__.py │ │ │ ├── dfa │ │ │ │ ├── DFA.py │ │ │ │ ├── DFASerializer.py │ │ │ │ ├── DFAState.py │ │ │ │ └── __init__.py │ │ │ ├── error │ │ │ │ ├── DiagnosticErrorListener.py │ │ │ │ ├── ErrorListener.py │ │ │ │ ├── ErrorStrategy.py │ │ │ │ ├── Errors.py │ │ │ │ └── __init__.py │ │ │ ├── tree │ │ │ │ ├── Chunk.py │ │ │ │ ├── ParseTreeMatch.py │ │ │ │ ├── ParseTreePattern.py │ │ │ │ ├── ParseTreePatternMatcher.py │ │ │ │ ├── RuleTagToken.py │ │ │ │ ├── TokenTagToken.py │ │ │ │ ├── Tree.py │ │ │ │ ├── Trees.py │ │ │ │ └── __init__.py │ │ │ └── xpath │ │ │ │ ├── XPath.py │ │ │ │ └── __init__.py │ │ │ ├── antlr4_python3_runtime.egg-info │ │ │ ├── PKG-INFO │ │ │ ├── SOURCES.txt │ │ │ ├── dependency_links.txt │ │ │ ├── requires.txt │ │ │ └── top_level.txt │ │ │ └── main.py │ ├── inputs │ │ ├── 00.c │ │ └── 01.c │ ├── makefile │ └── outputs │ │ ├── 00.txt │ │ └── 01.txt ├── projeto3 │ ├── Grammar.g4 │ ├── GrammarCheckerVisitor.py │ ├── Readme_Windows.txt │ ├── antlr-4.7.2-complete.jar │ ├── antlr4-python3-runtime-4.7.2 │ │ ├── MANIFEST.in │ │ ├── PKG-INFO │ │ ├── README.txt │ │ ├── RELEASE-4.5.txt │ │ ├── setup.cfg │ │ ├── setup.py │ │ └── src │ │ │ ├── antlr4 │ │ │ ├── BufferedTokenStream.py │ │ │ ├── CommonTokenFactory.py │ │ │ ├── CommonTokenStream.py │ │ │ ├── FileStream.py │ │ │ ├── InputStream.py │ │ │ ├── IntervalSet.py │ │ │ ├── LL1Analyzer.py │ │ │ ├── Lexer.py │ │ │ ├── ListTokenSource.py │ │ │ ├── Parser.py │ │ │ ├── ParserInterpreter.py │ │ │ ├── ParserRuleContext.py │ │ │ ├── PredictionContext.py │ │ │ ├── Recognizer.py │ │ │ ├── RuleContext.py │ │ │ ├── StdinStream.py │ │ │ ├── Token.py │ │ │ ├── TokenStreamRewriter.py │ │ │ ├── Utils.py │ │ │ ├── __init__.py │ │ │ ├── atn │ │ │ │ ├── ATN.py │ │ │ │ ├── ATNConfig.py │ │ │ │ ├── ATNConfigSet.py │ │ │ │ ├── ATNDeserializationOptions.py │ │ │ │ ├── ATNDeserializer.py │ │ │ │ ├── ATNSimulator.py │ │ │ │ ├── ATNState.py │ │ │ │ ├── ATNType.py │ │ │ │ ├── LexerATNSimulator.py │ │ │ │ ├── LexerAction.py │ │ │ │ ├── LexerActionExecutor.py │ │ │ │ ├── ParserATNSimulator.py │ │ │ │ ├── PredictionMode.py │ │ │ │ ├── SemanticContext.py │ │ │ │ ├── Transition.py │ │ │ │ └── __init__.py │ │ │ ├── dfa │ │ │ │ ├── DFA.py │ │ │ │ ├── DFASerializer.py │ │ │ │ ├── DFAState.py │ │ │ │ └── __init__.py │ │ │ ├── error │ │ │ │ ├── DiagnosticErrorListener.py │ │ │ │ ├── ErrorListener.py │ │ │ │ ├── ErrorStrategy.py │ │ │ │ ├── Errors.py │ │ │ │ └── __init__.py │ │ │ ├── tree │ │ │ │ ├── Chunk.py │ │ │ │ ├── ParseTreeMatch.py │ │ │ │ ├── ParseTreePattern.py │ │ │ │ ├── ParseTreePatternMatcher.py │ │ │ │ ├── RuleTagToken.py │ │ │ │ ├── TokenTagToken.py │ │ │ │ ├── Tree.py │ │ │ │ ├── Trees.py │ │ │ │ └── __init__.py │ │ │ └── xpath │ │ │ │ ├── XPath.py │ │ │ │ └── __init__.py │ │ │ ├── antlr4_python3_runtime.egg-info │ │ │ ├── PKG-INFO │ │ │ ├── SOURCES.txt │ │ │ ├── dependency_links.txt │ │ │ ├── requires.txt │ │ │ └── top_level.txt │ │ │ └── main.py │ ├── inputs │ │ ├── 00.c │ │ ├── 02.c │ │ └── 03.c │ ├── makefile │ └── outputs │ │ ├── 00.txt │ │ ├── 02.txt │ │ └── 03.txt └── projeto4 │ ├── Grammar.g4 │ ├── GrammarCheckerVisitor.py │ ├── Readme_Windows.txt │ ├── antlr-4.7.2-complete.jar │ ├── antlr4-python3-runtime-4.7.2 │ ├── MANIFEST.in │ ├── PKG-INFO │ ├── README.txt │ ├── RELEASE-4.5.txt │ ├── setup.cfg │ ├── setup.py │ └── src │ │ ├── antlr4 │ │ ├── BufferedTokenStream.py │ │ ├── CommonTokenFactory.py │ │ ├── CommonTokenStream.py │ │ ├── FileStream.py │ │ ├── InputStream.py │ │ ├── IntervalSet.py │ │ ├── LL1Analyzer.py │ │ ├── Lexer.py │ │ ├── ListTokenSource.py │ │ ├── Parser.py │ │ ├── ParserInterpreter.py │ │ ├── ParserRuleContext.py │ │ ├── PredictionContext.py │ │ ├── Recognizer.py │ │ ├── RuleContext.py │ │ ├── StdinStream.py │ │ ├── Token.py │ │ ├── TokenStreamRewriter.py │ │ ├── Utils.py │ │ ├── __init__.py │ │ ├── atn │ │ │ ├── ATN.py │ │ │ ├── ATNConfig.py │ │ │ ├── ATNConfigSet.py │ │ │ ├── ATNDeserializationOptions.py │ │ │ ├── ATNDeserializer.py │ │ │ ├── ATNSimulator.py │ │ │ ├── ATNState.py │ │ │ ├── ATNType.py │ │ │ ├── LexerATNSimulator.py │ │ │ ├── LexerAction.py │ │ │ ├── LexerActionExecutor.py │ │ │ ├── ParserATNSimulator.py │ │ │ ├── PredictionMode.py │ │ │ ├── SemanticContext.py │ │ │ ├── Transition.py │ │ │ └── __init__.py │ │ ├── dfa │ │ │ ├── DFA.py │ │ │ ├── DFASerializer.py │ │ │ ├── DFAState.py │ │ │ └── __init__.py │ │ ├── error │ │ │ ├── DiagnosticErrorListener.py │ │ │ ├── ErrorListener.py │ │ │ ├── ErrorStrategy.py │ │ │ ├── Errors.py │ │ │ └── __init__.py │ │ ├── tree │ │ │ ├── Chunk.py │ │ │ ├── ParseTreeMatch.py │ │ │ ├── ParseTreePattern.py │ │ │ ├── ParseTreePatternMatcher.py │ │ │ ├── RuleTagToken.py │ │ │ ├── TokenTagToken.py │ │ │ ├── Tree.py │ │ │ ├── Trees.py │ │ │ └── __init__.py │ │ └── xpath │ │ │ ├── XPath.py │ │ │ └── __init__.py │ │ ├── antlr4_python3_runtime.egg-info │ │ ├── PKG-INFO │ │ ├── SOURCES.txt │ │ ├── dependency_links.txt │ │ ├── requires.txt │ │ └── top_level.txt │ │ └── main.py │ ├── inputs │ ├── 00.c │ ├── 02.c │ └── 03.c │ ├── makefile │ └── outputs │ ├── 00.ll │ ├── 02.ll │ └── 03.ll ├── LICENSE ├── README.md ├── TeoImplLingComp.docx ├── alunos.md ├── antigo ├── ap1 │ ├── Aula Prática 1 (Análise Léxica e Sintática com ANTLR4).pptx │ ├── README.txt │ ├── antlr-4.7.2-complete.jar │ ├── grammars │ │ ├── C.g4 │ │ ├── Exp.g4 │ │ ├── Hello.g4 │ │ ├── If1.g4 │ │ ├── If2.g4 │ │ └── If3.g4 │ ├── makefile │ └── test.c ├── ap2 │ ├── Aula Prática 2 (Tree Walking com ANTLR4).pptx │ ├── README.txt │ ├── TestExtendVisitor.py │ ├── antlr-4.7.2-complete.jar │ ├── antlr-annotexp-grammar-tree-walking │ │ ├── AnnotExp.g4 │ │ ├── AnnotExp.tokens │ │ ├── AnnotExpLexer.tokens │ │ ├── _classpath.xml │ │ ├── _project.xml │ │ ├── input │ │ ├── lib │ │ │ └── antlr-runtime-4.5.3.jar │ │ └── src │ │ │ ├── application │ │ │ ├── ANTLRInputStreamUtils.java │ │ │ ├── TreeWalkerApplicationListener.java │ │ │ └── TreeWalkerApplicationVisitor.java │ │ │ ├── autogenerated │ │ │ ├── listener │ │ │ │ ├── AnnotExpBaseListener.java │ │ │ │ ├── AnnotExpLexer.java │ │ │ │ ├── AnnotExpListener.java │ │ │ │ └── AnnotExpParser.java │ │ │ └── visitor │ │ │ │ ├── AnnotExpBaseVisitor.java │ │ │ │ ├── AnnotExpLexer.java │ │ │ │ ├── AnnotExpParser.java │ │ │ │ └── AnnotExpVisitor.java │ │ │ └── walker │ │ │ ├── AnnotExpExtendListener.java │ │ │ └── AnnotExpExtendVisitor.java │ ├── antlr-test-grammar-tree-walking │ │ ├── Test.g4 │ │ ├── lib │ │ │ └── antlr-runtime-4.5.3.jar │ │ └── src │ │ │ ├── application │ │ │ └── TreeWalkerApplicationVisitor.java │ │ │ ├── autogenerated │ │ │ ├── TestBaseVisitor.java │ │ │ ├── TestLexer.java │ │ │ ├── TestParser.java │ │ │ └── TestVisitor.java │ │ │ └── walker │ │ │ └── TestExtendVisitor.java │ ├── antlr4-python3-runtime-4.7.2 │ │ ├── MANIFEST.in │ │ ├── PKG-INFO │ │ ├── README.txt │ │ ├── RELEASE-4.5.txt │ │ ├── setup.cfg │ │ ├── setup.py │ │ └── src │ │ │ ├── antlr4 │ │ │ ├── BufferedTokenStream.py │ │ │ ├── CommonTokenFactory.py │ │ │ ├── CommonTokenStream.py │ │ │ ├── FileStream.py │ │ │ ├── InputStream.py │ │ │ ├── IntervalSet.py │ │ │ ├── LL1Analyzer.py │ │ │ ├── Lexer.py │ │ │ ├── ListTokenSource.py │ │ │ ├── Parser.py │ │ │ ├── ParserInterpreter.py │ │ │ ├── ParserRuleContext.py │ │ │ ├── PredictionContext.py │ │ │ ├── Recognizer.py │ │ │ ├── RuleContext.py │ │ │ ├── StdinStream.py │ │ │ ├── Token.py │ │ │ ├── TokenStreamRewriter.py │ │ │ ├── Utils.py │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── BufferedTokenStream.cpython-37.pyc │ │ │ │ ├── CommonTokenFactory.cpython-37.pyc │ │ │ │ ├── CommonTokenStream.cpython-37.pyc │ │ │ │ ├── FileStream.cpython-37.pyc │ │ │ │ ├── InputStream.cpython-37.pyc │ │ │ │ ├── IntervalSet.cpython-37.pyc │ │ │ │ ├── LL1Analyzer.cpython-37.pyc │ │ │ │ ├── Lexer.cpython-37.pyc │ │ │ │ ├── ListTokenSource.cpython-37.pyc │ │ │ │ ├── Parser.cpython-37.pyc │ │ │ │ ├── ParserRuleContext.cpython-37.pyc │ │ │ │ ├── PredictionContext.cpython-37.pyc │ │ │ │ ├── Recognizer.cpython-37.pyc │ │ │ │ ├── RuleContext.cpython-37.pyc │ │ │ │ ├── StdinStream.cpython-37.pyc │ │ │ │ ├── Token.cpython-37.pyc │ │ │ │ ├── Utils.cpython-37.pyc │ │ │ │ └── __init__.cpython-37.pyc │ │ │ ├── atn │ │ │ │ ├── ATN.py │ │ │ │ ├── ATNConfig.py │ │ │ │ ├── ATNConfigSet.py │ │ │ │ ├── ATNDeserializationOptions.py │ │ │ │ ├── ATNDeserializer.py │ │ │ │ ├── ATNSimulator.py │ │ │ │ ├── ATNState.py │ │ │ │ ├── ATNType.py │ │ │ │ ├── LexerATNSimulator.py │ │ │ │ ├── LexerAction.py │ │ │ │ ├── LexerActionExecutor.py │ │ │ │ ├── ParserATNSimulator.py │ │ │ │ ├── PredictionMode.py │ │ │ │ ├── SemanticContext.py │ │ │ │ ├── Transition.py │ │ │ │ ├── __init__.py │ │ │ │ └── __pycache__ │ │ │ │ │ ├── ATN.cpython-37.pyc │ │ │ │ │ ├── ATNConfig.cpython-37.pyc │ │ │ │ │ ├── ATNConfigSet.cpython-37.pyc │ │ │ │ │ ├── ATNDeserializationOptions.cpython-37.pyc │ │ │ │ │ ├── ATNDeserializer.cpython-37.pyc │ │ │ │ │ ├── ATNSimulator.cpython-37.pyc │ │ │ │ │ ├── ATNState.cpython-37.pyc │ │ │ │ │ ├── ATNType.cpython-37.pyc │ │ │ │ │ ├── LexerATNSimulator.cpython-37.pyc │ │ │ │ │ ├── LexerAction.cpython-37.pyc │ │ │ │ │ ├── LexerActionExecutor.cpython-37.pyc │ │ │ │ │ ├── ParserATNSimulator.cpython-37.pyc │ │ │ │ │ ├── PredictionMode.cpython-37.pyc │ │ │ │ │ ├── SemanticContext.cpython-37.pyc │ │ │ │ │ ├── Transition.cpython-37.pyc │ │ │ │ │ └── __init__.cpython-37.pyc │ │ │ ├── dfa │ │ │ │ ├── DFA.py │ │ │ │ ├── DFASerializer.py │ │ │ │ ├── DFAState.py │ │ │ │ ├── __init__.py │ │ │ │ └── __pycache__ │ │ │ │ │ ├── DFA.cpython-37.pyc │ │ │ │ │ ├── DFAState.cpython-37.pyc │ │ │ │ │ └── __init__.cpython-37.pyc │ │ │ ├── error │ │ │ │ ├── DiagnosticErrorListener.py │ │ │ │ ├── ErrorListener.py │ │ │ │ ├── ErrorStrategy.py │ │ │ │ ├── Errors.py │ │ │ │ ├── __init__.py │ │ │ │ └── __pycache__ │ │ │ │ │ ├── DiagnosticErrorListener.cpython-37.pyc │ │ │ │ │ ├── ErrorListener.cpython-37.pyc │ │ │ │ │ ├── ErrorStrategy.cpython-37.pyc │ │ │ │ │ ├── Errors.cpython-37.pyc │ │ │ │ │ └── __init__.cpython-37.pyc │ │ │ ├── tree │ │ │ │ ├── Chunk.py │ │ │ │ ├── ParseTreeMatch.py │ │ │ │ ├── ParseTreePattern.py │ │ │ │ ├── ParseTreePatternMatcher.py │ │ │ │ ├── RuleTagToken.py │ │ │ │ ├── TokenTagToken.py │ │ │ │ ├── Tree.py │ │ │ │ ├── Trees.py │ │ │ │ ├── __init__.py │ │ │ │ └── __pycache__ │ │ │ │ │ ├── Chunk.cpython-37.pyc │ │ │ │ │ ├── ParseTreePatternMatcher.cpython-37.pyc │ │ │ │ │ ├── RuleTagToken.cpython-37.pyc │ │ │ │ │ ├── TokenTagToken.cpython-37.pyc │ │ │ │ │ ├── Tree.cpython-37.pyc │ │ │ │ │ ├── Trees.cpython-37.pyc │ │ │ │ │ └── __init__.cpython-37.pyc │ │ │ └── xpath │ │ │ │ ├── XPath.py │ │ │ │ └── __init__.py │ │ │ ├── antlr4_python3_runtime.egg-info │ │ │ ├── PKG-INFO │ │ │ ├── SOURCES.txt │ │ │ ├── dependency_links.txt │ │ │ ├── requires.txt │ │ │ └── top_level.txt │ │ │ └── main.py │ ├── compiler │ │ ├── include │ │ │ ├── ast.h │ │ │ ├── lexer.h │ │ │ ├── parser.h │ │ │ └── visitor.h │ │ ├── makefile │ │ ├── src │ │ │ ├── ast.c │ │ │ ├── lexer.c │ │ │ ├── main.c │ │ │ ├── parser.c │ │ │ └── visitor.c │ │ ├── tags │ │ ├── test_error.c │ │ └── test_ok.c │ ├── grammars │ │ └── Test.g4 │ └── makefile ├── ap3 │ ├── Aula Prática 3 (Análise Semântica com ANTLR4).pptx │ ├── CymbolCheckerVisitor.py │ ├── DONT_README.txt │ ├── antlr-4.7.2-complete.jar │ ├── antlr-cymbol-grammar-checker-types │ │ ├── Cymbol.g4 │ │ ├── Cymbol.tokens │ │ ├── CymbolLexer.tokens │ │ ├── _classpath.xml │ │ ├── _project.xml │ │ ├── lib │ │ │ └── antlr-runtime-4.5.3.jar │ │ └── src │ │ │ ├── application │ │ │ └── CheckerTypesApplicationVisitor.java │ │ │ ├── autogenerated │ │ │ ├── CymbolBaseVisitor.java │ │ │ ├── CymbolLexer.java │ │ │ ├── CymbolParser.java │ │ │ └── CymbolVisitor.java │ │ │ └── walker │ │ │ ├── CymbolCheckerVisitor.java │ │ │ └── Type.java │ ├── antlr4-python3-runtime-4.7.2 │ │ ├── MANIFEST.in │ │ ├── PKG-INFO │ │ ├── README.txt │ │ ├── RELEASE-4.5.txt │ │ ├── setup.cfg │ │ ├── setup.py │ │ └── src │ │ │ ├── antlr4 │ │ │ ├── BufferedTokenStream.py │ │ │ ├── CommonTokenFactory.py │ │ │ ├── CommonTokenStream.py │ │ │ ├── FileStream.py │ │ │ ├── InputStream.py │ │ │ ├── IntervalSet.py │ │ │ ├── LL1Analyzer.py │ │ │ ├── Lexer.py │ │ │ ├── ListTokenSource.py │ │ │ ├── Parser.py │ │ │ ├── ParserInterpreter.py │ │ │ ├── ParserRuleContext.py │ │ │ ├── PredictionContext.py │ │ │ ├── Recognizer.py │ │ │ ├── RuleContext.py │ │ │ ├── StdinStream.py │ │ │ ├── Token.py │ │ │ ├── TokenStreamRewriter.py │ │ │ ├── Utils.py │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── BufferedTokenStream.cpython-37.pyc │ │ │ │ ├── CommonTokenFactory.cpython-37.pyc │ │ │ │ ├── CommonTokenStream.cpython-37.pyc │ │ │ │ ├── FileStream.cpython-37.pyc │ │ │ │ ├── InputStream.cpython-37.pyc │ │ │ │ ├── IntervalSet.cpython-37.pyc │ │ │ │ ├── LL1Analyzer.cpython-37.pyc │ │ │ │ ├── Lexer.cpython-37.pyc │ │ │ │ ├── ListTokenSource.cpython-37.pyc │ │ │ │ ├── Parser.cpython-37.pyc │ │ │ │ ├── ParserRuleContext.cpython-37.pyc │ │ │ │ ├── PredictionContext.cpython-37.pyc │ │ │ │ ├── Recognizer.cpython-37.pyc │ │ │ │ ├── RuleContext.cpython-37.pyc │ │ │ │ ├── StdinStream.cpython-37.pyc │ │ │ │ ├── Token.cpython-37.pyc │ │ │ │ ├── Utils.cpython-37.pyc │ │ │ │ └── __init__.cpython-37.pyc │ │ │ ├── atn │ │ │ │ ├── ATN.py │ │ │ │ ├── ATNConfig.py │ │ │ │ ├── ATNConfigSet.py │ │ │ │ ├── ATNDeserializationOptions.py │ │ │ │ ├── ATNDeserializer.py │ │ │ │ ├── ATNSimulator.py │ │ │ │ ├── ATNState.py │ │ │ │ ├── ATNType.py │ │ │ │ ├── LexerATNSimulator.py │ │ │ │ ├── LexerAction.py │ │ │ │ ├── LexerActionExecutor.py │ │ │ │ ├── ParserATNSimulator.py │ │ │ │ ├── PredictionMode.py │ │ │ │ ├── SemanticContext.py │ │ │ │ ├── Transition.py │ │ │ │ ├── __init__.py │ │ │ │ └── __pycache__ │ │ │ │ │ ├── ATN.cpython-37.pyc │ │ │ │ │ ├── ATNConfig.cpython-37.pyc │ │ │ │ │ ├── ATNConfigSet.cpython-37.pyc │ │ │ │ │ ├── ATNDeserializationOptions.cpython-37.pyc │ │ │ │ │ ├── ATNDeserializer.cpython-37.pyc │ │ │ │ │ ├── ATNSimulator.cpython-37.pyc │ │ │ │ │ ├── ATNState.cpython-37.pyc │ │ │ │ │ ├── ATNType.cpython-37.pyc │ │ │ │ │ ├── LexerATNSimulator.cpython-37.pyc │ │ │ │ │ ├── LexerAction.cpython-37.pyc │ │ │ │ │ ├── LexerActionExecutor.cpython-37.pyc │ │ │ │ │ ├── ParserATNSimulator.cpython-37.pyc │ │ │ │ │ ├── PredictionMode.cpython-37.pyc │ │ │ │ │ ├── SemanticContext.cpython-37.pyc │ │ │ │ │ ├── Transition.cpython-37.pyc │ │ │ │ │ └── __init__.cpython-37.pyc │ │ │ ├── dfa │ │ │ │ ├── DFA.py │ │ │ │ ├── DFASerializer.py │ │ │ │ ├── DFAState.py │ │ │ │ ├── __init__.py │ │ │ │ └── __pycache__ │ │ │ │ │ ├── DFA.cpython-37.pyc │ │ │ │ │ ├── DFAState.cpython-37.pyc │ │ │ │ │ └── __init__.cpython-37.pyc │ │ │ ├── error │ │ │ │ ├── DiagnosticErrorListener.py │ │ │ │ ├── ErrorListener.py │ │ │ │ ├── ErrorStrategy.py │ │ │ │ ├── Errors.py │ │ │ │ ├── __init__.py │ │ │ │ └── __pycache__ │ │ │ │ │ ├── DiagnosticErrorListener.cpython-37.pyc │ │ │ │ │ ├── ErrorListener.cpython-37.pyc │ │ │ │ │ ├── ErrorStrategy.cpython-37.pyc │ │ │ │ │ ├── Errors.cpython-37.pyc │ │ │ │ │ └── __init__.cpython-37.pyc │ │ │ ├── tree │ │ │ │ ├── Chunk.py │ │ │ │ ├── ParseTreeMatch.py │ │ │ │ ├── ParseTreePattern.py │ │ │ │ ├── ParseTreePatternMatcher.py │ │ │ │ ├── RuleTagToken.py │ │ │ │ ├── TokenTagToken.py │ │ │ │ ├── Tree.py │ │ │ │ ├── Trees.py │ │ │ │ ├── __init__.py │ │ │ │ └── __pycache__ │ │ │ │ │ ├── Chunk.cpython-37.pyc │ │ │ │ │ ├── ParseTreePatternMatcher.cpython-37.pyc │ │ │ │ │ ├── RuleTagToken.cpython-37.pyc │ │ │ │ │ ├── TokenTagToken.cpython-37.pyc │ │ │ │ │ ├── Tree.cpython-37.pyc │ │ │ │ │ ├── Trees.cpython-37.pyc │ │ │ │ │ └── __init__.cpython-37.pyc │ │ │ └── xpath │ │ │ │ ├── XPath.py │ │ │ │ └── __init__.py │ │ │ ├── antlr4_python3_runtime.egg-info │ │ │ ├── PKG-INFO │ │ │ ├── SOURCES.txt │ │ │ ├── dependency_links.txt │ │ │ ├── requires.txt │ │ │ └── top_level.txt │ │ │ └── main.py │ ├── compiler │ │ ├── include │ │ │ ├── ast.h │ │ │ ├── lexer.h │ │ │ ├── parser.h │ │ │ └── visitor.h │ │ ├── makefile │ │ ├── src │ │ │ ├── ast.c │ │ │ ├── lexer.c │ │ │ ├── main.c │ │ │ ├── parser.c │ │ │ └── visitor.c │ │ ├── tags │ │ ├── test_error.c │ │ └── test_ok.c │ ├── grammars │ │ └── Cymbol.g4 │ └── makefile └── mini-projeto │ ├── Cymbol.g4 │ ├── Mini Projeto.pdf │ ├── antlr-4.7.1-complete.jar │ ├── compiler │ ├── compiler │ ├── include │ │ ├── ast.h │ │ ├── lexer.h │ │ ├── parser.h │ │ └── visitor.h │ ├── makefile │ ├── src │ │ ├── ast.c │ │ ├── lexer.c │ │ ├── main.c │ │ ├── parser.c │ │ └── visitor.c │ ├── tags │ ├── test.c │ └── test.ll │ ├── especificação.pdf │ └── mini_projeto.md ├── demos ├── asm │ ├── genAgent │ ├── manifest.mf │ ├── run │ └── src │ │ ├── examples │ │ └── Foo.java │ │ └── instr │ │ ├── .svn │ │ ├── all-wcprops │ │ ├── entries │ │ ├── text-base │ │ │ └── Util.java.svn-base │ │ └── tmp │ │ │ ├── Util.java.tmp │ │ │ └── tempfile.2.tmp │ │ ├── ClassInstrumenter.java │ │ ├── Wrapper.java │ │ ├── agent │ │ ├── .svn │ │ │ ├── all-wcprops │ │ │ ├── entries │ │ │ └── text-base │ │ │ │ ├── InstrumentationAgent.java.svn-base │ │ │ │ └── InstrumentationState.java.svn-base │ │ ├── InstrumentationAgent.java │ │ └── InstrumentationState.java │ │ └── transform │ │ ├── EntryExitTransformer.java │ │ ├── MemoryAccessTransformer.java │ │ └── StatementTransformer.java ├── java-parser │ ├── .gitignore │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ ├── BinarySearchTree.java │ │ ├── Main.java │ │ ├── ParserExample.java │ │ └── VisitorExample.java ├── pattern-matching │ ├── PatternMain.java │ ├── grepexample.sh │ └── sampletext.txt ├── pin │ ├── .gitignore │ ├── calltrace.cpp │ ├── makefile │ ├── makefile.rules │ ├── perfectnum.cpp │ └── s ├── recursive-descent-parsing │ ├── .gitignore │ ├── build.gradle │ ├── demo-parsing-visitor.rtf │ └── src │ │ ├── main │ │ └── java │ │ │ ├── Constants.java │ │ │ ├── Parser.java │ │ │ ├── Token.java │ │ │ ├── TokenId.java │ │ │ ├── TokenNum.java │ │ │ └── TokenOp.java │ │ └── test │ │ └── java │ │ └── BasicTest.java ├── rwsets │ ├── .gitignore │ └── README ├── type-checking │ ├── .gitignore │ ├── README.md │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ └── ast │ │ │ ├── ArrayIndexing.java │ │ │ ├── ArrayType.java │ │ │ ├── CharType.java │ │ │ ├── Declaration.java │ │ │ ├── Expression.java │ │ │ ├── FunctionCall.java │ │ │ ├── FunctionType.java │ │ │ ├── Id.java │ │ │ ├── IntType.java │ │ │ ├── Literal.java │ │ │ ├── Mod.java │ │ │ ├── Node.java │ │ │ ├── Num.java │ │ │ ├── Program.java │ │ │ ├── Type.java │ │ │ └── visitors │ │ │ ├── IdsVisitor.java │ │ │ ├── TypeCheckerVisitor.java │ │ │ ├── TypeError.java │ │ │ ├── Visitor.java │ │ │ └── VisitorAdaptor.java │ │ └── test │ │ └── java │ │ └── ast │ │ ├── ASTSamples.java │ │ └── visitors │ │ ├── IdsVisitorTest.java │ │ └── TypeCheckerVisitorTest.java └── visitors │ ├── BinaryExpr.java │ ├── CalculatorVisitor.java │ ├── Expr.java │ ├── LiteralExpr.java │ ├── Main.java │ ├── PrinterInfix.java │ ├── PrinterPosfix.java │ ├── PrinterPrefix.java │ ├── Visitor.java │ ├── VisitorAdaptor.java │ └── s ├── provas ├── 2001-1-prova1.txt ├── 2001-2-prova1.txt ├── 2001-2-prova2.txt ├── 2002-1-prova1.doc ├── 2002-1-prova1.pdf ├── 2002-1-prova1res.doc ├── 2002-1-prova1res.pdf ├── 2002-2-final.txt ├── 2002-2-prova1.doc ├── 2002-2-prova1.pdf ├── 2002-2-prova2.txt ├── 2003-2-prova1.doc ├── 2004-1-prova1.txt ├── 2004-2-prova1.doc ├── 2005-1-prova1.doc ├── 2005-2-prova1.txt ├── 2006-1-prova1a.doc ├── 2007-1-prova1.doc ├── 2008-1-prova1.docx ├── 2009-1-prova1a.doc ├── 2009-2-prova1b.doc ├── 2010-2-prova1.doc ├── 2011-1-1ee.odt ├── 2011-1-2aChamada.txt ├── 2011-1-2ee.txt ├── 2011-1-Final.txt ├── 2011-2-1ee.doc ├── 2011-2-2ee.doc ├── 2011-2-Final.txt ├── 2012-1-1ee.odt ├── 2012-1-2ee.doc ├── 2012-2-Final 2.odt ├── 2012-2-Final 2.txt ├── 2012-2-Final.txt ├── 2013-1-2EE.txt ├── 2013-1-Final.txt ├── 2013-1EE.java ├── 2014-2.txt ├── 2015-1-2EE.txt ├── 2015-1-FINAL.txt ├── 2016-2-2ee.txt ├── 2017-1-1ee.docx ├── 2017-1-2EE-respostas.txt ├── 2017-1-2EE.txt ├── 2017-1-Final.docx ├── 2017-2-1EE.odt ├── 2017-2-2EE-respostas.txt ├── 2017-2-2EE.txt ├── 2017-2-FINAL.txt ├── 2018-1-1EE-respostas.txt ├── 2018-1-1EE.txt ├── 2018-1-2EE-respostas.txt ├── 2018-1-2EE.txt ├── 2018-1-FINAL.txt ├── 2018-2-1EE-respostas.txt ├── 2018-2-1EE.txt ├── 2018-2-2EE-respostas.txt ├── 2018-2-2EE.txt ├── 2018-2-FINAL.txt ├── 2019-1-1EE-respostas.txt ├── 2019-1-1EE.txt ├── 2019-1-2EE.txt ├── 2019-1-FINAL.txt ├── 2019-2-2EE.txt └── 2019-2-FINAL.txt └── slides-aulas ├── README.txt ├── ambiente-exec-e-geracao-codigo.pptx ├── ambiente-exec.pptx ├── analise-estatica.pptx ├── analise-lexica.pptx ├── analise-semantica.pptx ├── analise-sintatica.pptx ├── aplicacoes.pptx ├── conceitos-basicos.pptx ├── geracao-de-codigo.pptx ├── intro.pptx └── representacoes-intermediarias.pptx /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | */build 3 | */.gradle 4 | *.so 5 | *.out 6 | *.o 7 | */provas-leopoldo 8 | **/*.class -------------------------------------------------------------------------------- /2020_3/projeto1/Projeto de Compiladores.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/2020_3/projeto1/Projeto de Compiladores.pdf -------------------------------------------------------------------------------- /2020_3/projeto1/Readme_Windows.txt: -------------------------------------------------------------------------------- 1 | 1- Clonar Repositório da cadeira 2 | 2- Baixar o JDK e colocar seu caminho na variável de ambiente PATH 3 | 3- Colocar o caminho do arquivo .jar do ANTLR na variável de ambiente CLASSPATH 4 | 4- Comando para gerar lexer e parser: 5 | java org.antlr.v4.Tool Grammar.g4 6 | 5- Comando para compilar: 7 | javac Grammar*.java 8 | 6- Comando para gerar a árvore: 9 | java org.antlr.v4.runtime.misc.TestRig Grammar file -gui -------------------------------------------------------------------------------- /2020_3/projeto1/antlr-4.7.2-complete.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/2020_3/projeto1/antlr-4.7.2-complete.jar -------------------------------------------------------------------------------- /2020_3/projeto1/inputs/00.c: -------------------------------------------------------------------------------- 1 | int a = 3; 2 | float b = 0.3; 3 | 4 | float square (float x) { 5 | return x * x; 6 | } 7 | 8 | int main () { 9 | float c = a / b; 10 | c /= 3 * (2 - b) + 4; 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /2020_3/projeto1/inputs/02.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main () { 4 | int a = 3 * 5 - 2 + 1; 5 | printf("a = %d\n", a); 6 | 7 | int b = 4 + a * 3; 8 | printf("b = %d\n", b); 9 | 10 | int c = a * b * - 1; 11 | printf("c = %d\n", c); 12 | 13 | int d = c * a + b * c - a; 14 | printf("d = %d\n", d); 15 | 16 | int e = a - b + c * -d; 17 | printf("e = %d\n", e); 18 | return 0; 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /2020_3/projeto1/inputs/03.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "meh.h" 4 | #define PI 3.14159265 5 | 6 | // comment 7 | int unum = 1; 8 | 9 | int scalar (int a, int b) { 10 | for (int i = 0; i < 10; i++) { 11 | printf("boo\n"); 12 | if (a < b) a -= b; 13 | } 14 | /*********** 15 | * comment * 16 | ***********/ 17 | if (a > b) { 18 | printf("a > b\n"); 19 | } else if (a < b) { 20 | printf("a < b\n"); 21 | } else { 22 | printf("a == b\n"); 23 | } 24 | 25 | return sqrt(a * a + b + (b - a) * b); 26 | } 27 | 28 | float pi = 3.14159265; 29 | 30 | int main () { 31 | int quantas_trincas = 33, valor1 = 821; 32 | float tk[3] = { -1.0, 0.0, 1.0 }; 33 | printf("scalar{%d, %d} = %d\n", quantas_trincas, valor1 - tk[0], scalar(quantas_trincas, valor1)); 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /2020_3/projeto1/makefile: -------------------------------------------------------------------------------- 1 | FILENAME = Grammar 2 | ROOTRULE = file 3 | 4 | SHELL = /bin/bash 5 | ANTLR = antlr-4.7.2-complete.jar 6 | ANTLR4 = java -jar $(ANTLR) 7 | GRUN = java org.antlr.v4.gui.TestRig 8 | CLASSFILES = $(shell echo autogen/$(FILENAME){{Base,}Listener,Lexer,Parser}.class) 9 | TOKENFILES = $(shell echo autogen/$(FILENAME){Lexer,}.tokens) 10 | JAVAFILES = $(shell echo autogen/$(FILENAME){{Base,}Listener,Lexer,Parser}.java) 11 | .PHONY: classpath clean tree 12 | 13 | #------------------------------- java rules --------------------------- 14 | # requires package: jdk-openjdk 15 | 16 | tree: $(CLASSFILES) | classpath 17 | $(GRUN) $(FILENAME) $(ROOTRULE) -gui 18 | 19 | $(CLASSFILES) $(JAVAFILES) $(TOKENFILES): autogen/$(FILENAME).g4 | classpath 20 | $(ANTLR4) autogen/$(FILENAME).g4 21 | javac $(JAVAFILES) 22 | 23 | classpath: 24 | $(eval export CLASSPATH=".:$(PWD)/autogen:$(PWD)/$(ANTLR):$(CLASSPATH)") 25 | 26 | autogen/$(FILENAME).g4: | $(FILENAME).g4 autogen 27 | ln -s ../$(FILENAME).g4 $@ 28 | 29 | autogen: 30 | mkdir $@ 31 | 32 | #---------------------------- clean ---------------------------------- 33 | 34 | clean: 35 | -rm -rf autogen 36 | 37 | -------------------------------------------------------------------------------- /2020_3/projeto1/outputs/00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/2020_3/projeto1/outputs/00.png -------------------------------------------------------------------------------- /2020_3/projeto1/outputs/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/2020_3/projeto1/outputs/02.png -------------------------------------------------------------------------------- /2020_3/projeto1/outputs/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/2020_3/projeto1/outputs/03.png -------------------------------------------------------------------------------- /2020_3/projeto2/Projeto2 de Compiladores.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/2020_3/projeto2/Projeto2 de Compiladores.pdf -------------------------------------------------------------------------------- /2020_3/projeto2/Readme_Windows.txt: -------------------------------------------------------------------------------- 1 | Tutorial para Execução no Windows utilizando Python 2 | 3 | ==================================================================================================== 4 | Geração de Lexer/Parser/Visitor 5 | ==================================================================================================== 6 | 7 | 1. Execute o comando 8 | 'java -jar antlr-4.7.2-complete.jar -Dlanguage=Python3 Grammar.g4 -visitor -no-listener' 9 | 10 | 2. Mova os arquivos gerados para o diretório 'antlr4-python3-runtime-4.7.2/src/autogen' 11 | 12 | 3. Edite o arquivo 'GrammarCheckerVisitor.py' para implementar os requisitos pedidos. 13 | obs.: O arquivo GrammarCheckerVisitor.py também deve estar no diretório 'antlr4-python3-runtime-4.7.2/src/autogen'. 14 | 15 | 4. Execute o comando: 16 | 'python antlr4-python3-runtime-4.7.2/src/main.py < inputs/ArquivoTeste.c' 17 | trocando 'ArquivoTeste.c' pelo nome do arquivo teste que você queira executar. -------------------------------------------------------------------------------- /2020_3/projeto2/antlr-4.7.2-complete.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/2020_3/projeto2/antlr-4.7.2-complete.jar -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.txt -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: antlr4-python3-runtime 3 | Version: 4.7.2 4 | Summary: ANTLR 4.7.2 runtime for Python 3.6.3 5 | Home-page: http://www.antlr.org 6 | Author: Eric Vergnaud, Terence Parr, Sam Harwell 7 | Author-email: eric.vergnaud@wanadoo.fr 8 | License: BSD 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/README.txt: -------------------------------------------------------------------------------- 1 | This is the Python 3.4 runtime for ANTLR. 2 | Visit the ANTLR web sites for more information: 3 | http://www.antlr.org 4 | https://raw.githubusercontent.com/antlr/antlr4/master/doc/python-target.md 5 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/RELEASE-4.5.txt: -------------------------------------------------------------------------------- 1 | What's in this release? 2 | 3 | - fixed bug where non-ascii input streams would fail 4 | - added support for visitor pattern 5 | - added support for wildcards in grammar 6 | 7 | Breaking change: 8 | 9 | In version 4.4, the parser/lexer had a tokenNames member. 10 | This has been removed in favor of the following members: 11 | - lexicalNames, containing the parsed text 12 | - symbolicNames, corresponding to tokenNames 13 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/setup.cfg: -------------------------------------------------------------------------------- 1 | [egg_info] 2 | tag_build = 3 | tag_date = 0 4 | 5 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name='antlr4-python3-runtime', 5 | version='4.7.2', 6 | packages=['antlr4', 'antlr4.atn', 'antlr4.dfa', 'antlr4.tree', 'antlr4.error', 'antlr4.xpath'], 7 | package_dir={'': 'src'}, 8 | install_requires=[ 9 | "typing ; python_version<'3.5'", 10 | ], 11 | url='http://www.antlr.org', 12 | license='BSD', 13 | author='Eric Vergnaud, Terence Parr, Sam Harwell', 14 | author_email='eric.vergnaud@wanadoo.fr', 15 | description='ANTLR 4.7.2 runtime for Python 3.6.3' 16 | ) 17 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/FileStream.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 3 | # Use of this file is governed by the BSD 3-clause license that 4 | # can be found in the LICENSE.txt file in the project root. 5 | # 6 | 7 | # 8 | # This is an InputStream that is loaded from a file all at once 9 | # when you construct the object. 10 | # 11 | 12 | import codecs 13 | import unittest 14 | from antlr4.InputStream import InputStream 15 | 16 | 17 | class FileStream(InputStream): 18 | 19 | def __init__(self, fileName:str, encoding:str='ascii', errors:str='strict'): 20 | super().__init__(self.readDataFrom(fileName, encoding, errors)) 21 | self.fileName = fileName 22 | 23 | def readDataFrom(self, fileName:str, encoding:str, errors:str='strict'): 24 | # read binary to avoid line ending conversion 25 | with open(fileName, 'rb') as file: 26 | bytes = file.read() 27 | return codecs.decode(bytes, encoding, errors) 28 | 29 | 30 | class TestFileStream(unittest.TestCase): 31 | 32 | def testStream(self): 33 | stream = FileStream(__file__) 34 | self.assertTrue(stream.size>0) 35 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/StdinStream.py: -------------------------------------------------------------------------------- 1 | import codecs 2 | import sys 3 | 4 | from antlr4.InputStream import InputStream 5 | 6 | 7 | class StdinStream(InputStream): 8 | def __init__(self, encoding:str='ascii', errors:str='strict') -> None: 9 | bytes = sys.stdin.buffer.read() 10 | data = codecs.decode(bytes, encoding, errors) 11 | super().__init__(data) 12 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/Utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | # 5 | 6 | from io import StringIO 7 | 8 | def str_list(val): 9 | with StringIO() as buf: 10 | buf.write('[') 11 | first = True 12 | for item in val: 13 | if not first: 14 | buf.write(', ') 15 | buf.write(str(item)) 16 | first = False 17 | buf.write(']') 18 | return buf.getvalue() 19 | 20 | def escapeWhitespace(s:str, escapeSpaces:bool): 21 | with StringIO() as buf: 22 | for c in s: 23 | if c==' ' and escapeSpaces: 24 | buf.write('\u00B7') 25 | elif c=='\t': 26 | buf.write("\\t") 27 | elif c=='\n': 28 | buf.write("\\n") 29 | elif c=='\r': 30 | buf.write("\\r") 31 | else: 32 | buf.write(c) 33 | return buf.getvalue() 34 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/__init__.py: -------------------------------------------------------------------------------- 1 | from antlr4.Token import Token 2 | from antlr4.InputStream import InputStream 3 | from antlr4.FileStream import FileStream 4 | from antlr4.StdinStream import StdinStream 5 | from antlr4.BufferedTokenStream import TokenStream 6 | from antlr4.CommonTokenStream import CommonTokenStream 7 | from antlr4.Lexer import Lexer 8 | from antlr4.Parser import Parser 9 | from antlr4.dfa.DFA import DFA 10 | from antlr4.atn.ATN import ATN 11 | from antlr4.atn.ATNDeserializer import ATNDeserializer 12 | from antlr4.atn.LexerATNSimulator import LexerATNSimulator 13 | from antlr4.atn.ParserATNSimulator import ParserATNSimulator 14 | from antlr4.atn.PredictionMode import PredictionMode 15 | from antlr4.PredictionContext import PredictionContextCache 16 | from antlr4.ParserRuleContext import RuleContext, ParserRuleContext 17 | from antlr4.tree.Tree import ParseTreeListener, ParseTreeVisitor, ParseTreeWalker, TerminalNode, ErrorNode, RuleNode 18 | from antlr4.error.Errors import RecognitionException, IllegalStateException, NoViableAltException 19 | from antlr4.error.ErrorStrategy import BailErrorStrategy 20 | from antlr4.error.DiagnosticErrorListener import DiagnosticErrorListener 21 | from antlr4.Utils import str_list 22 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/ATNDeserializationOptions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | 5 | # need a forward declaration 6 | ATNDeserializationOptions = None 7 | 8 | class ATNDeserializationOptions(object): 9 | 10 | defaultOptions = None 11 | 12 | def __init__(self, copyFrom:ATNDeserializationOptions = None): 13 | self.readOnly = False 14 | self.verifyATN = True if copyFrom is None else copyFrom.verifyATN 15 | self.generateRuleBypassTransitions = False if copyFrom is None else copyFrom.generateRuleBypassTransitions 16 | 17 | def __setattr__(self, key, value): 18 | if key!="readOnly" and self.readOnly: 19 | raise Exception("The object is read only.") 20 | super(type(self), self).__setattr__(key,value) 21 | 22 | ATNDeserializationOptions.defaultOptions = ATNDeserializationOptions() 23 | ATNDeserializationOptions.defaultOptions.readOnly = True 24 | 25 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/ATNType.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | #/ 5 | 6 | from enum import IntEnum 7 | 8 | # Represents the type of recognizer an ATN applies to. 9 | 10 | class ATNType(IntEnum): 11 | 12 | LEXER = 0 13 | PARSER = 1 14 | 15 | @classmethod 16 | def fromOrdinal(cls, i:int): 17 | return cls._value2member_map_[i] 18 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/error/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/Chunk.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 3 | # Use of this file is governed by the BSD 3-clause license that 4 | # can be found in the LICENSE.txt file in the project root. 5 | # 6 | 7 | class Chunk(object): 8 | pass 9 | 10 | class TagChunk(Chunk): 11 | 12 | def __init__(self, tag:str, label:str=None): 13 | self.tag = tag 14 | self.label = label 15 | 16 | def __str__(self): 17 | if self.label is None: 18 | return self.tag 19 | else: 20 | return self.label + ":" + self.tag 21 | 22 | class TextChunk(Chunk): 23 | 24 | def __init__(self, text:str): 25 | self.text = text 26 | 27 | def __str__(self): 28 | return "'" + self.text + "'" 29 | 30 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__init__.py -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4/xpath/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: antlr4-python3-runtime 3 | Version: 4.7.2 4 | Summary: ANTLR 4.7.2 runtime for Python 3.6.3 5 | Home-page: http://www.antlr.org 6 | Author: Eric Vergnaud, Terence Parr, Sam Harwell 7 | Author-email: eric.vergnaud@wanadoo.fr 8 | License: BSD 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | 2 | [:python_version < "3.5"] 3 | typing 4 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | antlr4 2 | -------------------------------------------------------------------------------- /2020_3/projeto2/antlr4-python3-runtime-4.7.2/src/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from antlr4 import * 3 | from autogen.GrammarLexer import GrammarLexer 4 | from autogen.GrammarParser import GrammarParser 5 | from autogen.GrammarCheckerVisitor import GrammarCheckerVisitor 6 | 7 | def main (argv): 8 | inpt = 0 if len(argv) <= 1 else argv[1] 9 | input_stream = FileStream(inpt) 10 | lexer = GrammarLexer(input_stream) 11 | stream = CommonTokenStream(lexer) 12 | parser = GrammarParser(stream) 13 | tree = parser.fiile() 14 | visitor = GrammarCheckerVisitor() 15 | visitor = tree.accept(visitor) 16 | 17 | if __name__ == '__main__': 18 | main(sys.argv) 19 | -------------------------------------------------------------------------------- /2020_3/projeto2/outputs/00.txt: -------------------------------------------------------------------------------- 1 | ERROR: trying to return a non void expression from void function 'doing' in line 21 and column 1 2 | WARNING: possible loss of information assigning float expression to int variable 'f' in line 49 and column 5 3 | WARNING: possible loss of information assigning float expression to int variable 'f' in line 50 and column 1 4 | WARNING: possible loss of information assigning float expression to int variable 'f' in line 51 and column 1 5 | WARNING: possible loss of information assigning float expression to int variable 'hello' in line 53 and column 5 6 | WARNING: possible loss of information assigning float expression to int variable 'hello' in line 54 and column 1 7 | WARNING: possible loss of information assigning float expression to int variable 'hello' in line 55 and column 1 8 | WARNING: possible loss of information converting float expression to int expression in parameter 0 of function 'square' in line 65 and column 5 9 | WARNING: possible loss of information converting float expression to int expression in parameter 0 of function 'fatorial' in line 66 and column 5 10 | WARNING: possible loss of information converting float expression to int expression in parameter 0 of function 'square' in line 67 and column 5 11 | ERROR: trying to assign 'void' expression to variable 'k' in line 71 and column 5 12 | ERROR: binary operator '+' used on type void in line 72 and column 24 13 | ERROR: undefined variable 'uv' in line 74 and column 1 14 | ERROR: trying to return void expression from function 'main' in line 75 and column 1 -------------------------------------------------------------------------------- /2020_3/projeto3/Readme_Windows.txt: -------------------------------------------------------------------------------- 1 | Tutorial para Execução no Windows utilizando Python 2 | 3 | ==================================================================================================== 4 | Geração de Lexer/Parser/Visitor 5 | ==================================================================================================== 6 | 7 | 1. Execute o comando 8 | 'java -jar antlr-4.7.2-complete.jar -Dlanguage=Python3 Grammar.g4 -visitor -no-listener' 9 | 10 | 2. Mova os arquivos gerados para o diretório 'antlr4-python3-runtime-4.7.2/src/autogen' 11 | 12 | 3. Edite o arquivo 'GrammarCheckerVisitor.py' para implementar os requisitos pedidos. 13 | obs.: O arquivo GrammarCheckerVisitor.py também deve estar no diretório 'antlr4-python3-runtime-4.7.2/src/autogen'. 14 | 15 | 4. Execute o comando: 16 | 'python antlr4-python3-runtime-4.7.2/src/main.py < inputs/ArquivoTeste.c' 17 | trocando 'ArquivoTeste.c' pelo nome do arquivo teste que você queira executar. -------------------------------------------------------------------------------- /2020_3/projeto3/antlr-4.7.2-complete.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/2020_3/projeto3/antlr-4.7.2-complete.jar -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.txt -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: antlr4-python3-runtime 3 | Version: 4.7.2 4 | Summary: ANTLR 4.7.2 runtime for Python 3.6.3 5 | Home-page: http://www.antlr.org 6 | Author: Eric Vergnaud, Terence Parr, Sam Harwell 7 | Author-email: eric.vergnaud@wanadoo.fr 8 | License: BSD 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/README.txt: -------------------------------------------------------------------------------- 1 | This is the Python 3.4 runtime for ANTLR. 2 | Visit the ANTLR web sites for more information: 3 | http://www.antlr.org 4 | https://raw.githubusercontent.com/antlr/antlr4/master/doc/python-target.md 5 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/RELEASE-4.5.txt: -------------------------------------------------------------------------------- 1 | What's in this release? 2 | 3 | - fixed bug where non-ascii input streams would fail 4 | - added support for visitor pattern 5 | - added support for wildcards in grammar 6 | 7 | Breaking change: 8 | 9 | In version 4.4, the parser/lexer had a tokenNames member. 10 | This has been removed in favor of the following members: 11 | - lexicalNames, containing the parsed text 12 | - symbolicNames, corresponding to tokenNames 13 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/setup.cfg: -------------------------------------------------------------------------------- 1 | [egg_info] 2 | tag_build = 3 | tag_date = 0 4 | 5 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name='antlr4-python3-runtime', 5 | version='4.7.2', 6 | packages=['antlr4', 'antlr4.atn', 'antlr4.dfa', 'antlr4.tree', 'antlr4.error', 'antlr4.xpath'], 7 | package_dir={'': 'src'}, 8 | install_requires=[ 9 | "typing ; python_version<'3.5'", 10 | ], 11 | url='http://www.antlr.org', 12 | license='BSD', 13 | author='Eric Vergnaud, Terence Parr, Sam Harwell', 14 | author_email='eric.vergnaud@wanadoo.fr', 15 | description='ANTLR 4.7.2 runtime for Python 3.6.3' 16 | ) 17 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4/FileStream.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 3 | # Use of this file is governed by the BSD 3-clause license that 4 | # can be found in the LICENSE.txt file in the project root. 5 | # 6 | 7 | # 8 | # This is an InputStream that is loaded from a file all at once 9 | # when you construct the object. 10 | # 11 | 12 | import codecs 13 | import unittest 14 | from antlr4.InputStream import InputStream 15 | 16 | 17 | class FileStream(InputStream): 18 | 19 | def __init__(self, fileName:str, encoding:str='ascii', errors:str='strict'): 20 | super().__init__(self.readDataFrom(fileName, encoding, errors)) 21 | self.fileName = fileName 22 | 23 | def readDataFrom(self, fileName:str, encoding:str, errors:str='strict'): 24 | # read binary to avoid line ending conversion 25 | with open(fileName, 'rb') as file: 26 | bytes = file.read() 27 | return codecs.decode(bytes, encoding, errors) 28 | 29 | 30 | class TestFileStream(unittest.TestCase): 31 | 32 | def testStream(self): 33 | stream = FileStream(__file__) 34 | self.assertTrue(stream.size>0) 35 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4/StdinStream.py: -------------------------------------------------------------------------------- 1 | import codecs 2 | import sys 3 | 4 | from antlr4.InputStream import InputStream 5 | 6 | 7 | class StdinStream(InputStream): 8 | def __init__(self, encoding:str='ascii', errors:str='strict') -> None: 9 | bytes = sys.stdin.buffer.read() 10 | data = codecs.decode(bytes, encoding, errors) 11 | super().__init__(data) 12 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4/Utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | # 5 | 6 | from io import StringIO 7 | 8 | def str_list(val): 9 | with StringIO() as buf: 10 | buf.write('[') 11 | first = True 12 | for item in val: 13 | if not first: 14 | buf.write(', ') 15 | buf.write(str(item)) 16 | first = False 17 | buf.write(']') 18 | return buf.getvalue() 19 | 20 | def escapeWhitespace(s:str, escapeSpaces:bool): 21 | with StringIO() as buf: 22 | for c in s: 23 | if c==' ' and escapeSpaces: 24 | buf.write('\u00B7') 25 | elif c=='\t': 26 | buf.write("\\t") 27 | elif c=='\n': 28 | buf.write("\\n") 29 | elif c=='\r': 30 | buf.write("\\r") 31 | else: 32 | buf.write(c) 33 | return buf.getvalue() 34 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4/__init__.py: -------------------------------------------------------------------------------- 1 | from antlr4.Token import Token 2 | from antlr4.InputStream import InputStream 3 | from antlr4.FileStream import FileStream 4 | from antlr4.StdinStream import StdinStream 5 | from antlr4.BufferedTokenStream import TokenStream 6 | from antlr4.CommonTokenStream import CommonTokenStream 7 | from antlr4.Lexer import Lexer 8 | from antlr4.Parser import Parser 9 | from antlr4.dfa.DFA import DFA 10 | from antlr4.atn.ATN import ATN 11 | from antlr4.atn.ATNDeserializer import ATNDeserializer 12 | from antlr4.atn.LexerATNSimulator import LexerATNSimulator 13 | from antlr4.atn.ParserATNSimulator import ParserATNSimulator 14 | from antlr4.atn.PredictionMode import PredictionMode 15 | from antlr4.PredictionContext import PredictionContextCache 16 | from antlr4.ParserRuleContext import RuleContext, ParserRuleContext 17 | from antlr4.tree.Tree import ParseTreeListener, ParseTreeVisitor, ParseTreeWalker, TerminalNode, ErrorNode, RuleNode 18 | from antlr4.error.Errors import RecognitionException, IllegalStateException, NoViableAltException 19 | from antlr4.error.ErrorStrategy import BailErrorStrategy 20 | from antlr4.error.DiagnosticErrorListener import DiagnosticErrorListener 21 | from antlr4.Utils import str_list 22 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/ATNDeserializationOptions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | 5 | # need a forward declaration 6 | ATNDeserializationOptions = None 7 | 8 | class ATNDeserializationOptions(object): 9 | 10 | defaultOptions = None 11 | 12 | def __init__(self, copyFrom:ATNDeserializationOptions = None): 13 | self.readOnly = False 14 | self.verifyATN = True if copyFrom is None else copyFrom.verifyATN 15 | self.generateRuleBypassTransitions = False if copyFrom is None else copyFrom.generateRuleBypassTransitions 16 | 17 | def __setattr__(self, key, value): 18 | if key!="readOnly" and self.readOnly: 19 | raise Exception("The object is read only.") 20 | super(type(self), self).__setattr__(key,value) 21 | 22 | ATNDeserializationOptions.defaultOptions = ATNDeserializationOptions() 23 | ATNDeserializationOptions.defaultOptions.readOnly = True 24 | 25 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/ATNType.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | #/ 5 | 6 | from enum import IntEnum 7 | 8 | # Represents the type of recognizer an ATN applies to. 9 | 10 | class ATNType(IntEnum): 11 | 12 | LEXER = 0 13 | PARSER = 1 14 | 15 | @classmethod 16 | def fromOrdinal(cls, i:int): 17 | return cls._value2member_map_[i] 18 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4/error/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/Chunk.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 3 | # Use of this file is governed by the BSD 3-clause license that 4 | # can be found in the LICENSE.txt file in the project root. 5 | # 6 | 7 | class Chunk(object): 8 | pass 9 | 10 | class TagChunk(Chunk): 11 | 12 | def __init__(self, tag:str, label:str=None): 13 | self.tag = tag 14 | self.label = label 15 | 16 | def __str__(self): 17 | if self.label is None: 18 | return self.tag 19 | else: 20 | return self.label + ":" + self.tag 21 | 22 | class TextChunk(Chunk): 23 | 24 | def __init__(self, text:str): 25 | self.text = text 26 | 27 | def __str__(self): 28 | return "'" + self.text + "'" 29 | 30 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__init__.py -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4/xpath/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: antlr4-python3-runtime 3 | Version: 4.7.2 4 | Summary: ANTLR 4.7.2 runtime for Python 3.6.3 5 | Home-page: http://www.antlr.org 6 | Author: Eric Vergnaud, Terence Parr, Sam Harwell 7 | Author-email: eric.vergnaud@wanadoo.fr 8 | License: BSD 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | 2 | [:python_version < "3.5"] 3 | typing 4 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | antlr4 2 | -------------------------------------------------------------------------------- /2020_3/projeto3/antlr4-python3-runtime-4.7.2/src/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from antlr4 import * 3 | from autogen.GrammarLexer import GrammarLexer 4 | from autogen.GrammarParser import GrammarParser 5 | from autogen.GrammarCheckerVisitor import GrammarCheckerVisitor 6 | 7 | def main (argv): 8 | inpt = 0 if len(argv) <= 1 else argv[1] 9 | input_stream = FileStream(inpt) 10 | lexer = GrammarLexer(input_stream) 11 | stream = CommonTokenStream(lexer) 12 | parser = GrammarParser(stream) 13 | tree = parser.fiile() 14 | visitor = GrammarCheckerVisitor() 15 | visitor = tree.accept(visitor) 16 | 17 | if __name__ == '__main__': 18 | main(sys.argv) 19 | -------------------------------------------------------------------------------- /2020_3/projeto3/inputs/00.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | float square (float x) { 4 | return x * x; 5 | } 6 | 7 | int main () { 8 | int a = 3; 9 | float b = 0.3; 10 | float c = a / b; 11 | c /= 3 * (2 - b) + 4; 12 | return 0*a; 13 | } 14 | -------------------------------------------------------------------------------- /2020_3/projeto3/inputs/02.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main () { 4 | int a = 3 * 5 - 2 + 1; 5 | 6 | 7 | int b = 4 + a * 3; 8 | 9 | int c = a * b * - 1; 10 | 11 | int d = c * a + b * c - a; 12 | 13 | int e = a - b + c * -d; 14 | 15 | if (e >= a + b + c) 16 | d = 550; 17 | 18 | int f = a * b + c / d; 19 | 20 | int g = a + f; 21 | 22 | return 0; 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /2020_3/projeto3/inputs/03.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "meh.h" 4 | #define PI 3.14159265 5 | 6 | // comment 7 | int unum = 1; 8 | 9 | 10 | 11 | int scalar (int a, int b) { 12 | int array[10]; 13 | for (int i = 0; i < 10; i++) { 14 | if (a < b) a -= b; 15 | array[i] = a; 16 | } 17 | /*********** 18 | * comment * 19 | ***********/ 20 | if (a > b) { 21 | a /= b - unum * 2 - (4 <= a - b); 22 | int j = 10; 23 | int k = (b + 115) * (2 * 10 / 5); 24 | } else if (a < b) { 25 | b += a / -unum + (8 >= b * a); 26 | } else { 27 | b = a; 28 | } 29 | 30 | return a * a + b + (b - a) * b; 31 | } 32 | 33 | float pi = 3.14159265; 34 | 35 | int main () { 36 | int quantas_trincas = 33, valor1 = 821; 37 | int tk[3] = { -1, 0, 1 }; 38 | valor1 = scalar(quantas_trincas - tk[2], valor1) - (tk[0] + valor1); 39 | return 0; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /2020_3/projeto3/outputs/00.txt: -------------------------------------------------------------------------------- 1 | line 10 Expression 3 / 0.3 simplified to: 10.0 2 | line 11 Expression 2 - 0.3 simplified to: 1.7 3 | line 11 Expression 3 * 1.7 simplified to: 5.1 4 | line 11 Expression 5.1 + 4 simplified to: 9.1 5 | line 12 Expression 0 * 3 simplified to: 0 -------------------------------------------------------------------------------- /2020_3/projeto3/outputs/02.txt: -------------------------------------------------------------------------------- 1 | line 4 Expression 3 * 5 simplified to: 15 2 | line 4 Expression 15 - 2 simplified to: 13 3 | line 4 Expression 13 + 1 simplified to: 14 4 | line 7 Expression 14 * 3 simplified to: 42 5 | line 7 Expression 4 + 42 simplified to: 46 6 | line 9 Expression 14 * 46 simplified to: 644 7 | line 9 Expression - 1 simplified to: -1 8 | line 9 Expression 644 * -1 simplified to: -644 9 | line 11 Expression -644 * 14 simplified to: -9016 10 | line 11 Expression 46 * -644 simplified to: -29624 11 | line 11 Expression -9016 + -29624 simplified to: -38640 12 | line 11 Expression -38640 - 14 simplified to: -38654 13 | line 13 Expression 14 - 46 simplified to: -32 14 | line 13 Expression - -38654 simplified to: 38654 15 | line 13 Expression -644 * 38654 simplified to: -24893176 16 | line 13 Expression -32 + -24893176 simplified to: -24893208 17 | line 15 Expression 14 + 46 simplified to: 60 18 | line 15 Expression 60 + -644 simplified to: -584 19 | line 15 Expression -24893208 >= -584 simplified to: 0 20 | line 18 Expression 14 * 46 simplified to: 644 -------------------------------------------------------------------------------- /2020_3/projeto3/outputs/03.txt: -------------------------------------------------------------------------------- 1 | line 23 Expression 2 * 10 simplified to: 20 2 | line 23 Expression 20 / 5 simplified to: 4.0 3 | line 37 Expression - 1 simplified to: -1 4 | line 38 Expression 33 - 1 simplified to: 32 5 | line 38 Expression -1 + 821 simplified to: 820 -------------------------------------------------------------------------------- /2020_3/projeto4/Readme_Windows.txt: -------------------------------------------------------------------------------- 1 | Tutorial para Execução no Windows utilizando Python 2 | 3 | ==================================================================================================== 4 | Geração de Lexer/Parser/Visitor 5 | ==================================================================================================== 6 | 7 | 1. Execute o comando 8 | 'java -jar antlr-4.7.2-complete.jar -Dlanguage=Python3 Grammar.g4 -visitor -no-listener' 9 | 10 | 2. Mova os arquivos gerados para o diretório 'antlr4-python3-runtime-4.7.2/src/autogen' 11 | 12 | 3. Edite o arquivo 'GrammarCheckerVisitor.py' para implementar os requisitos pedidos. 13 | obs.: O arquivo GrammarCheckerVisitor.py também deve estar no diretório 'antlr4-python3-runtime-4.7.2/src/autogen'. 14 | 15 | 4. Execute o comando: 16 | 'python antlr4-python3-runtime-4.7.2/src/main.py < inputs/ArquivoTeste.c' 17 | trocando 'ArquivoTeste.c' pelo nome do arquivo teste que você queira executar. -------------------------------------------------------------------------------- /2020_3/projeto4/antlr-4.7.2-complete.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/2020_3/projeto4/antlr-4.7.2-complete.jar -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.txt -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: antlr4-python3-runtime 3 | Version: 4.7.2 4 | Summary: ANTLR 4.7.2 runtime for Python 3.6.3 5 | Home-page: http://www.antlr.org 6 | Author: Eric Vergnaud, Terence Parr, Sam Harwell 7 | Author-email: eric.vergnaud@wanadoo.fr 8 | License: BSD 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/README.txt: -------------------------------------------------------------------------------- 1 | This is the Python 3.4 runtime for ANTLR. 2 | Visit the ANTLR web sites for more information: 3 | http://www.antlr.org 4 | https://raw.githubusercontent.com/antlr/antlr4/master/doc/python-target.md 5 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/RELEASE-4.5.txt: -------------------------------------------------------------------------------- 1 | What's in this release? 2 | 3 | - fixed bug where non-ascii input streams would fail 4 | - added support for visitor pattern 5 | - added support for wildcards in grammar 6 | 7 | Breaking change: 8 | 9 | In version 4.4, the parser/lexer had a tokenNames member. 10 | This has been removed in favor of the following members: 11 | - lexicalNames, containing the parsed text 12 | - symbolicNames, corresponding to tokenNames 13 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/setup.cfg: -------------------------------------------------------------------------------- 1 | [egg_info] 2 | tag_build = 3 | tag_date = 0 4 | 5 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name='antlr4-python3-runtime', 5 | version='4.7.2', 6 | packages=['antlr4', 'antlr4.atn', 'antlr4.dfa', 'antlr4.tree', 'antlr4.error', 'antlr4.xpath'], 7 | package_dir={'': 'src'}, 8 | install_requires=[ 9 | "typing ; python_version<'3.5'", 10 | ], 11 | url='http://www.antlr.org', 12 | license='BSD', 13 | author='Eric Vergnaud, Terence Parr, Sam Harwell', 14 | author_email='eric.vergnaud@wanadoo.fr', 15 | description='ANTLR 4.7.2 runtime for Python 3.6.3' 16 | ) 17 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4/FileStream.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 3 | # Use of this file is governed by the BSD 3-clause license that 4 | # can be found in the LICENSE.txt file in the project root. 5 | # 6 | 7 | # 8 | # This is an InputStream that is loaded from a file all at once 9 | # when you construct the object. 10 | # 11 | 12 | import codecs 13 | import unittest 14 | from antlr4.InputStream import InputStream 15 | 16 | 17 | class FileStream(InputStream): 18 | 19 | def __init__(self, fileName:str, encoding:str='ascii', errors:str='strict'): 20 | super().__init__(self.readDataFrom(fileName, encoding, errors)) 21 | self.fileName = fileName 22 | 23 | def readDataFrom(self, fileName:str, encoding:str, errors:str='strict'): 24 | # read binary to avoid line ending conversion 25 | with open(fileName, 'rb') as file: 26 | bytes = file.read() 27 | return codecs.decode(bytes, encoding, errors) 28 | 29 | 30 | class TestFileStream(unittest.TestCase): 31 | 32 | def testStream(self): 33 | stream = FileStream(__file__) 34 | self.assertTrue(stream.size>0) 35 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4/StdinStream.py: -------------------------------------------------------------------------------- 1 | import codecs 2 | import sys 3 | 4 | from antlr4.InputStream import InputStream 5 | 6 | 7 | class StdinStream(InputStream): 8 | def __init__(self, encoding:str='ascii', errors:str='strict') -> None: 9 | bytes = sys.stdin.buffer.read() 10 | data = codecs.decode(bytes, encoding, errors) 11 | super().__init__(data) 12 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4/Utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | # 5 | 6 | from io import StringIO 7 | 8 | def str_list(val): 9 | with StringIO() as buf: 10 | buf.write('[') 11 | first = True 12 | for item in val: 13 | if not first: 14 | buf.write(', ') 15 | buf.write(str(item)) 16 | first = False 17 | buf.write(']') 18 | return buf.getvalue() 19 | 20 | def escapeWhitespace(s:str, escapeSpaces:bool): 21 | with StringIO() as buf: 22 | for c in s: 23 | if c==' ' and escapeSpaces: 24 | buf.write('\u00B7') 25 | elif c=='\t': 26 | buf.write("\\t") 27 | elif c=='\n': 28 | buf.write("\\n") 29 | elif c=='\r': 30 | buf.write("\\r") 31 | else: 32 | buf.write(c) 33 | return buf.getvalue() 34 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4/__init__.py: -------------------------------------------------------------------------------- 1 | from antlr4.Token import Token 2 | from antlr4.InputStream import InputStream 3 | from antlr4.FileStream import FileStream 4 | from antlr4.StdinStream import StdinStream 5 | from antlr4.BufferedTokenStream import TokenStream 6 | from antlr4.CommonTokenStream import CommonTokenStream 7 | from antlr4.Lexer import Lexer 8 | from antlr4.Parser import Parser 9 | from antlr4.dfa.DFA import DFA 10 | from antlr4.atn.ATN import ATN 11 | from antlr4.atn.ATNDeserializer import ATNDeserializer 12 | from antlr4.atn.LexerATNSimulator import LexerATNSimulator 13 | from antlr4.atn.ParserATNSimulator import ParserATNSimulator 14 | from antlr4.atn.PredictionMode import PredictionMode 15 | from antlr4.PredictionContext import PredictionContextCache 16 | from antlr4.ParserRuleContext import RuleContext, ParserRuleContext 17 | from antlr4.tree.Tree import ParseTreeListener, ParseTreeVisitor, ParseTreeWalker, TerminalNode, ErrorNode, RuleNode 18 | from antlr4.error.Errors import RecognitionException, IllegalStateException, NoViableAltException 19 | from antlr4.error.ErrorStrategy import BailErrorStrategy 20 | from antlr4.error.DiagnosticErrorListener import DiagnosticErrorListener 21 | from antlr4.Utils import str_list 22 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4/atn/ATNDeserializationOptions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | 5 | # need a forward declaration 6 | ATNDeserializationOptions = None 7 | 8 | class ATNDeserializationOptions(object): 9 | 10 | defaultOptions = None 11 | 12 | def __init__(self, copyFrom:ATNDeserializationOptions = None): 13 | self.readOnly = False 14 | self.verifyATN = True if copyFrom is None else copyFrom.verifyATN 15 | self.generateRuleBypassTransitions = False if copyFrom is None else copyFrom.generateRuleBypassTransitions 16 | 17 | def __setattr__(self, key, value): 18 | if key!="readOnly" and self.readOnly: 19 | raise Exception("The object is read only.") 20 | super(type(self), self).__setattr__(key,value) 21 | 22 | ATNDeserializationOptions.defaultOptions = ATNDeserializationOptions() 23 | ATNDeserializationOptions.defaultOptions.readOnly = True 24 | 25 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4/atn/ATNType.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | #/ 5 | 6 | from enum import IntEnum 7 | 8 | # Represents the type of recognizer an ATN applies to. 9 | 10 | class ATNType(IntEnum): 11 | 12 | LEXER = 0 13 | PARSER = 1 14 | 15 | @classmethod 16 | def fromOrdinal(cls, i:int): 17 | return cls._value2member_map_[i] 18 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4/error/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4/tree/Chunk.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 3 | # Use of this file is governed by the BSD 3-clause license that 4 | # can be found in the LICENSE.txt file in the project root. 5 | # 6 | 7 | class Chunk(object): 8 | pass 9 | 10 | class TagChunk(Chunk): 11 | 12 | def __init__(self, tag:str, label:str=None): 13 | self.tag = tag 14 | self.label = label 15 | 16 | def __str__(self): 17 | if self.label is None: 18 | return self.tag 19 | else: 20 | return self.label + ":" + self.tag 21 | 22 | class TextChunk(Chunk): 23 | 24 | def __init__(self, text:str): 25 | self.text = text 26 | 27 | def __str__(self): 28 | return "'" + self.text + "'" 29 | 30 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__init__.py -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4/xpath/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: antlr4-python3-runtime 3 | Version: 4.7.2 4 | Summary: ANTLR 4.7.2 runtime for Python 3.6.3 5 | Home-page: http://www.antlr.org 6 | Author: Eric Vergnaud, Terence Parr, Sam Harwell 7 | Author-email: eric.vergnaud@wanadoo.fr 8 | License: BSD 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | 2 | [:python_version < "3.5"] 3 | typing 4 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | antlr4 2 | -------------------------------------------------------------------------------- /2020_3/projeto4/antlr4-python3-runtime-4.7.2/src/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from antlr4 import * 3 | from autogen.GrammarLexer import GrammarLexer 4 | from autogen.GrammarParser import GrammarParser 5 | from autogen.GrammarCheckerVisitor import GrammarCheckerVisitor 6 | 7 | def main (argv): 8 | inpt = 0 if len(argv) <= 1 else argv[1] 9 | input_stream = FileStream(inpt) 10 | lexer = GrammarLexer(input_stream) 11 | stream = CommonTokenStream(lexer) 12 | parser = GrammarParser(stream) 13 | tree = parser.fiile() 14 | visitor = GrammarCheckerVisitor() 15 | visitor = tree.accept(visitor) 16 | 17 | if __name__ == '__main__': 18 | main(sys.argv) 19 | -------------------------------------------------------------------------------- /2020_3/projeto4/inputs/00.c: -------------------------------------------------------------------------------- 1 | int square (int x) { 2 | return x * x; 3 | } 4 | 5 | void splash (int k) { 6 | return; 7 | } 8 | 9 | float ResDiv(float k1, float k2) 10 | { 11 | float k3 = k1 / (k1 + k2); 12 | return k3; 13 | } 14 | 15 | 16 | int main () { 17 | int a = 8; 18 | int b = 2; 19 | 20 | splash(a); 21 | 22 | float k1 = 50.0 * a; 23 | float k2 = 150.0 * b; 24 | float k = ResDiv(k1, k2); 25 | 26 | int c = a / b; 27 | c /= 3 * (2 - b) + 4; 28 | return square(c + 1); 29 | } 30 | -------------------------------------------------------------------------------- /2020_3/projeto4/inputs/02.c: -------------------------------------------------------------------------------- 1 | float glob1 = 4.9; 2 | int glob2 = 49; 3 | 4 | float return3() { 5 | return 3.0; 6 | } 7 | 8 | float operate(int k1, int k2) { 9 | float valor = (k1 * 3.0 + k2 * 7.0)/10; 10 | k2++; 11 | return valor + 5; 12 | } 13 | 14 | 15 | int main () { 16 | 17 | int a = 3 * 5 - 2 + 1; 18 | 19 | int b = 4 + a * 3; 20 | 21 | int c = a * b * - 1; 22 | 23 | int d = c * a + b * c - a; 24 | 25 | float e = a - b + c * -d; 26 | 27 | float f = a * b + c / d; 28 | 29 | float g = a + f; 30 | 31 | float h = glob1 + g; 32 | 33 | float i = (return3() + 5) * h; 34 | 35 | return a + b + c - d + glob2; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /2020_3/projeto4/inputs/03.c: -------------------------------------------------------------------------------- 1 | 2 | int half (int x) { 3 | return x / 2; 4 | } 5 | 6 | int scalar (int a, int b) { 7 | a *= -b; 8 | b++; 9 | 10 | return (half(a * a + b + (b - a) * b) + 3)/2; 11 | } 12 | 13 | float fscalar (float a, float b) { 14 | float result = ((a + b) / (a - b)) * (a * b) / (a / b); 15 | return result; 16 | } 17 | 18 | 19 | int main () { 20 | int quantas_trincas = 33, valor1 = 821; 21 | int tk2 = 1, tk0 = -1; 22 | valor1 = scalar(quantas_trincas - tk2, valor1) - tk0; 23 | 24 | return valor1; 25 | } 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2015 Marcelo d'Amorim 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /TeoImplLingComp.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/TeoImplLingComp.docx -------------------------------------------------------------------------------- /antigo/ap1/Aula Prática 1 (Análise Léxica e Sintática com ANTLR4).pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap1/Aula Prática 1 (Análise Léxica e Sintática com ANTLR4).pptx -------------------------------------------------------------------------------- /antigo/ap1/antlr-4.7.2-complete.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap1/antlr-4.7.2-complete.jar -------------------------------------------------------------------------------- /antigo/ap1/grammars/Exp.g4: -------------------------------------------------------------------------------- 1 | grammar Exp; 2 | 3 | s : e; 4 | e : e '*' e 5 | | e '+' e 6 | | INT 7 | ; 8 | 9 | INT : [0-9]+; 10 | WS : [ \t\r\n]+ -> skip; -------------------------------------------------------------------------------- /antigo/ap1/grammars/Hello.g4: -------------------------------------------------------------------------------- 1 | grammar Hello; 2 | 3 | r : 'hello' 'world'; 4 | ID : [a-z]+; 5 | WS : [ \t\r\n]+ -> skip; -------------------------------------------------------------------------------- /antigo/ap1/grammars/If1.g4: -------------------------------------------------------------------------------- 1 | grammar If1; 2 | 3 | s : id 4 | | iff 5 | ; 6 | 7 | id: ID; 8 | iff: IF; 9 | 10 | IF: 'if'; 11 | ID: [a-z]+; 12 | WS : [ \t\r\n]+ -> skip; -------------------------------------------------------------------------------- /antigo/ap1/grammars/If2.g4: -------------------------------------------------------------------------------- 1 | grammar If2; 2 | 3 | s : iff 4 | | id 5 | ; 6 | 7 | id: ID; 8 | iff: IF; 9 | 10 | ID: [a-z]+; 11 | IF: 'if'; 12 | WS : [ \t\r\n]+ -> skip; -------------------------------------------------------------------------------- /antigo/ap1/grammars/If3.g4: -------------------------------------------------------------------------------- 1 | grammar If3; 2 | 3 | s : id 4 | ; 5 | 6 | id: ID; 7 | 8 | IF: 'if'; 9 | ID: [a-z]+; 10 | WS : [ \t\r\n]+ -> skip; -------------------------------------------------------------------------------- /antigo/ap1/test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "meh.h" 4 | #define PI 3.14159265 5 | 6 | // comment 7 | int unum = 1; 8 | 9 | int scalar (int a, int b) { 10 | for (int i = 0; i < 10; i++) { 11 | printf("boo\n"); 12 | if (a < b) a -= b; 13 | } 14 | /*********** 15 | * comment * 16 | **********/ 17 | 18 | if (a > b) { 19 | printf("a > b\n"); 20 | } else if (a < b) { 21 | printf("a < b\n"); 22 | } else { 23 | printf("a == b\n"); 24 | } 25 | 26 | return sqrt(a * a + b * b - a * b); 27 | } 28 | 29 | float pi = 3.14159265; 30 | 31 | int main () { 32 | int quantas_trincas = 33, valor1 = 821; 33 | float tk[3] = { -1.0, 0.0, 1.0 }; 34 | printf("scalar(%d, %d) = %d\n", quantas_trincas, valor1 - tk[0], scalar(quantas_trincas, valor1)); 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /antigo/ap2/Aula Prática 2 (Tree Walking com ANTLR4).pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/Aula Prática 2 (Tree Walking com ANTLR4).pptx -------------------------------------------------------------------------------- /antigo/ap2/antlr-4.7.2-complete.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr-4.7.2-complete.jar -------------------------------------------------------------------------------- /antigo/ap2/antlr-annotexp-grammar-tree-walking/AnnotExp.g4: -------------------------------------------------------------------------------- 1 | grammar AnnotExp; 2 | 3 | s : e; 4 | e : e MUL e #MulExp 5 | | e ADD e #AddExp 6 | | INT #Int 7 | ; 8 | 9 | MUL : '*'; 10 | ADD : '+'; 11 | INT : [0-9]+; 12 | WS : [ \t\r\n]+ -> skip; -------------------------------------------------------------------------------- /antigo/ap2/antlr-annotexp-grammar-tree-walking/AnnotExp.tokens: -------------------------------------------------------------------------------- 1 | MUL=1 2 | ADD=2 3 | INT=3 4 | WS=4 5 | '*'=1 6 | '+'=2 7 | -------------------------------------------------------------------------------- /antigo/ap2/antlr-annotexp-grammar-tree-walking/AnnotExpLexer.tokens: -------------------------------------------------------------------------------- 1 | MUL=1 2 | ADD=2 3 | INT=3 4 | WS=4 5 | '*'=1 6 | '+'=2 7 | -------------------------------------------------------------------------------- /antigo/ap2/antlr-annotexp-grammar-tree-walking/_classpath.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /antigo/ap2/antlr-annotexp-grammar-tree-walking/_project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ANTLR-AnnotExp-Grammar-Tree-Walking 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /antigo/ap2/antlr-annotexp-grammar-tree-walking/input: -------------------------------------------------------------------------------- 1 | 40 * 5 + 56 -------------------------------------------------------------------------------- /antigo/ap2/antlr-annotexp-grammar-tree-walking/lib/antlr-runtime-4.5.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr-annotexp-grammar-tree-walking/lib/antlr-runtime-4.5.3.jar -------------------------------------------------------------------------------- /antigo/ap2/antlr-annotexp-grammar-tree-walking/src/application/ANTLRInputStreamUtils.java: -------------------------------------------------------------------------------- 1 | package application; 2 | 3 | import java.io.IOException; 4 | 5 | import org.antlr.v4.runtime.ANTLRFileStream; 6 | import org.antlr.v4.runtime.ANTLRInputStream; 7 | 8 | 9 | 10 | public class ANTLRInputStreamUtils { 11 | public static ANTLRInputStream getStandardInputStream( ) throws IOException { 12 | return (new ANTLRInputStream(System.in)); 13 | } 14 | 15 | public static ANTLRInputStream getFileInputStream(String filePath) throws IOException { 16 | return (new ANTLRFileStream(filePath)); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /antigo/ap2/antlr-annotexp-grammar-tree-walking/src/application/TreeWalkerApplicationListener.java: -------------------------------------------------------------------------------- 1 | package application; 2 | 3 | import java.io.IOException; 4 | import org.antlr.v4.runtime.*; 5 | import org.antlr.v4.runtime.tree.*; 6 | 7 | import autogenerated.listener.AnnotExpLexer; 8 | import autogenerated.listener.AnnotExpParser; 9 | import walker.AnnotExpExtendListener; 10 | 11 | 12 | 13 | public class TreeWalkerApplicationListener { 14 | public static void main(String[] args) throws IOException { 15 | //Create a CharStream that reads from standard input 16 | ANTLRInputStream input = ANTLRInputStreamUtils.getFileInputStream("input"); 17 | //Create a lexer that feeds off of input CharStream 18 | AnnotExpLexer lexer = new AnnotExpLexer(input); 19 | //Create a buffer of tokens pulled from the lexer 20 | CommonTokenStream tokens = new CommonTokenStream(lexer); 21 | //Create a parser that feeds off the tokens buffer 22 | AnnotExpParser parser = new AnnotExpParser(tokens); 23 | //Begin parsing at init rule 24 | ParseTree tree = parser.s( ); 25 | 26 | //Create the parse tree walker and listener 27 | ParseTreeWalker walker = new ParseTreeWalker( ); 28 | AnnotExpExtendListener listener = new AnnotExpExtendListener( ); 29 | //Walk the tree created by the parser 30 | walker.walk(listener, tree); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /antigo/ap2/antlr-annotexp-grammar-tree-walking/src/application/TreeWalkerApplicationVisitor.java: -------------------------------------------------------------------------------- 1 | package application; 2 | 3 | import java.io.IOException; 4 | import org.antlr.v4.runtime.*; 5 | import org.antlr.v4.runtime.tree.*; 6 | 7 | import autogenerated.visitor.AnnotExpLexer; 8 | import autogenerated.visitor.AnnotExpParser; 9 | import walker.AnnotExpExtendVisitor; 10 | 11 | 12 | 13 | public class TreeWalkerApplicationVisitor { 14 | public static void main(String[] args) throws IOException { 15 | //Create a CharStream that reads from standard input 16 | ANTLRInputStream input = ANTLRInputStreamUtils.getStandardInputStream( ); 17 | //Create a lexer that feeds off of input CharStream 18 | AnnotExpLexer lexer = new AnnotExpLexer(input); 19 | //Create a buffer of tokens pulled from the lexer 20 | CommonTokenStream tokens = new CommonTokenStream(lexer); 21 | //Create a parser that feeds off the tokens buffer 22 | AnnotExpParser parser = new AnnotExpParser(tokens); 23 | //Begin parsing at init rule 24 | ParseTree tree = parser.s( ); 25 | 26 | //Create the visitor 27 | AnnotExpExtendVisitor visitor = new AnnotExpExtendVisitor( ); 28 | //Visit the tree created by the parser 29 | System.out.println(tree.accept(visitor)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /antigo/ap2/antlr-test-grammar-tree-walking/Test.g4: -------------------------------------------------------------------------------- 1 | grammar Test; 2 | 3 | stat : ((attrStmt | expr) ';')+ EOF? #Expressions 4 | ; 5 | 6 | attrStmt: ID '=' expr #Assign 7 | ; 8 | 9 | expr : expr op=('*'|'/') expr #MultDiv 10 | | expr op=('+'|'-') expr #AddSub 11 | | INT #Int 12 | | ID #Identifier 13 | | '(' expr ')' #Paren 14 | ; 15 | 16 | //Fragmentos (Não constituem tokens por si só) 17 | fragment NUMBER: [0-9]; 18 | fragment LETTER: [a-zA-Z]; 19 | fragment UNDERLINE: '_'; 20 | 21 | //Tokens 22 | INT : NUMBER+ ; 23 | ID : (UNDERLINE | LETTER) (UNDERLINE | LETTER | NUMBER)*; 24 | 25 | //Tokens de operações aritméticas 26 | MUL : '*'; 27 | DIV : '/'; 28 | ADD : '+'; 29 | SUB : '-'; 30 | 31 | BLOCKCOMMENT : '/*' .*? '*/' -> skip; 32 | LINECOMMENT : '//' .*? '\n' -> skip; 33 | WS : [ \t\r\n]+ -> skip; -------------------------------------------------------------------------------- /antigo/ap2/antlr-test-grammar-tree-walking/lib/antlr-runtime-4.5.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr-test-grammar-tree-walking/lib/antlr-runtime-4.5.3.jar -------------------------------------------------------------------------------- /antigo/ap2/antlr-test-grammar-tree-walking/src/application/TreeWalkerApplicationVisitor.java: -------------------------------------------------------------------------------- 1 | package application; 2 | 3 | import java.io.IOException; 4 | import org.antlr.v4.runtime.*; 5 | import org.antlr.v4.runtime.tree.*; 6 | 7 | import autogenerated.*; 8 | import walker.TestExtendVisitor; 9 | 10 | 11 | 12 | public class TreeWalkerApplicationVisitor { 13 | public static ANTLRInputStream getStandardInputStream( ) throws IOException { 14 | return (new ANTLRInputStream(System.in)); 15 | } 16 | 17 | public static ANTLRInputStream getFileInputStream(String filePath) throws IOException { 18 | return (new ANTLRFileStream(filePath)); 19 | } 20 | 21 | public static void main(String[] args) throws IOException { 22 | //Create a CharStream that reads from standard input 23 | ANTLRInputStream input = getStandardInputStream( ); 24 | //Create a lexer that feeds off of input CharStream 25 | TestLexer lexer = new TestLexer(input); 26 | //Create a buffer of tokens pulled from the lexer 27 | CommonTokenStream tokens = new CommonTokenStream(lexer); 28 | //Create a parser that feeds off the tokens buffer 29 | TestParser parser = new TestParser(tokens); 30 | //Begin parsing at init rule 31 | ParseTree tree = parser.stat( ); 32 | 33 | //Create the visitor 34 | TestExtendVisitor visitor = new TestExtendVisitor( ); 35 | //Visit the tree created by the parser 36 | System.out.println(tree.accept(visitor)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.txt -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: antlr4-python3-runtime 3 | Version: 4.7.2 4 | Summary: ANTLR 4.7.2 runtime for Python 3.6.3 5 | Home-page: http://www.antlr.org 6 | Author: Eric Vergnaud, Terence Parr, Sam Harwell 7 | Author-email: eric.vergnaud@wanadoo.fr 8 | License: BSD 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/README.txt: -------------------------------------------------------------------------------- 1 | This is the Python 3.4 runtime for ANTLR. 2 | Visit the ANTLR web sites for more information: 3 | http://www.antlr.org 4 | https://raw.githubusercontent.com/antlr/antlr4/master/doc/python-target.md 5 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/RELEASE-4.5.txt: -------------------------------------------------------------------------------- 1 | What's in this release? 2 | 3 | - fixed bug where non-ascii input streams would fail 4 | - added support for visitor pattern 5 | - added support for wildcards in grammar 6 | 7 | Breaking change: 8 | 9 | In version 4.4, the parser/lexer had a tokenNames member. 10 | This has been removed in favor of the following members: 11 | - lexicalNames, containing the parsed text 12 | - symbolicNames, corresponding to tokenNames 13 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/setup.cfg: -------------------------------------------------------------------------------- 1 | [egg_info] 2 | tag_build = 3 | tag_date = 0 4 | 5 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name='antlr4-python3-runtime', 5 | version='4.7.2', 6 | packages=['antlr4', 'antlr4.atn', 'antlr4.dfa', 'antlr4.tree', 'antlr4.error', 'antlr4.xpath'], 7 | package_dir={'': 'src'}, 8 | install_requires=[ 9 | "typing ; python_version<'3.5'", 10 | ], 11 | url='http://www.antlr.org', 12 | license='BSD', 13 | author='Eric Vergnaud, Terence Parr, Sam Harwell', 14 | author_email='eric.vergnaud@wanadoo.fr', 15 | description='ANTLR 4.7.2 runtime for Python 3.6.3' 16 | ) 17 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/FileStream.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 3 | # Use of this file is governed by the BSD 3-clause license that 4 | # can be found in the LICENSE.txt file in the project root. 5 | # 6 | 7 | # 8 | # This is an InputStream that is loaded from a file all at once 9 | # when you construct the object. 10 | # 11 | 12 | import codecs 13 | import unittest 14 | from antlr4.InputStream import InputStream 15 | 16 | 17 | class FileStream(InputStream): 18 | 19 | def __init__(self, fileName:str, encoding:str='ascii', errors:str='strict'): 20 | super().__init__(self.readDataFrom(fileName, encoding, errors)) 21 | self.fileName = fileName 22 | 23 | def readDataFrom(self, fileName:str, encoding:str, errors:str='strict'): 24 | # read binary to avoid line ending conversion 25 | with open(fileName, 'rb') as file: 26 | bytes = file.read() 27 | return codecs.decode(bytes, encoding, errors) 28 | 29 | 30 | class TestFileStream(unittest.TestCase): 31 | 32 | def testStream(self): 33 | stream = FileStream(__file__) 34 | self.assertTrue(stream.size>0) 35 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/StdinStream.py: -------------------------------------------------------------------------------- 1 | import codecs 2 | import sys 3 | 4 | from antlr4.InputStream import InputStream 5 | 6 | 7 | class StdinStream(InputStream): 8 | def __init__(self, encoding:str='ascii', errors:str='strict') -> None: 9 | bytes = sys.stdin.buffer.read() 10 | data = codecs.decode(bytes, encoding, errors) 11 | super().__init__(data) 12 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/Utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | # 5 | 6 | from io import StringIO 7 | 8 | def str_list(val): 9 | with StringIO() as buf: 10 | buf.write('[') 11 | first = True 12 | for item in val: 13 | if not first: 14 | buf.write(', ') 15 | buf.write(str(item)) 16 | first = False 17 | buf.write(']') 18 | return buf.getvalue() 19 | 20 | def escapeWhitespace(s:str, escapeSpaces:bool): 21 | with StringIO() as buf: 22 | for c in s: 23 | if c==' ' and escapeSpaces: 24 | buf.write('\u00B7') 25 | elif c=='\t': 26 | buf.write("\\t") 27 | elif c=='\n': 28 | buf.write("\\n") 29 | elif c=='\r': 30 | buf.write("\\r") 31 | else: 32 | buf.write(c) 33 | return buf.getvalue() 34 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__init__.py: -------------------------------------------------------------------------------- 1 | from antlr4.Token import Token 2 | from antlr4.InputStream import InputStream 3 | from antlr4.FileStream import FileStream 4 | from antlr4.StdinStream import StdinStream 5 | from antlr4.BufferedTokenStream import TokenStream 6 | from antlr4.CommonTokenStream import CommonTokenStream 7 | from antlr4.Lexer import Lexer 8 | from antlr4.Parser import Parser 9 | from antlr4.dfa.DFA import DFA 10 | from antlr4.atn.ATN import ATN 11 | from antlr4.atn.ATNDeserializer import ATNDeserializer 12 | from antlr4.atn.LexerATNSimulator import LexerATNSimulator 13 | from antlr4.atn.ParserATNSimulator import ParserATNSimulator 14 | from antlr4.atn.PredictionMode import PredictionMode 15 | from antlr4.PredictionContext import PredictionContextCache 16 | from antlr4.ParserRuleContext import RuleContext, ParserRuleContext 17 | from antlr4.tree.Tree import ParseTreeListener, ParseTreeVisitor, ParseTreeWalker, TerminalNode, ErrorNode, RuleNode 18 | from antlr4.error.Errors import RecognitionException, IllegalStateException, NoViableAltException 19 | from antlr4.error.ErrorStrategy import BailErrorStrategy 20 | from antlr4.error.DiagnosticErrorListener import DiagnosticErrorListener 21 | from antlr4.Utils import str_list 22 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/BufferedTokenStream.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/BufferedTokenStream.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/CommonTokenFactory.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/CommonTokenFactory.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/CommonTokenStream.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/CommonTokenStream.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/FileStream.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/FileStream.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/InputStream.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/InputStream.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/IntervalSet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/IntervalSet.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/LL1Analyzer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/LL1Analyzer.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Lexer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Lexer.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/ListTokenSource.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/ListTokenSource.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Parser.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Parser.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/ParserRuleContext.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/ParserRuleContext.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/PredictionContext.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/PredictionContext.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Recognizer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Recognizer.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/RuleContext.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/RuleContext.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/StdinStream.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/StdinStream.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Token.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Token.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Utils.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/ATNDeserializationOptions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | 5 | # need a forward declaration 6 | ATNDeserializationOptions = None 7 | 8 | class ATNDeserializationOptions(object): 9 | 10 | defaultOptions = None 11 | 12 | def __init__(self, copyFrom:ATNDeserializationOptions = None): 13 | self.readOnly = False 14 | self.verifyATN = True if copyFrom is None else copyFrom.verifyATN 15 | self.generateRuleBypassTransitions = False if copyFrom is None else copyFrom.generateRuleBypassTransitions 16 | 17 | def __setattr__(self, key, value): 18 | if key!="readOnly" and self.readOnly: 19 | raise Exception("The object is read only.") 20 | super(type(self), self).__setattr__(key,value) 21 | 22 | ATNDeserializationOptions.defaultOptions = ATNDeserializationOptions() 23 | ATNDeserializationOptions.defaultOptions.readOnly = True 24 | 25 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/ATNType.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | #/ 5 | 6 | from enum import IntEnum 7 | 8 | # Represents the type of recognizer an ATN applies to. 9 | 10 | class ATNType(IntEnum): 11 | 12 | LEXER = 0 13 | PARSER = 1 14 | 15 | @classmethod 16 | def fromOrdinal(cls, i:int): 17 | return cls._value2member_map_[i] 18 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATN.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATN.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNConfig.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNConfig.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNConfigSet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNConfigSet.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNDeserializationOptions.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNDeserializationOptions.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNDeserializer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNDeserializer.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNSimulator.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNSimulator.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNState.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNState.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNType.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNType.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/LexerATNSimulator.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/LexerATNSimulator.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/LexerAction.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/LexerAction.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/LexerActionExecutor.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/LexerActionExecutor.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ParserATNSimulator.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ParserATNSimulator.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/PredictionMode.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/PredictionMode.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/SemanticContext.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/SemanticContext.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/Transition.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/Transition.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__pycache__/DFA.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__pycache__/DFA.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__pycache__/DFAState.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__pycache__/DFAState.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/error/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/DiagnosticErrorListener.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/DiagnosticErrorListener.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/ErrorListener.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/ErrorListener.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/ErrorStrategy.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/ErrorStrategy.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/Errors.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/Errors.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/Chunk.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 3 | # Use of this file is governed by the BSD 3-clause license that 4 | # can be found in the LICENSE.txt file in the project root. 5 | # 6 | 7 | class Chunk(object): 8 | pass 9 | 10 | class TagChunk(Chunk): 11 | 12 | def __init__(self, tag:str, label:str=None): 13 | self.tag = tag 14 | self.label = label 15 | 16 | def __str__(self): 17 | if self.label is None: 18 | return self.tag 19 | else: 20 | return self.label + ":" + self.tag 21 | 22 | class TextChunk(Chunk): 23 | 24 | def __init__(self, text:str): 25 | self.text = text 26 | 27 | def __str__(self): 28 | return "'" + self.text + "'" 29 | 30 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__init__.py -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/Chunk.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/Chunk.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/ParseTreePatternMatcher.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/ParseTreePatternMatcher.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/RuleTagToken.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/RuleTagToken.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/TokenTagToken.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/TokenTagToken.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/Tree.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/Tree.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/Trees.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/Trees.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4/xpath/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: antlr4-python3-runtime 3 | Version: 4.7.2 4 | Summary: ANTLR 4.7.2 runtime for Python 3.6.3 5 | Home-page: http://www.antlr.org 6 | Author: Eric Vergnaud, Terence Parr, Sam Harwell 7 | Author-email: eric.vergnaud@wanadoo.fr 8 | License: BSD 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | 2 | [:python_version < "3.5"] 3 | typing 4 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | antlr4 2 | -------------------------------------------------------------------------------- /antigo/ap2/antlr4-python3-runtime-4.7.2/src/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from antlr4 import * 3 | from autogen.TestLexer import TestLexer 4 | from autogen.TestParser import TestParser 5 | from autogen.TestExtendVisitor import TestExtendVisitor 6 | 7 | def main (argv): 8 | inpt = 0 if len(argv) <= 1 else argv[1] 9 | input_stream = FileStream(inpt) 10 | lexer = TestLexer(input_stream) 11 | stream = CommonTokenStream(lexer) 12 | parser = TestParser(stream) 13 | tree = parser.stat() 14 | visitor = TestExtendVisitor() 15 | visitor = tree.accept(visitor) 16 | 17 | if __name__ == '__main__': 18 | main(sys.argv) 19 | -------------------------------------------------------------------------------- /antigo/ap2/compiler/include/lexer.h: -------------------------------------------------------------------------------- 1 | #ifndef LEXER_HEADER 2 | #define LEXER_HEADER 3 | 4 | // structs prototypes 5 | typedef struct Token Token; 6 | 7 | struct Token { 8 | char *filename, *file_buffer, *buffpos, *start, *line_start; 9 | int length, line, column, line_span; // number of lines the token spans 10 | union { long int_value; double float_value; long id_hash; long type_type; }; 11 | int type; // type_type (one line above) = TYPE_INT or TYPE_FLOAT 12 | }; 13 | 14 | // function prototypes 15 | int next_token (Token *restrict token); 16 | char *strtoken (const Token *restrict token); 17 | char *strline (const Token *restrict token); 18 | int jenkins_hash (char *string, int length); 19 | 20 | enum TokenType { 21 | // '=' '+' '-' '/' '*' '{' '}' '(' ')' ';' ',' 22 | UNKNOWN = 0x80, // unrecognized character 23 | TYPE, // int, float, etc 24 | TYPE_INT, // int specifically 25 | TYPE_FLOAT, // float specifically 26 | IDENTIFIER, // variable or function name 27 | INTEGER, // integer number literal 28 | FLOAT, // floating point number literal 29 | STRING, // a string delimited by " " 30 | RETURN, // return 31 | }; 32 | 33 | #endif // LEXER_HEADER 34 | -------------------------------------------------------------------------------- /antigo/ap2/compiler/include/parser.h: -------------------------------------------------------------------------------- 1 | #ifndef PARSER_HEADER 2 | #define PARSER_HEADER 3 | 4 | #include "lexer.h" 5 | #include "ast.h" 6 | 7 | #define parse_expression(token) parse_expression_op(token, 0) 8 | 9 | // function prototypes 10 | AST *parse_file (const char *filename); 11 | AST *parse_declaration (Token *token); 12 | AST *parse_declaration_parameters (Token *token); 13 | AST *parse_expression_op (Token *token, int prev_op); 14 | AST *parse_statement (Token *token); 15 | 16 | #endif // PARSER_HEADER 17 | -------------------------------------------------------------------------------- /antigo/ap2/compiler/include/visitor.h: -------------------------------------------------------------------------------- 1 | #ifndef VISITOR_HEADER 2 | #define VISITOR_HEADER 3 | 4 | #include "ast.h" 5 | 6 | typedef struct ExprReturn ExprReturn; 7 | struct ExprReturn { 8 | union { 9 | long int_value; 10 | double float_value; 11 | }; 12 | int type; // TYPE_INT, TYPE_FLOAT 13 | }; 14 | 15 | void visit_file (AST *root); 16 | //void visit_global_var_decl (AST *ast); 17 | void visit_function_decl (AST *ast); 18 | void visit_block (AST *block, AST *param); 19 | void visit_stat (AST *stat); 20 | void visit_assign_stat (AST *assign); 21 | void visit_return_stat (AST *assign); 22 | void visit_var_decl (AST *ast); 23 | ExprReturn visit_expr (AST *expr); 24 | ExprReturn visit_add (AST *expr); 25 | ExprReturn visit_sub (AST *expr); 26 | ExprReturn visit_mul (AST *expr); 27 | ExprReturn visit_div (AST *expr); 28 | ExprReturn visit_id (AST *ast); 29 | ExprReturn visit_literal (AST *ast); 30 | ExprReturn visit_unary_minus (AST *ast); 31 | ExprReturn visit_function_call (AST *ast); 32 | 33 | #endif // VISITOR_HEADER 34 | -------------------------------------------------------------------------------- /antigo/ap2/compiler/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(shell uname -o),Msys) 2 | EXE = compiler.exe 3 | DBG = compiler_db.exe 4 | OUT = tmp.exe 5 | else 6 | EXE = compiler 7 | DBG = compiler_db 8 | OUT = tmp.out 9 | endif 10 | 11 | SOURCE = $(addprefix src/, lexer.c parser.c ast.c visitor.c main.c) 12 | HEADER = $(addprefix include/, lexer.h parser.h ast.h visitor.h) 13 | CFLAGS = -flto -Wall -Wno-parentheses -Wno-missing-braces -Wno-unused-variable -Wno-unused-but-set-variable -Iinclude 14 | .PHONY: clean 15 | 16 | release: $(EXE) 17 | debug: $(DBG) 18 | asm: compiler.s 19 | all: $(EXE) $(DBG) compiler.s tags 20 | 21 | $(EXE): $(SOURCE) $(HEADER) 22 | gcc $(SOURCE) -O2 $(CFLAGS) -o $@ 23 | 24 | $(DBG): $(SOURCE) $(HEADER) 25 | gcc $(SOURCE) -O0 -ggdb $(CFLAGS) -o $@ 26 | 27 | compiler.s: $(SOURCE) $(HEADER) 28 | gcc $(SOURCE) -Og -g $(CFLAGS) -o $(OUT) 29 | objdump -S -M intel $(OUT) > $@ 30 | rm $(OUT) 31 | 32 | tags: $(SOURCE) $(HEADER) 33 | ctags -R 34 | 35 | clean: 36 | -rm -f $(EXE) $(DBG) compiler.s 37 | -------------------------------------------------------------------------------- /antigo/ap2/compiler/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "parser.h" 4 | #include "visitor.h" 5 | 6 | #define err(...) fprintf(stderr, __VA_ARGS__) 7 | 8 | int main (int argc, char **argv) { 9 | if (argc < 2) { 10 | err("error: input file missing\n"); 11 | exit(-1); 12 | } 13 | AST *root; 14 | 15 | init_memory(); 16 | root = parse_file(argv[1]); 17 | if (!root) exit(-1); 18 | visit_file(root); 19 | return 0; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /antigo/ap2/compiler/test_error.c: -------------------------------------------------------------------------------- 1 | int var1 = 0; 2 | int teste1=linha2coluna8_24; 3 | int teste2 = linha3coluna10_27/linha3coluna28_45; 4 | int teste3 = 1 + linha4coluna21_38; 5 | 6 | 7 | int teste4 = linha7coluna10_27 * ( 1 - linha7coluna36_53); 8 | int divideByZero = 2/var1; 9 | -------------------------------------------------------------------------------- /antigo/ap2/compiler/test_ok.c: -------------------------------------------------------------------------------- 1 | /* 2 | int main (int a, int b) { 3 | //#define INHAME 3 4 | // inhame 5 | int _a12_boi = 5 * arroz + 3 - nado; 6 | //printf("hello, \"my\" wo\ 7 | rld!\n"); // hue 8 | //float _a12_boi, arroz = 3.3, pizza, nado = 1; 9 | int b = -1; 10 | play(); 11 | sum(1, boi(sqrt(3), azul(3, 1+1)), -1, 4*3*-(-2), 5); 12 | 13 | //no hablo 14 | //espanhol 15 | 16 | return 0; 17 | } 18 | */ 19 | 20 | int a = 3 * 5 - 2 + 1; 21 | int b = -4 + a * 3; 22 | int c = a / b * - 1; 23 | int d = c * a + b / c - a; 24 | int e = a - b + c * -d; 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /antigo/ap2/grammars/Test.g4: -------------------------------------------------------------------------------- 1 | grammar Test; 2 | 3 | stat : ((attrStmt | expr) ';')+ EOF? #Expressions 4 | ; 5 | 6 | attrStmt: ID '=' expr #Assign 7 | ; 8 | 9 | expr : expr op=('*'|'/') expr #MultDiv 10 | | expr op=('+'|'-') expr #AddSub 11 | | INT #Int 12 | | ID #Identifier 13 | | '(' expr ')' #Paren 14 | ; 15 | 16 | //Fragmentos (Não constituem tokens por si só) 17 | fragment NUMBER: [0-9]; 18 | fragment LETTER: [a-zA-Z]; 19 | fragment UNDERLINE: '_'; 20 | 21 | //Tokens 22 | INT : NUMBER+ ; 23 | ID : (UNDERLINE | LETTER) (UNDERLINE | LETTER | NUMBER)*; 24 | 25 | //Tokens de operações aritméticas 26 | MUL : '*'; 27 | DIV : '/'; 28 | ADD : '+'; 29 | SUB : '-'; 30 | 31 | BLOCKCOMMENT : '/*' .*? '*/' -> skip; 32 | LINECOMMENT : '//' .*? '\n' -> skip; 33 | WS : [ \t\r\n]+ -> skip; -------------------------------------------------------------------------------- /antigo/ap3/Aula Prática 3 (Análise Semântica com ANTLR4).pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/Aula Prática 3 (Análise Semântica com ANTLR4).pptx -------------------------------------------------------------------------------- /antigo/ap3/antlr-4.7.2-complete.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr-4.7.2-complete.jar -------------------------------------------------------------------------------- /antigo/ap3/antlr-cymbol-grammar-checker-types/Cymbol.tokens: -------------------------------------------------------------------------------- 1 | TYPEINT=1 2 | TYPEVOID=2 3 | IF=3 4 | ELSE=4 5 | RETURN=5 6 | LP=6 7 | RP=7 8 | COMMA=8 9 | SEMICOLON=9 10 | LB=10 11 | RB=11 12 | AS=12 13 | EQ=13 14 | NE=14 15 | NOT=15 16 | GT=16 17 | LT=17 18 | GE=18 19 | LE=19 20 | MUL=20 21 | DIV=21 22 | PLUS=22 23 | MINUS=23 24 | ID=24 25 | INT=25 26 | BLOCKCOMMENT=26 27 | LINECOMMENT=27 28 | WS=28 29 | 'int'=1 30 | 'void'=2 31 | 'if'=3 32 | 'else'=4 33 | 'return'=5 34 | '('=6 35 | ')'=7 36 | ','=8 37 | ';'=9 38 | '{'=10 39 | '}'=11 40 | '='=12 41 | '=='=13 42 | '!='=14 43 | '!'=15 44 | '>'=16 45 | '<'=17 46 | '>='=18 47 | '<='=19 48 | '*'=20 49 | '/'=21 50 | '+'=22 51 | '-'=23 52 | -------------------------------------------------------------------------------- /antigo/ap3/antlr-cymbol-grammar-checker-types/CymbolLexer.tokens: -------------------------------------------------------------------------------- 1 | TYPEINT=1 2 | TYPEVOID=2 3 | IF=3 4 | ELSE=4 5 | RETURN=5 6 | LP=6 7 | RP=7 8 | COMMA=8 9 | SEMICOLON=9 10 | LB=10 11 | RB=11 12 | AS=12 13 | EQ=13 14 | NE=14 15 | NOT=15 16 | GT=16 17 | LT=17 18 | GE=18 19 | LE=19 20 | MUL=20 21 | DIV=21 22 | PLUS=22 23 | MINUS=23 24 | ID=24 25 | INT=25 26 | BLOCKCOMMENT=26 27 | LINECOMMENT=27 28 | WS=28 29 | 'int'=1 30 | 'void'=2 31 | 'if'=3 32 | 'else'=4 33 | 'return'=5 34 | '('=6 35 | ')'=7 36 | ','=8 37 | ';'=9 38 | '{'=10 39 | '}'=11 40 | '='=12 41 | '=='=13 42 | '!='=14 43 | '!'=15 44 | '>'=16 45 | '<'=17 46 | '>='=18 47 | '<='=19 48 | '*'=20 49 | '/'=21 50 | '+'=22 51 | '-'=23 52 | -------------------------------------------------------------------------------- /antigo/ap3/antlr-cymbol-grammar-checker-types/_classpath.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /antigo/ap3/antlr-cymbol-grammar-checker-types/_project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ANTLR-Cymbol-Grammar-Checker-Types 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /antigo/ap3/antlr-cymbol-grammar-checker-types/lib/antlr-runtime-4.5.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr-cymbol-grammar-checker-types/lib/antlr-runtime-4.5.3.jar -------------------------------------------------------------------------------- /antigo/ap3/antlr-cymbol-grammar-checker-types/src/application/CheckerTypesApplicationVisitor.java: -------------------------------------------------------------------------------- 1 | package application; 2 | 3 | import java.io.IOException; 4 | import org.antlr.v4.runtime.*; 5 | import org.antlr.v4.runtime.tree.*; 6 | 7 | import autogenerated.*; 8 | import walker.CymbolCheckerVisitor; 9 | 10 | 11 | 12 | public class CheckerTypesApplicationVisitor { 13 | public static ANTLRInputStream getStandardInputStream( ) throws IOException { 14 | return (new ANTLRInputStream(System.in)); 15 | } 16 | 17 | public static ANTLRInputStream getFileInputStream(String filePath) throws IOException { 18 | return (new ANTLRFileStream(filePath)); 19 | } 20 | 21 | public static void main(String[] args) throws IOException { 22 | ANTLRInputStream input = getStandardInputStream( ); 23 | CymbolLexer lexer = new CymbolLexer(input); 24 | CommonTokenStream tokens = new CommonTokenStream(lexer); 25 | CymbolParser parser = new CymbolParser(tokens); 26 | ParseTree tree = parser.file( ); 27 | 28 | CymbolCheckerVisitor visitor = new CymbolCheckerVisitor( ); 29 | tree.accept(visitor); 30 | 31 | System.out.println("Checagem de tipos encerrada com sucesso!"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /antigo/ap3/antlr-cymbol-grammar-checker-types/src/walker/Type.java: -------------------------------------------------------------------------------- 1 | package walker; 2 | 3 | public enum Type { 4 | INT, VOID 5 | } 6 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.txt -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: antlr4-python3-runtime 3 | Version: 4.7.2 4 | Summary: ANTLR 4.7.2 runtime for Python 3.6.3 5 | Home-page: http://www.antlr.org 6 | Author: Eric Vergnaud, Terence Parr, Sam Harwell 7 | Author-email: eric.vergnaud@wanadoo.fr 8 | License: BSD 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/README.txt: -------------------------------------------------------------------------------- 1 | This is the Python 3.4 runtime for ANTLR. 2 | Visit the ANTLR web sites for more information: 3 | http://www.antlr.org 4 | https://raw.githubusercontent.com/antlr/antlr4/master/doc/python-target.md 5 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/RELEASE-4.5.txt: -------------------------------------------------------------------------------- 1 | What's in this release? 2 | 3 | - fixed bug where non-ascii input streams would fail 4 | - added support for visitor pattern 5 | - added support for wildcards in grammar 6 | 7 | Breaking change: 8 | 9 | In version 4.4, the parser/lexer had a tokenNames member. 10 | This has been removed in favor of the following members: 11 | - lexicalNames, containing the parsed text 12 | - symbolicNames, corresponding to tokenNames 13 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/setup.cfg: -------------------------------------------------------------------------------- 1 | [egg_info] 2 | tag_build = 3 | tag_date = 0 4 | 5 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name='antlr4-python3-runtime', 5 | version='4.7.2', 6 | packages=['antlr4', 'antlr4.atn', 'antlr4.dfa', 'antlr4.tree', 'antlr4.error', 'antlr4.xpath'], 7 | package_dir={'': 'src'}, 8 | install_requires=[ 9 | "typing ; python_version<'3.5'", 10 | ], 11 | url='http://www.antlr.org', 12 | license='BSD', 13 | author='Eric Vergnaud, Terence Parr, Sam Harwell', 14 | author_email='eric.vergnaud@wanadoo.fr', 15 | description='ANTLR 4.7.2 runtime for Python 3.6.3' 16 | ) 17 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/FileStream.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 3 | # Use of this file is governed by the BSD 3-clause license that 4 | # can be found in the LICENSE.txt file in the project root. 5 | # 6 | 7 | # 8 | # This is an InputStream that is loaded from a file all at once 9 | # when you construct the object. 10 | # 11 | 12 | import codecs 13 | import unittest 14 | from antlr4.InputStream import InputStream 15 | 16 | 17 | class FileStream(InputStream): 18 | 19 | def __init__(self, fileName:str, encoding:str='ascii', errors:str='strict'): 20 | super().__init__(self.readDataFrom(fileName, encoding, errors)) 21 | self.fileName = fileName 22 | 23 | def readDataFrom(self, fileName:str, encoding:str, errors:str='strict'): 24 | # read binary to avoid line ending conversion 25 | with open(fileName, 'rb') as file: 26 | bytes = file.read() 27 | return codecs.decode(bytes, encoding, errors) 28 | 29 | 30 | class TestFileStream(unittest.TestCase): 31 | 32 | def testStream(self): 33 | stream = FileStream(__file__) 34 | self.assertTrue(stream.size>0) 35 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/StdinStream.py: -------------------------------------------------------------------------------- 1 | import codecs 2 | import sys 3 | 4 | from antlr4.InputStream import InputStream 5 | 6 | 7 | class StdinStream(InputStream): 8 | def __init__(self, encoding:str='ascii', errors:str='strict') -> None: 9 | bytes = sys.stdin.buffer.read() 10 | data = codecs.decode(bytes, encoding, errors) 11 | super().__init__(data) 12 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/Utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | # 5 | 6 | from io import StringIO 7 | 8 | def str_list(val): 9 | with StringIO() as buf: 10 | buf.write('[') 11 | first = True 12 | for item in val: 13 | if not first: 14 | buf.write(', ') 15 | buf.write(str(item)) 16 | first = False 17 | buf.write(']') 18 | return buf.getvalue() 19 | 20 | def escapeWhitespace(s:str, escapeSpaces:bool): 21 | with StringIO() as buf: 22 | for c in s: 23 | if c==' ' and escapeSpaces: 24 | buf.write('\u00B7') 25 | elif c=='\t': 26 | buf.write("\\t") 27 | elif c=='\n': 28 | buf.write("\\n") 29 | elif c=='\r': 30 | buf.write("\\r") 31 | else: 32 | buf.write(c) 33 | return buf.getvalue() 34 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__init__.py: -------------------------------------------------------------------------------- 1 | from antlr4.Token import Token 2 | from antlr4.InputStream import InputStream 3 | from antlr4.FileStream import FileStream 4 | from antlr4.StdinStream import StdinStream 5 | from antlr4.BufferedTokenStream import TokenStream 6 | from antlr4.CommonTokenStream import CommonTokenStream 7 | from antlr4.Lexer import Lexer 8 | from antlr4.Parser import Parser 9 | from antlr4.dfa.DFA import DFA 10 | from antlr4.atn.ATN import ATN 11 | from antlr4.atn.ATNDeserializer import ATNDeserializer 12 | from antlr4.atn.LexerATNSimulator import LexerATNSimulator 13 | from antlr4.atn.ParserATNSimulator import ParserATNSimulator 14 | from antlr4.atn.PredictionMode import PredictionMode 15 | from antlr4.PredictionContext import PredictionContextCache 16 | from antlr4.ParserRuleContext import RuleContext, ParserRuleContext 17 | from antlr4.tree.Tree import ParseTreeListener, ParseTreeVisitor, ParseTreeWalker, TerminalNode, ErrorNode, RuleNode 18 | from antlr4.error.Errors import RecognitionException, IllegalStateException, NoViableAltException 19 | from antlr4.error.ErrorStrategy import BailErrorStrategy 20 | from antlr4.error.DiagnosticErrorListener import DiagnosticErrorListener 21 | from antlr4.Utils import str_list 22 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/BufferedTokenStream.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/BufferedTokenStream.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/CommonTokenFactory.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/CommonTokenFactory.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/CommonTokenStream.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/CommonTokenStream.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/FileStream.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/FileStream.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/InputStream.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/InputStream.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/IntervalSet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/IntervalSet.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/LL1Analyzer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/LL1Analyzer.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Lexer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Lexer.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/ListTokenSource.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/ListTokenSource.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Parser.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Parser.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/ParserRuleContext.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/ParserRuleContext.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/PredictionContext.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/PredictionContext.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Recognizer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Recognizer.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/RuleContext.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/RuleContext.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/StdinStream.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/StdinStream.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Token.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Token.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/Utils.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/ATNDeserializationOptions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | 5 | # need a forward declaration 6 | ATNDeserializationOptions = None 7 | 8 | class ATNDeserializationOptions(object): 9 | 10 | defaultOptions = None 11 | 12 | def __init__(self, copyFrom:ATNDeserializationOptions = None): 13 | self.readOnly = False 14 | self.verifyATN = True if copyFrom is None else copyFrom.verifyATN 15 | self.generateRuleBypassTransitions = False if copyFrom is None else copyFrom.generateRuleBypassTransitions 16 | 17 | def __setattr__(self, key, value): 18 | if key!="readOnly" and self.readOnly: 19 | raise Exception("The object is read only.") 20 | super(type(self), self).__setattr__(key,value) 21 | 22 | ATNDeserializationOptions.defaultOptions = ATNDeserializationOptions() 23 | ATNDeserializationOptions.defaultOptions.readOnly = True 24 | 25 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/ATNType.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 2 | # Use of this file is governed by the BSD 3-clause license that 3 | # can be found in the LICENSE.txt file in the project root. 4 | #/ 5 | 6 | from enum import IntEnum 7 | 8 | # Represents the type of recognizer an ATN applies to. 9 | 10 | class ATNType(IntEnum): 11 | 12 | LEXER = 0 13 | PARSER = 1 14 | 15 | @classmethod 16 | def fromOrdinal(cls, i:int): 17 | return cls._value2member_map_[i] 18 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATN.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATN.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNConfig.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNConfig.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNConfigSet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNConfigSet.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNDeserializationOptions.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNDeserializationOptions.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNDeserializer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNDeserializer.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNSimulator.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNSimulator.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNState.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNState.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNType.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ATNType.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/LexerATNSimulator.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/LexerATNSimulator.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/LexerAction.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/LexerAction.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/LexerActionExecutor.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/LexerActionExecutor.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ParserATNSimulator.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/ParserATNSimulator.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/PredictionMode.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/PredictionMode.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/SemanticContext.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/SemanticContext.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/Transition.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/Transition.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/atn/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__pycache__/DFA.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__pycache__/DFA.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__pycache__/DFAState.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__pycache__/DFAState.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/dfa/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/error/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/DiagnosticErrorListener.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/DiagnosticErrorListener.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/ErrorListener.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/ErrorListener.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/ErrorStrategy.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/ErrorStrategy.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/Errors.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/Errors.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/error/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/Chunk.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. 3 | # Use of this file is governed by the BSD 3-clause license that 4 | # can be found in the LICENSE.txt file in the project root. 5 | # 6 | 7 | class Chunk(object): 8 | pass 9 | 10 | class TagChunk(Chunk): 11 | 12 | def __init__(self, tag:str, label:str=None): 13 | self.tag = tag 14 | self.label = label 15 | 16 | def __str__(self): 17 | if self.label is None: 18 | return self.tag 19 | else: 20 | return self.label + ":" + self.tag 21 | 22 | class TextChunk(Chunk): 23 | 24 | def __init__(self, text:str): 25 | self.text = text 26 | 27 | def __str__(self): 28 | return "'" + self.text + "'" 29 | 30 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__init__.py -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/Chunk.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/Chunk.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/ParseTreePatternMatcher.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/ParseTreePatternMatcher.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/RuleTagToken.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/RuleTagToken.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/TokenTagToken.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/TokenTagToken.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/Tree.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/Tree.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/Trees.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/Trees.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/tree/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4/xpath/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'ericvergnaud' 2 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: antlr4-python3-runtime 3 | Version: 4.7.2 4 | Summary: ANTLR 4.7.2 runtime for Python 3.6.3 5 | Home-page: http://www.antlr.org 6 | Author: Eric Vergnaud, Terence Parr, Sam Harwell 7 | Author-email: eric.vergnaud@wanadoo.fr 8 | License: BSD 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | 2 | [:python_version < "3.5"] 3 | typing 4 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/antlr4_python3_runtime.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | antlr4 2 | -------------------------------------------------------------------------------- /antigo/ap3/antlr4-python3-runtime-4.7.2/src/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from antlr4 import * 3 | from autogen.CymbolLexer import CymbolLexer 4 | from autogen.CymbolParser import CymbolParser 5 | from autogen.CymbolCheckerVisitor import CymbolCheckerVisitor 6 | 7 | def main (argv): 8 | inpt = 0 if len(argv) <= 1 else argv[1] 9 | input_stream = FileStream(inpt) 10 | lexer = CymbolLexer(input_stream) 11 | stream = CommonTokenStream(lexer) 12 | parser = CymbolParser(stream) 13 | tree = parser.fiile() 14 | visitor = CymbolCheckerVisitor() 15 | visitor = tree.accept(visitor) 16 | 17 | if __name__ == '__main__': 18 | main(sys.argv) 19 | -------------------------------------------------------------------------------- /antigo/ap3/compiler/include/parser.h: -------------------------------------------------------------------------------- 1 | #ifndef PARSER_HEADER 2 | #define PARSER_HEADER 3 | 4 | #include "lexer.h" 5 | #include "ast.h" 6 | 7 | #define parse_expression(token) parse_expression_op(token, 0) 8 | 9 | // function prototypes 10 | AST *parse_file (const char *filename); 11 | AST *parse_declaration (Token *token); 12 | AST *parse_declaration_parameters (Token *token); 13 | AST *parse_expression_op (Token *token, int prev_op); 14 | AST *parse_statement (Token *token); 15 | 16 | #endif // PARSER_HEADER 17 | -------------------------------------------------------------------------------- /antigo/ap3/compiler/include/visitor.h: -------------------------------------------------------------------------------- 1 | #ifndef VISITOR_HEADER 2 | #define VISITOR_HEADER 3 | 4 | #include "ast.h" 5 | 6 | typedef struct ExprReturn ExprReturn; 7 | struct ExprReturn { 8 | union { 9 | long int_value; 10 | double float_value; 11 | }; 12 | int type; // TYPE_INT, TYPE_FLOAT 13 | }; 14 | 15 | void visit_file (AST *root); 16 | //void visit_global_var_decl (AST *ast); 17 | ExprReturn visit_stat (AST *stat); 18 | ExprReturn visit_return_stat (AST *assign); 19 | void visit_assign_stat (AST *assign); 20 | void visit_var_decl (AST *ast); 21 | void visit_function_decl (AST *ast); 22 | ExprReturn visit_block (AST *block, AST *params, int return_type); 23 | ExprReturn visit_expr (AST *expr); 24 | ExprReturn visit_add (AST *expr); 25 | ExprReturn visit_sub (AST *expr); 26 | ExprReturn visit_mul (AST *expr); 27 | ExprReturn visit_div (AST *expr); 28 | ExprReturn visit_mod (AST *expr); 29 | ExprReturn visit_id (AST *ast); 30 | ExprReturn visit_literal (AST *ast); 31 | ExprReturn visit_unary_minus (AST *ast); 32 | ExprReturn visit_function_call (AST *ast); 33 | 34 | #endif // VISITOR_HEADER 35 | -------------------------------------------------------------------------------- /antigo/ap3/compiler/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(shell uname -o),Msys) 2 | EXE = compiler.exe 3 | DBG = compiler_db.exe 4 | OUT = tmp.exe 5 | else 6 | EXE = compiler 7 | DBG = compiler_db 8 | OUT = tmp.out 9 | endif 10 | 11 | SOURCE = $(addprefix src/, lexer.c parser.c ast.c visitor.c main.c) 12 | HEADER = $(addprefix include/, lexer.h parser.h ast.h visitor.h) 13 | CFLAGS = -flto -Wall -Wno-parentheses -Wno-missing-braces -Wno-unused-variable -Wno-unused-but-set-variable -Iinclude 14 | .PHONY: clean 15 | 16 | release: $(EXE) 17 | debug: $(DBG) 18 | asm: compiler.s 19 | all: tags $(EXE) $(DBG) compiler.s 20 | 21 | $(EXE): $(SOURCE) $(HEADER) 22 | gcc $(SOURCE) -O2 $(CFLAGS) -o $@ 23 | 24 | $(DBG): $(SOURCE) $(HEADER) 25 | gcc $(SOURCE) -O0 -ggdb $(CFLAGS) -o $@ 26 | 27 | compiler.s: $(SOURCE) $(HEADER) 28 | gcc $(SOURCE) -Og -g $(CFLAGS) -o $(OUT) 29 | objdump -S -M intel $(OUT) > $@ 30 | rm $(OUT) 31 | 32 | tags: $(SOURCE) $(HEADER) 33 | ctags -R 34 | 35 | clean: 36 | -rm -f $(EXE) $(DBG) compiler.s 37 | -------------------------------------------------------------------------------- /antigo/ap3/compiler/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "parser.h" 4 | #include "visitor.h" 5 | 6 | #define err(...) fprintf(stderr, __VA_ARGS__) 7 | 8 | int main (int argc, char **argv) { 9 | if (argc < 2) { 10 | err("error: input file missing\n"); 11 | exit(-1); 12 | } 13 | AST *root; 14 | 15 | init_memory(); 16 | root = parse_file(argv[1]); 17 | if (!root) exit(-1); 18 | visit_file(root); 19 | return 0; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /antigo/ap3/compiler/test_error.c: -------------------------------------------------------------------------------- 1 | // nenhum operando de '%' pode ser float 2 | // int se converte para float, e vice-versa 3 | // string não pode ser operando de qualquer operador 4 | // o typo retornado por return deve ser o mesmo declarado para a função 5 | // função sem retorno ou com retorno sem expressão é void 6 | // variáveis devem ser declaradas antes de ser usadas 7 | /* 8 | em caso de algum erro acima, imprimir: 9 | "nome_do_arquivo:número_da_linha:número_da_coluna: semantic error: mensagem_opcional 10 | número_da_linha | linha" 11 | */ 12 | 13 | 14 | void empty () { 15 | return; 16 | } 17 | 18 | int function (int a, int b) { 19 | int c = a % b; 20 | b = -a * (b + c); // b = "oi" * 3; 21 | return c - b/2; // return 3.5; 22 | } 23 | 24 | float aster (float red, float green, float blue) { 25 | float bright = 0.3 * red + 0.5 * green + 0.2 * blue; 26 | red = red / bright; 27 | green = green / (bright * bright); // green = bright * (arroz - 3.5); 28 | blue = (1 - blue) / bright; // blue = blue % bright; 29 | return red + green + blue; // comente esta linha 30 | } 31 | 32 | int main () { 33 | float color = aster(0.5, 0.2, 1) * 3.14159265; 34 | return moi(1, 2); 35 | } 36 | -------------------------------------------------------------------------------- /antigo/ap3/compiler/test_ok.c: -------------------------------------------------------------------------------- 1 | 2 | int main (int a, int b) { 3 | //#define INHAME 3 4 | // inhame 5 | int _a12_boi = 5 * arroz + 3 - nado; 6 | //printf("hello, \"my\" wo\ 7 | rld!\n"); // hue 8 | //float _a12_boi, arroz = 3.3, pizza, nado = 1; 9 | int b = -1; 10 | play(); 11 | sum(1, boi(sqrt(3), azul(3, 1+1)), -1, 4*3*-(-2), 5); 12 | 13 | //no hablo 14 | //espanhol 15 | 16 | return 0; 17 | } 18 | 19 | 20 | int a = -3 * (5 - 2) + 1; 21 | int b = +1; 22 | int b = -4 + a * 3; 23 | int c = a / b * - 1; 24 | int d = c * a + b / c - a; 25 | int e = a - b + c * -d; 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /antigo/mini-projeto/Mini Projeto.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/mini-projeto/Mini Projeto.pdf -------------------------------------------------------------------------------- /antigo/mini-projeto/antlr-4.7.1-complete.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/mini-projeto/antlr-4.7.1-complete.jar -------------------------------------------------------------------------------- /antigo/mini-projeto/compiler/compiler: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/mini-projeto/compiler/compiler -------------------------------------------------------------------------------- /antigo/mini-projeto/compiler/include/parser.h: -------------------------------------------------------------------------------- 1 | #ifndef PARSER_HEADER 2 | #define PARSER_HEADER 3 | 4 | #include "lexer.h" 5 | #include "ast.h" 6 | 7 | #define parse_expression(token) parse_expression_op(token, 0) 8 | 9 | // function prototypes 10 | AST *parse_file (const char *filename); 11 | AST *parse_declaration (Token *token); 12 | AST *parse_declaration_parameters (Token *token); 13 | AST *parse_expression_op (Token *token, int prev_op); 14 | AST *parse_statement (Token *token); 15 | 16 | #endif // PARSER_HEADER 17 | -------------------------------------------------------------------------------- /antigo/mini-projeto/compiler/include/visitor.h: -------------------------------------------------------------------------------- 1 | #ifndef VISITOR_HEADER 2 | #define VISITOR_HEADER 3 | 4 | #include "ast.h" 5 | 6 | enum ExprResultType { 7 | LLIR_REGISTER, 8 | INTEGER_CONSTANT, 9 | FLOAT_CONSTANT, 10 | }; 11 | 12 | typedef struct ExprResult ExprResult; 13 | struct ExprResult { 14 | union { 15 | long int_value; 16 | double float_value; 17 | long ssa_register; 18 | }; 19 | int type; // enum ExprResultType 20 | }; 21 | 22 | void visit_file (AST *root); 23 | //void visit_global_var_decl (AST *ast); 24 | ExprResult visit_stat (AST *stat); 25 | ExprResult visit_return_stat (AST *assign); 26 | void visit_assign_stat (AST *assign); 27 | void visit_var_decl (AST *ast); 28 | void visit_function_decl (AST *ast); 29 | ExprResult visit_stat_block (AST *stat_block, AST *params, int return_type); 30 | ExprResult visit_expr (AST *expr); 31 | ExprResult visit_add (AST *expr); 32 | ExprResult visit_sub (AST *expr); 33 | ExprResult visit_mul (AST *expr); 34 | ExprResult visit_div (AST *expr); 35 | ExprResult visit_mod (AST *expr); 36 | ExprResult visit_id (AST *ast); 37 | ExprResult visit_literal (AST *ast); 38 | ExprResult visit_unary_minus (AST *ast); 39 | ExprResult visit_function_call (AST *ast); 40 | 41 | #endif // VISITOR_HEADER 42 | -------------------------------------------------------------------------------- /antigo/mini-projeto/compiler/makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(shell uname -o),Msys) 2 | EXE = compiler.exe 3 | DBG = compiler_db.exe 4 | OUT = tmp.exe 5 | else 6 | EXE = compiler 7 | DBG = compiler_db 8 | OUT = tmp.out 9 | endif 10 | 11 | SOURCE = $(addprefix src/, lexer.c parser.c ast.c visitor.c main.c) 12 | HEADER = $(addprefix include/, lexer.h parser.h ast.h visitor.h) 13 | CFLAGS = -flto -Wall -Wno-parentheses -Wno-missing-braces -Wno-unused-variable -Wno-unused-but-set-variable -Iinclude 14 | .PHONY: clean 15 | 16 | release: $(EXE) 17 | debug: $(DBG) 18 | asm: compiler.s 19 | all: tags $(EXE) $(DBG) compiler.s 20 | 21 | $(EXE): $(SOURCE) $(HEADER) 22 | gcc $(SOURCE) -O2 $(CFLAGS) -o $@ 23 | 24 | $(DBG): $(SOURCE) $(HEADER) 25 | gcc $(SOURCE) -O0 -ggdb $(CFLAGS) -o $@ 26 | 27 | compiler.s: $(SOURCE) $(HEADER) 28 | gcc $(SOURCE) -Og -g $(CFLAGS) -o $(OUT) 29 | objdump -S -M intel $(OUT) > $@ 30 | rm $(OUT) 31 | 32 | tags: $(SOURCE) $(HEADER) 33 | ctags -R 34 | 35 | clean: 36 | -rm -f $(EXE) $(DBG) compiler.s 37 | 38 | # cmder --------> https://drive.google.com/open?id=1PcQKZ8zy39hncqWdpeBO29BH92W-QJdi 39 | # llvm linux ---> http://releases.llvm.org/download.html 40 | # llvm windows -> https://drive.google.com/open?id=1-dPZllaoHmC2DSHMjSZn5tYAY6RnKE4y 41 | -------------------------------------------------------------------------------- /antigo/mini-projeto/compiler/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "parser.h" 4 | #include "visitor.h" 5 | 6 | #define err(...) fprintf(stderr, __VA_ARGS__) 7 | 8 | int main (int argc, char **argv) { 9 | if (argc < 2) { 10 | err("error: missing input file\n"); 11 | exit(-1); 12 | } 13 | AST *root; 14 | 15 | init_memory(); 16 | root = parse_file(argv[1]); 17 | if (!root) exit(-1); 18 | visit_file(root); 19 | return 0; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /antigo/mini-projeto/compiler/test.c: -------------------------------------------------------------------------------- 1 | int nom_nom = 88; 2 | int arroz; 3 | 4 | int aqua_baldo () { 5 | int a0 = 32 * 5; 6 | int a1 = a0 % 11 - 2 ; 7 | int a2 = 11 % (6 + a1); 8 | return (1 - a0) + a1 % a2; 9 | } 10 | 11 | int function7 (int a, int b) { 12 | int c = a % b; 13 | b = -a * (b + c); 14 | return c - b/2; 15 | } 16 | 17 | void kk (int hh) { 18 | arroz = hh / 2; 19 | } 20 | 21 | int aster (int red, int green, int blue) { 22 | int bright = (3 * red + 5 * green + 2 * blue) / 10; 23 | red = 255 * red / bright; 24 | green = 255 * green / bright; 25 | blue = 255 * (blue - 127) / bright; 26 | return red + green + blue; 27 | } 28 | 29 | int main () { 30 | int hmm; 31 | int color = aster(123, 111, 240); 32 | nom_nom = aqua_baldo(); 33 | kk(color); 34 | hmm = function7(7, 38) - arroz; 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /antigo/mini-projeto/especificação.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/antigo/mini-projeto/especificação.pdf -------------------------------------------------------------------------------- /demos/asm/genAgent: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source common 4 | 5 | (cd ${CURRDIR}/bin; 6 | find . -name "*.class" | \ 7 | grep "instr" | \ 8 | xargs jar cvfm ${CURRDIR}/iagent.jar ${CURRDIR}/manifest.mf 9 | ) 10 | 11 | -------------------------------------------------------------------------------- /demos/asm/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Premain-Class: instr.agent.InstrumentationAgent 3 | Created-By: 1.6.0_06 (Sun Microsystems Inc.) 4 | -------------------------------------------------------------------------------- /demos/asm/run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source common 4 | 5 | java -cp $CLASSPATH \ 6 | -javaagent:iagent.jar \ 7 | instr.Wrapper examples.Foo -------------------------------------------------------------------------------- /demos/asm/src/examples/Foo.java: -------------------------------------------------------------------------------- 1 | package examples; 2 | 3 | public class Foo { 4 | 5 | public static void main(String[] args) { 6 | bar(); 7 | } 8 | 9 | static void bar() { 10 | throw new RuntimeException(); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /demos/asm/src/instr/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 43 4 | /svn/!svn/ver/865/trunk/randoop/src/callret 5 | END 6 | Util.java 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 53 10 | /svn/!svn/ver/865/trunk/randoop/src/callret/Util.java 11 | END 12 | -------------------------------------------------------------------------------- /demos/asm/src/instr/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 1153 5 | https://spl-project.googlecode.com/svn/trunk/randoop/src/callret 6 | https://spl-project.googlecode.com/svn 7 | 8 | 9 | 10 | 2012-10-24T18:30:55.950123Z 11 | 865 12 | MateusAraujoBorges@gmail.com 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | c47ebb53-d014-72c6-ed2e-044e009d6a56 28 | 29 | instrumentation 30 | dir 31 | 32 | Util.java 33 | file 34 | 35 | 36 | 37 | 38 | 2012-10-24T22:24:29.871788Z 39 | 9d08f46fe294a3cedb34d1bd4d5e0ae9 40 | 2012-10-24T18:30:55.950123Z 41 | 865 42 | MateusAraujoBorges@gmail.com 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 3590 65 | 66 | agent 67 | dir 68 | 69 | -------------------------------------------------------------------------------- /demos/asm/src/instr/Wrapper.java: -------------------------------------------------------------------------------- 1 | package instr; 2 | 3 | import instr.agent.InstrumentationState; 4 | 5 | import java.lang.reflect.InvocationTargetException; 6 | import java.lang.reflect.Method; 7 | 8 | /** 9 | * This is a wrapper class for calling the 10 | * main method on the instrumented class. 11 | * 12 | * The only reason we need this is to have 13 | * the chance to access the instrumentation 14 | * state before the VM shuts down. 15 | * 16 | * 17 | * @author damorim 18 | * 19 | */ 20 | public class Wrapper { 21 | 22 | public static void main(String[] args) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { 23 | // clear instrumentation state 24 | InstrumentationState.clear(); 25 | // first parameter is for class name 26 | String[] args_ = new String[args.length-1]; 27 | System.arraycopy(args, 1, args_, 0, args.length-1); 28 | // calling main of instrumented class through reflection 29 | Class clazz = Class.forName(args[0]); 30 | Method meth = clazz.getMethod("main", String[].class); 31 | try { 32 | meth.invoke(null, (Object) args_); 33 | } catch (InvocationTargetException _) { 34 | _.getCause().printStackTrace(); 35 | } 36 | // finally dump instrumentation results 37 | InstrumentationState.dump(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /demos/asm/src/instr/agent/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 49 4 | /svn/!svn/ver/822/trunk/randoop/src/callret/agent 5 | END 6 | InstrumentationAgent.java 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 75 10 | /svn/!svn/ver/807/trunk/randoop/src/callret/agent/InstrumentationAgent.java 11 | END 12 | InstrumentationState.java 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 75 16 | /svn/!svn/ver/822/trunk/randoop/src/callret/agent/InstrumentationState.java 17 | END 18 | -------------------------------------------------------------------------------- /demos/asm/src/instr/agent/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 1153 5 | https://spl-project.googlecode.com/svn/trunk/randoop/src/callret/agent 6 | https://spl-project.googlecode.com/svn 7 | 8 | 9 | 10 | 2012-10-10T18:09:25.639770Z 11 | 822 12 | MateusAraujoBorges@gmail.com 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | c47ebb53-d014-72c6-ed2e-044e009d6a56 28 | 29 | InstrumentationAgent.java 30 | file 31 | 32 | 33 | 34 | 35 | 2012-10-09T17:23:48.238480Z 36 | 4b7e95d7b47e2a556023604efcf8fa70 37 | 2012-10-03T10:36:22.805397Z 38 | 807 39 | zecarlosdecampos@gmail.com 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 721 62 | 63 | InstrumentationState.java 64 | file 65 | 66 | 67 | 68 | 69 | 2012-10-11T21:22:30.571116Z 70 | eedc0824f59a82b11ea12f09df181325 71 | 2012-10-10T18:09:25.639770Z 72 | 822 73 | MateusAraujoBorges@gmail.com 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 4880 96 | 97 | -------------------------------------------------------------------------------- /demos/asm/src/instr/agent/.svn/text-base/InstrumentationAgent.java.svn-base: -------------------------------------------------------------------------------- 1 | package callret.agent; 2 | 3 | import java.io.IOException; 4 | import java.lang.instrument.Instrumentation; 5 | 6 | import callret.instrumentation.ClassInstrumenter; 7 | 8 | /** 9 | * This is the instrumentation agent class that 10 | * must be passed in the command-line using 11 | * the command below. 12 | * 13 | * -javaagent:jarpath[=options] 14 | */ 15 | public class InstrumentationAgent 16 | { 17 | public static boolean DEBUG = false; 18 | 19 | /** 20 | * This method is the entry point of the java agent. 21 | */ 22 | public static void premain (String agentArgs, Instrumentation inst) throws IOException { 23 | // add the transformation that you want here 24 | // this will hook your transformation to the JVM 25 | // infrastructure 26 | inst.addTransformer(new ClassInstrumenter()); 27 | } 28 | } -------------------------------------------------------------------------------- /demos/asm/src/instr/agent/InstrumentationAgent.java: -------------------------------------------------------------------------------- 1 | package instr.agent; 2 | 3 | import instr.ClassInstrumenter; 4 | 5 | import java.io.IOException; 6 | import java.lang.instrument.Instrumentation; 7 | 8 | 9 | /** 10 | * This is the instrumentation agent class that 11 | * must be passed in the command-line using 12 | * the command below. 13 | * 14 | * -javaagent:jarpath[=options] 15 | */ 16 | public class InstrumentationAgent { 17 | 18 | /** 19 | * This method is the entry point of the java agent. 20 | */ 21 | public static void premain (String agentArgs, Instrumentation inst) throws IOException { 22 | //System.out.printf("> %s" , agentArgs); 23 | inst.addTransformer(new ClassInstrumenter()); 24 | } 25 | } -------------------------------------------------------------------------------- /demos/java-parser/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | build -------------------------------------------------------------------------------- /demos/java-parser/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | // necessary to indicate which class you want to run as main 4 | apply plugin:'application' 5 | mainClassName = "Main" 6 | 7 | repositories { 8 | mavenCentral() 9 | } 10 | 11 | dependencies { 12 | testCompile 'junit:junit:4.+' 13 | compile 'com.google.code.javaparser:javaparser:1.0.11' 14 | } -------------------------------------------------------------------------------- /demos/java-parser/src/main/java/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | 3 | public static void main(String[] args) throws Exception { 4 | //ParserExample.printCompilationUnit("src/main/java/BinarySearchTree.java"); 5 | //ParserExample.listMethods("src/main/java/BinarySearchTree.java"); 6 | //ParserExample.buildUnit(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /demos/pattern-matching/PatternMain.java: -------------------------------------------------------------------------------- 1 | import java.util.regex.Pattern; 2 | import java.util.regex.Matcher; 3 | 4 | public class PatternMain { 5 | public static void main(String[] args) { 6 | Pattern pattern = Pattern.compile("([a-z]*)([0-9]*)"); 7 | Matcher matcher = pattern.matcher(args[0]); 8 | if (matcher.matches()) { 9 | System.out.println(matcher.group(1)); 10 | System.out.println(matcher.group(2)); 11 | } else { 12 | System.err.println("No match!"); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /demos/pattern-matching/grepexample.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "grep example 1" 4 | grep "[0-9]" sampletext.txt 5 | 6 | echo "grep example 2" 7 | grep "[a-z]\|[A-Z]" sampletext.txt 8 | -------------------------------------------------------------------------------- /demos/pattern-matching/sampletext.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | m 6 6 | 4 7 | 6 8 | 7 9 | 8 10 | 9 11 | 1 12 | e 13 | 4 14 | 5 15 | W 16 | -------------------------------------------------------------------------------- /demos/pin/.gitignore: -------------------------------------------------------------------------------- 1 | obj-intel64 2 | perfectnum 3 | perfectnum-calltrace.txt -------------------------------------------------------------------------------- /demos/pin/makefile: -------------------------------------------------------------------------------- 1 | ############################################################## 2 | # 3 | # DO NOT EDIT THIS FILE! 4 | # 5 | ############################################################## 6 | 7 | # If the tool is built out of the kit, PIN_ROOT must be specified in the make invocation and point to the kit root. 8 | ifdef PIN_ROOT 9 | CONFIG_ROOT := $(PIN_ROOT)/source/tools/Config 10 | else 11 | CONFIG_ROOT := ../Config 12 | endif 13 | include $(CONFIG_ROOT)/makefile.config 14 | include makefile.rules 15 | include $(TOOLS_ROOT)/Config/makefile.default.rules 16 | 17 | ############################################################## 18 | # 19 | # DO NOT EDIT THIS FILE! 20 | # 21 | ############################################################## 22 | -------------------------------------------------------------------------------- /demos/pin/perfectnum.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | void foo() 6 | { 7 | cout << "start"; 8 | } 9 | 10 | 11 | int main(int argc, char * argv[]) 12 | { 13 | foo(); 14 | int i=1, u=1, sum=0; 15 | while(i<=500) 16 | { // start of first loop. 17 | 18 | while(u<=500) 19 | { //start of second loop. 20 | if(u 5 | D = id : T
6 | T = char | integer | array [ num ] of T | T -> T
7 | E = literal | num | E mod E | E[E] | id | E(E)
8 | 9 | Example programs in this language: 10 | 11 | Example 1: 12 | 13 | x : integer; 14 | x mod 5 15 | 16 | Example 2: 17 | 18 | x : array [ 2 ] of integer; 19 | myFun (x[2]) 20 | 21 | Example 3: 22 | 23 | myFun : integer -> integer; 24 | myFun(5) 25 | 26 | We are using the Gradle build system. The build.gradle file is a 27 | minimal build file, chracterizing main tasks of the build process. 28 | The purpose is to simplify compilation and testing. Most IDEs support 29 | Gradle. You can find detailed info about Gradle on the net. 30 | 31 | The important tests are "build", "test", and "clean". The following 32 | command builds the project. 33 | 34 | $> gradle build 35 | 36 | enjoy, 37 | 38 | -Marcelo -------------------------------------------------------------------------------- /demos/type-checking/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | mavenCentral() 5 | } 6 | 7 | dependencies { 8 | testCompile 'junit:junit:4.+' 9 | } -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/ArrayIndexing.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | public class ArrayIndexing extends Expression { 4 | 5 | private Expression e1, e2; // e1[e2] 6 | 7 | public ArrayIndexing(Expression e1, Expression e2) { 8 | this.e1 = e1; 9 | this.e2 = e2; 10 | } 11 | 12 | public Expression getE1() { 13 | return e1; 14 | } 15 | 16 | public Expression getE2() { 17 | return e2; 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/ArrayType.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | public class ArrayType extends Type { 4 | 5 | private int size; 6 | 7 | private Type type; 8 | 9 | public ArrayType(int i, IntType intType) { // int[5] => new ArrayType(5, new IntType()) 10 | this.size = i; 11 | this.type = intType; 12 | } 13 | 14 | public Type getType() { 15 | return type; 16 | } 17 | 18 | @Override 19 | public String toString() { 20 | return String.format("array [%d] of %s", size, type.toString()); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/CharType.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | public class CharType extends Type { 4 | @Override 5 | public String toString() { 6 | return "char"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/Declaration.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | import ast.visitors.Visitor; 4 | 5 | public class Declaration implements Node { 6 | 7 | private Id id; 8 | private Type type; 9 | 10 | public Declaration(Id x, Type arg) { 11 | this.id = x; 12 | this.type = arg; 13 | } 14 | 15 | public void accept(Visitor vis) { 16 | vis.visit(this); 17 | } 18 | 19 | public Id getID() { 20 | return id; 21 | } 22 | 23 | public Type getType() { 24 | return type; 25 | } 26 | } -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/Expression.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | import ast.visitors.Visitor; 4 | 5 | public class Expression implements Node { 6 | 7 | public void accept(Visitor vis) { 8 | vis.visit(this); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/FunctionCall.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | public class FunctionCall extends Expression { 4 | 5 | private Expression e1, e2; // e1[e2] 6 | 7 | public FunctionCall(Expression e1, Expression e2) { 8 | this.e1 = e1; 9 | this.e2 = e2; 10 | } 11 | 12 | public Expression getE1() { 13 | return e1; 14 | } 15 | 16 | public Expression getE2() { 17 | return e2; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/FunctionType.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | public class FunctionType extends Type { 4 | 5 | Type t1, t2; 6 | 7 | FunctionType(Type t1, Type t2) { 8 | this.t1 = t1; 9 | this.t2 = t2; 10 | } 11 | 12 | @Override 13 | public String toString() { 14 | return String.format("->(%s,%s)", t1, t2); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/Id.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | public class Id extends Expression { 4 | 5 | private String name; 6 | 7 | public Id(String name) { 8 | this.name = name; 9 | } 10 | 11 | public String toString() { 12 | return name; 13 | } 14 | 15 | @Override 16 | public int hashCode() { 17 | return name.hashCode(); 18 | } 19 | 20 | 21 | @Override 22 | public boolean equals(Object obj) { 23 | boolean result = false; 24 | if (obj instanceof Id) { 25 | result = name.equals(((Id)obj).name); 26 | } 27 | return result; 28 | } 29 | 30 | public String getName() { 31 | return name; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/IntType.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | public class IntType extends Type { 4 | @Override 5 | public String toString() { 6 | return "int"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/Literal.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | public class Literal extends Expression { 4 | private char c; 5 | 6 | public Literal(char c) { 7 | this.c = c; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/Mod.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | public class Mod extends Expression { 4 | 5 | private Expression e1, e2; 6 | 7 | public Mod(Expression e1, Expression e2) { 8 | this.e1 = e1; 9 | this.e2 = e2; 10 | } 11 | 12 | public Expression getE1() { 13 | return e1; 14 | } 15 | 16 | public Expression getE2() { 17 | return e2; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/Node.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | public interface Node {} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/Num.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | public class Num extends Expression { 4 | 5 | private int i; 6 | 7 | public Num(int i) { 8 | this.i = i; 9 | } 10 | 11 | public int getVal() { 12 | return i; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/Program.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | import ast.visitors.Visitor; 4 | 5 | public class Program implements Node { 6 | 7 | private Declaration d; 8 | private Expression e; 9 | 10 | public Program(Declaration d1, Expression x) { 11 | this.d = d1; 12 | this.e = x; 13 | } 14 | 15 | public void accept(Visitor vis) { 16 | vis.visit(this); 17 | } 18 | 19 | public Declaration getDeclaration() { 20 | return d; 21 | } 22 | 23 | public Expression getExpression() { 24 | return e; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/Type.java: -------------------------------------------------------------------------------- 1 | package ast; 2 | 3 | import ast.visitors.Visitor; 4 | 5 | public class Type { 6 | 7 | public void accept(Visitor vis) { 8 | vis.visit(this); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/visitors/IdsVisitor.java: -------------------------------------------------------------------------------- 1 | package ast.visitors; 2 | 3 | import java.util.*; 4 | import ast.*; 5 | 6 | public class IdsVisitor extends VisitorAdaptor { 7 | 8 | public Set ids = new HashSet(); 9 | 10 | @Override 11 | public void visit(Id id) { 12 | ids.add(id); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/visitors/TypeError.java: -------------------------------------------------------------------------------- 1 | package ast.visitors; 2 | 3 | public class TypeError extends RuntimeException{} 4 | -------------------------------------------------------------------------------- /demos/type-checking/src/main/java/ast/visitors/Visitor.java: -------------------------------------------------------------------------------- 1 | package ast.visitors; 2 | 3 | import ast.*; 4 | 5 | 6 | public interface Visitor { 7 | 8 | public void visit(Program program); 9 | public void visit(Declaration declaration); 10 | 11 | // subtypes of Type 12 | public void visit(Type type); 13 | public void visit(ArrayType type); 14 | public void visit(CharType type); 15 | public void visit(IntType type); 16 | public void visit(FunctionType type); 17 | 18 | // subtypes of Expression 19 | public void visit(Expression expression); 20 | public void visit(Id expression); 21 | public void visit(Mod expression); 22 | public void visit(Num expression); 23 | public void visit(ArrayIndexing expression); 24 | public void visit(Literal expression); 25 | public void visit(FunctionCall expression); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /demos/type-checking/src/test/java/ast/visitors/IdsVisitorTest.java: -------------------------------------------------------------------------------- 1 | package ast.visitors; 2 | 3 | import ast.visitors.*; 4 | import org.junit.Test; 5 | import org.junit.Assert; 6 | import java.util.Set; 7 | import ast.Program; 8 | import ast.Id; 9 | import ast.ASTSamples; 10 | 11 | public class IdsVisitorTest { 12 | 13 | @Test 14 | public void basicIdVisitorTest() { 15 | // build AST manually (could be done by a parser) 16 | Program p = (Program) ASTSamples.sample1(); 17 | 18 | // build visitor and call accept 19 | IdsVisitor vis = new IdsVisitor(); 20 | p.accept(vis); 21 | 22 | 23 | Set ids = vis.ids; 24 | Assert.assertEquals(1, ids.size()); 25 | Assert.assertEquals("x", ids.toArray()[0].toString()); 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /demos/visitors/BinaryExpr.java: -------------------------------------------------------------------------------- 1 | public class BinaryExpr implements Expr { 2 | String op; 3 | Expr arg1, arg2; 4 | 5 | public BinaryExpr(String op, Expr arg1, Expr arg2) { 6 | this.op = op; 7 | this.arg1 = arg1; 8 | this.arg2 = arg2; 9 | } 10 | 11 | public void accept(Visitor vis) { 12 | vis.visit(this); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /demos/visitors/CalculatorVisitor.java: -------------------------------------------------------------------------------- 1 | import java.util.Stack; 2 | 3 | public class CalculatorVisitor extends VisitorAdaptor { 4 | 5 | Stack st = new Stack(); 6 | 7 | public void visit(BinaryExpr exp) { 8 | this.visit(exp.arg1); 9 | this.visit(exp.arg2); 10 | 11 | String op = exp.op; 12 | int a = st.pop(); 13 | int b = st.pop(); 14 | int c; 15 | if (op.equals("+")) { 16 | c = a + b; 17 | } else if (op.equals("*")) { 18 | c = a * b; 19 | } else { 20 | throw new RuntimeException("check this case, please."); 21 | } 22 | 23 | st.push(c); 24 | } 25 | 26 | public void visit(LiteralExpr exp) { 27 | st.push(exp.cte); 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /demos/visitors/Expr.java: -------------------------------------------------------------------------------- 1 | public interface Expr { 2 | public void accept(Visitor vis); 3 | } 4 | -------------------------------------------------------------------------------- /demos/visitors/LiteralExpr.java: -------------------------------------------------------------------------------- 1 | public class LiteralExpr implements Expr { 2 | int cte; 3 | 4 | public LiteralExpr(int cte) { 5 | this.cte = cte; 6 | } 7 | 8 | public void accept(Visitor vis) { 9 | vis.visit(this); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /demos/visitors/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | public static void main(String[] args) { 3 | // assume this is done by the parser 4 | Expr childExpr = new BinaryExpr("+", new LiteralExpr(5), new LiteralExpr(3)); // 5 + 3 5 | Expr rootExpr = new BinaryExpr("*", childExpr, new LiteralExpr(2)); // (5 + 3) * 2 6 | example_infix(rootExpr); 7 | System.out.println(); 8 | example_prefix(rootExpr); 9 | System.out.println(); 10 | example_postfix(rootExpr); 11 | System.out.println(); 12 | example_calculator(rootExpr); 13 | } 14 | 15 | // use case 1: calculator 16 | private static void example_calculator(Expr rootExpr) { 17 | CalculatorVisitor vis = new CalculatorVisitor(); 18 | rootExpr.accept(vis); 19 | System.out.println("--> "+vis.st.pop()); 20 | } 21 | 22 | 23 | // use case 2: postfix notation 24 | private static void example_postfix(Expr rootExpr) { 25 | Visitor vis = new PrinterPosfix(); 26 | rootExpr.accept(vis); 27 | } 28 | 29 | // use case 3: prefix notation 30 | private static void example_prefix(Expr rootExpr) { 31 | Visitor vis = new PrinterPrefix(); 32 | rootExpr.accept(vis); 33 | } 34 | 35 | // use case 4: infix notation 36 | private static void example_infix(Expr rootExpr) { 37 | Visitor vis = new PrinterInfix(); 38 | rootExpr.accept(vis); 39 | } 40 | 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /demos/visitors/PrinterInfix.java: -------------------------------------------------------------------------------- 1 | public class PrinterInfix extends VisitorAdaptor { 2 | 3 | public void visit(LiteralExpr exp) { 4 | System.out.print(exp.cte); 5 | } 6 | 7 | public void visit(String op) { 8 | System.out.print(op); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /demos/visitors/PrinterPosfix.java: -------------------------------------------------------------------------------- 1 | public class PrinterPosfix extends PrinterInfix { 2 | 3 | public void visit(BinaryExpr exp) { 4 | this.visit(exp.arg1); 5 | this.visit(exp.arg2); 6 | System.out.print(exp.op); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /demos/visitors/PrinterPrefix.java: -------------------------------------------------------------------------------- 1 | public class PrinterPrefix extends VisitorAdaptor { 2 | 3 | public void visit(LiteralExpr exp) { 4 | System.out.print(exp.cte); 5 | } 6 | 7 | public void visit(String op) { 8 | System.out.print(op); 9 | } 10 | 11 | 12 | public void visit(BinaryExpr exp) { 13 | this.visit(exp.op); 14 | System.out.print("("); 15 | this.visit(exp.arg1); 16 | System.out.print(","); 17 | this.visit(exp.arg2); 18 | System.out.print(")"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /demos/visitors/Visitor.java: -------------------------------------------------------------------------------- 1 | public interface Visitor { 2 | void visit(Expr exp); 3 | void visit(BinaryExpr exp); 4 | void visit(LiteralExpr exp); 5 | void visit(String op); // operation 6 | } 7 | -------------------------------------------------------------------------------- /demos/visitors/VisitorAdaptor.java: -------------------------------------------------------------------------------- 1 | public class VisitorAdaptor implements Visitor { 2 | 3 | public void visit(Expr exp) { 4 | if (exp instanceof LiteralExpr) { 5 | visit((LiteralExpr)exp); 6 | } else if (exp instanceof BinaryExpr) { 7 | visit((BinaryExpr)exp); 8 | } else { 9 | throw new RuntimeException("MISSING CASE"); 10 | } 11 | } 12 | 13 | public void visit(BinaryExpr exp) { 14 | this.visit(exp.arg1); 15 | this.visit(exp.op); 16 | this.visit(exp.arg2); 17 | } 18 | 19 | public void visit(LiteralExpr exp) {} 20 | 21 | public void visit(String op) {} 22 | } 23 | -------------------------------------------------------------------------------- /demos/visitors/s: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | find . -name "*.java" | xargs javac 4 | java -cp . Main -------------------------------------------------------------------------------- /provas/2001-2-prova2.txt: -------------------------------------------------------------------------------- 1 | Prova de Compiladores - 2/2001 - 29/04/2001 2 | =========================================== 3 | 4 | 1) (2.0) Quais as vantagens de se gerar um codigo intermediario antes 5 | da geracao de codigo final (assembler)? 6 | 7 | 2) (2.0) De que formas variaveis podem ser armazenadas na memoria? 8 | (i.e. em que partes da memoria variaveis podem ser alocadas?) 9 | Em que situacoes uma variavel deve ser alocada em cada uma delas, 10 | e por que? 11 | 12 | 3) (2.0) Descreva o funcionamento do processo de avaliacao de 13 | funcoes recursivas na memoria (use fatorial como exemplo). 14 | 15 | 4) (2.0) Qual o codigo intermediario (3 enderecos) 16 | gerado pelos trechos de codigo abaixo: 17 | 18 | a) FOR X := 20 TO T 19 | BEGIN 20 | W := 10 * X + W; 21 | Y := 5 * V; 22 | Z := Z + 10 * X; 23 | END 24 | 25 | b) A := 10; 26 | B := 20; 27 | C := 30; 28 | WHILE D < A DO 29 | BEGIN 30 | IF A > B THEN D := D + 3; 31 | IF A > C THEN D := D + 2; 32 | B := B - 5; 33 | END 34 | 35 | 5) (2.0) Baseado exclusivamente nos trechos de codigo acima, 36 | verifique se sao possiveis otimizacoes no codigo intermediario. 37 | Em caso afirmativo, mostre as otimizacoes possiveis no codigo, 38 | com seu nome, descricao de funcionamento e o codigo final apos 39 | as otimizacoes. 40 | 41 | 42 | -------------------------------------------------------------------------------- /provas/2002-1-prova1.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2002-1-prova1.doc -------------------------------------------------------------------------------- /provas/2002-1-prova1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2002-1-prova1.pdf -------------------------------------------------------------------------------- /provas/2002-1-prova1res.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2002-1-prova1res.doc -------------------------------------------------------------------------------- /provas/2002-1-prova1res.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2002-1-prova1res.pdf -------------------------------------------------------------------------------- /provas/2002-2-final.txt: -------------------------------------------------------------------------------- 1 | Prova Final de Compiladores - 2/2002 - 17/03/2003 2 | ================================================= 3 | 4 | Aluno: _____________________________________ 5 | 6 | 1 - descreva os varios tipos possiveis de alocacao e desalocacao 7 | de memoria dinamica (heap), indicando se ele existe, e, em caso positivo, 8 | exemplo de linguagem(ns) que o utilize e como funciona. 9 | a) (1.0) alocacao explicita de memoria na heap 10 | b) (1.0) alocacao implicita de memoria na heap 11 | c) (1.0) desalocacao explicita de memoria na heap 12 | d) (1.0) desalocacao implicita de memoria na heap 13 | 14 | 2 - Qual a diferenca entre fases e passos do processo de 15 | compilacao? De exemplo de como cada um dos dois conceitos 16 | e' utilizado. (2.0) 17 | 18 | 3 - De exemplos dos tipos de erros que sao detectados: 19 | a) pela analise sintatica (2.0) 20 | b) pela analise contextual (2.0) 21 | 22 | -------------------------------------------------------------------------------- /provas/2002-2-prova1.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2002-2-prova1.doc -------------------------------------------------------------------------------- /provas/2002-2-prova1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2002-2-prova1.pdf -------------------------------------------------------------------------------- /provas/2002-2-prova2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2002-2-prova2.txt -------------------------------------------------------------------------------- /provas/2003-2-prova1.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2003-2-prova1.doc -------------------------------------------------------------------------------- /provas/2004-1-prova1.txt: -------------------------------------------------------------------------------- 1 | Prova 1 de Teoria e Implementacao de Linuagens Computacionais - 11/07/2004 2 | ========================================================================== 3 | 4 | 5 | 1) Descreva como podem ser implementados analisadores sintaticos, 6 | e quais as vantagens/desvantagens de cada implementacao. 7 | 8 | 2) Qual a diferenca entre parse tree e abstract syntax tree? 9 | (ou seja, o que sao, para que servem, suas caracteristicas). 10 | De um exemplo. 11 | 12 | 3) Qual a diferenca entre uma linguagem com escopo estatico e com 13 | escopo dinamico? 14 | 15 | 4) Descreva utilizando diagramas tombstone o processo de compilacao 16 | e execucao de um programa em Java. -------------------------------------------------------------------------------- /provas/2004-2-prova1.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2004-2-prova1.doc -------------------------------------------------------------------------------- /provas/2005-1-prova1.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2005-1-prova1.doc -------------------------------------------------------------------------------- /provas/2005-2-prova1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2005-2-prova1.txt -------------------------------------------------------------------------------- /provas/2006-1-prova1a.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2006-1-prova1a.doc -------------------------------------------------------------------------------- /provas/2007-1-prova1.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2007-1-prova1.doc -------------------------------------------------------------------------------- /provas/2008-1-prova1.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2008-1-prova1.docx -------------------------------------------------------------------------------- /provas/2009-1-prova1a.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2009-1-prova1a.doc -------------------------------------------------------------------------------- /provas/2009-2-prova1b.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2009-2-prova1b.doc -------------------------------------------------------------------------------- /provas/2010-2-prova1.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2010-2-prova1.doc -------------------------------------------------------------------------------- /provas/2011-1-1ee.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2011-1-1ee.odt -------------------------------------------------------------------------------- /provas/2011-1-2aChamada.txt: -------------------------------------------------------------------------------- 1 | Compiladores 2011.1E, Segunda Chamada 2 | Prof. Marcelo d'Amorim 3 | 4 | 2. (5 pontos) Coloque o trecho de código abaixo em Static Single 5 | Assignment form (SSA) e explique a utlidade de SSA. 6 | 7 | x = ...; y = ...; 8 | while (x > 0) { 9 | if ((++x%2) == 0) { 10 | y += 2; 11 | } 12 | } 13 | 14 | 3. (5 pontos) Para o programa abaixo, faça: 15 | 16 | (a) Construa o control flow graph (CFG) 17 | 18 | (b) Indique, usando o CFG, as dependências de dados e controle do programa. 19 | 20 | (c) Explique a utilidade disto. 21 | 22 | public void add(int info) { 23 | if (root == null) { 24 | this.root = new Node(info); 25 | } else { 26 | Node temp = root; 27 | while (true) { 28 | if (temp.info < info) { 29 | if (temp.right == null) { 30 | temp.right = new Node(info); 31 | break; 32 | } else { 33 | temp = temp.right; 34 | } 35 | } else if (temp.info > info) { 36 | if (temp.left == null) { 37 | temp.left = new Node(info); 38 | break; 39 | } else { 40 | temp = temp.left; 41 | } 42 | } else { 43 | return; 44 | } 45 | } 46 | } 47 | this.size = this.size + 1; 48 | } 49 | -------------------------------------------------------------------------------- /provas/2011-1-Final.txt: -------------------------------------------------------------------------------- 1 | Final de compiladores 2 | Prof. Marcelo d'Amorim 3 | 4 | 1. (6 pontos) Explique com exemplos o que são dependências de dados e 5 | controle de um programa. 6 | 7 | 2. (4 pontos) Escreva um parser recursivo descente para a gramática 8 | abaixo. 9 | 10 | A := Id "(" B ")" 11 | B := Id | Id "," B 12 | -------------------------------------------------------------------------------- /provas/2011-2-1ee.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2011-2-1ee.doc -------------------------------------------------------------------------------- /provas/2011-2-2ee.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2011-2-2ee.doc -------------------------------------------------------------------------------- /provas/2011-2-Final.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2011-2-Final.txt -------------------------------------------------------------------------------- /provas/2012-1-1ee.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2012-1-1ee.odt -------------------------------------------------------------------------------- /provas/2012-1-2ee.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2012-1-2ee.doc -------------------------------------------------------------------------------- /provas/2012-2-Final 2.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2012-2-Final 2.odt -------------------------------------------------------------------------------- /provas/2012-2-Final 2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2012-2-Final 2.txt -------------------------------------------------------------------------------- /provas/2012-2-Final.txt: -------------------------------------------------------------------------------- 1 | Prova Final de Compiladores (e Segunda Chamada) 2 | Prof. Marcelo d'Amorim 3 | 4 | 1. Escreva uma gramatica livre de contexto capaz de reconhecer 5 | expressoes aritmeticas e booleanas. Sua gratica deve reconhecer as 6 | strings abaixo: 7 | 8 | x * y + z 9 | 10 | x > (y * z) 11 | 12 | 2. Escreva um parser recursivo descendente para esta gramatica. 13 | 14 | 3. Para que server um checador de tipos? De exemplos de uso e 15 | explique como vc. pode implementar um (checador de tipos). 16 | 17 | 4. Coloque os programas abaixo no formato SSA. 18 | 19 | int foo(int x) { 20 | int y = 0; 21 | if (x > 10) { 22 | y++; 23 | } 24 | return y; 25 | } 26 | 27 | int bar(int x) { 28 | int y = 0; 29 | while (x > 10) { 30 | y++; 31 | } 32 | return y; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /provas/2013-1-2EE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2013-1-2EE.txt -------------------------------------------------------------------------------- /provas/2013-1-Final.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2013-1-Final.txt -------------------------------------------------------------------------------- /provas/2015-1-FINAL.txt: -------------------------------------------------------------------------------- 1 | Compiladores (IF688) 2 | Prova Final e Segunda Chamada 3 | 4 | Centro de Informática - UFPE 5 | Prof. Marcelo d'Amorim 6 | 7 | 1. Descreva entrada e saída dos vários componentes de um compilador. 8 | 9 | 10 | Questões 2 e 3: A gramática abaixo define uma categoria sintática para expressões, chamada EXP, e uma categoria sintática para comandos, chamada STMT. 11 | 12 | STMT => if (EXP) then STMT 13 | | Id[EXP] := EXP 14 | 15 | 2. Escreva uma árvore sintática abstrata (AST) para um comando pertencente a linguagem acima. 16 | 17 | 18 | 3. Descreva informalmente regras de tipo para o comando “id” e para o comando de atribuição em array. 19 | 20 | 21 | 4. Sobre ambiente de execução, para que serve coleta de lixo (garbage collection)? Explique algumas das consequências em se usar coleta de lixo. 22 | 23 | 24 | 5. Explique o funcionamento da coleta de lixo "mark-and-sweep". 25 | -------------------------------------------------------------------------------- /provas/2017-1-1ee.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2017-1-1ee.docx -------------------------------------------------------------------------------- /provas/2017-1-2EE.txt: -------------------------------------------------------------------------------- 1 | 2EE IF688 (Compiladores), 27 de Junho de 2017 2 | Prof. Marcelo d'Amorim 3 | 4 | 1. (1 ponto) Indique a otimizacao que o compilador pode realizar no 5 | programa abaixo e o programa resultante. 6 | 7 | int a = 30; 8 | int b = 9 - (a / 5); 9 | int c; 10 | 11 | c = b * 4; 12 | if (c > 10) { 13 | c = c - 10; 14 | } 15 | return c * (60 / a); 16 | 17 | 18 | 19 | 2. (1 ponto) Indique a otimizacao que o compilador pode realizar no 20 | programa abaixo e o programa resultante. 21 | 22 | for (int i = 0; i < n; i++) { 23 | x = y + z; 24 | a[i] = 6 * i + x * x; 25 | } 26 | 27 | 28 | 29 | 3. (1 ponto) Indique a otimizacao que o compilador pode realizar no 30 | programa abaixo e o programa resultante. 31 | 32 | for (i = 0; i < 10; ++i) { 33 | j = 17 * i; 34 | } 35 | 36 | 37 | 38 | 4. (2 pontos) Um garbage collector consegue eliminar memory leaks em 39 | um programa? Explique. 40 | 41 | 42 | 43 | 5. (2 pontos) Quais vantages e desvantagens do garbage collector 44 | mark-and-sweep em relacao ao garbage collectro reference counting. 45 | 46 | 47 | 48 | 6. (1 ponto) Coloque o código abaixo no formato SSA. 49 | 50 | if (z > 1) { 51 | x = 2; 52 | } else { 53 | x = 1; 54 | if (z > 2) { 55 | z = x - 3; 56 | x = 4; 57 | x = x - 7; 58 | } else { 59 | y = x - 1; 60 | } 61 | } 62 | 63 | 64 | 65 | 7. (2 ponto) Voce poderia usar SSA para descobrir expressoes cujos 66 | valores podem ser definidos em tempo de compilacao? Se sim, explique. 67 | -------------------------------------------------------------------------------- /provas/2017-1-Final.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2017-1-Final.docx -------------------------------------------------------------------------------- /provas/2017-2-1EE.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/provas/2017-2-1EE.odt -------------------------------------------------------------------------------- /provas/2017-2-FINAL.txt: -------------------------------------------------------------------------------- 1 | Compiladores (IF688) 2 | Prova Final e Segunda Chamada, 2017.2 3 | 4 | Centro de Informática - UFPE 5 | 6 | A gramática abaixo define uma categoria sintática para expressões, 7 | chamada EXP, e uma categoria sintática para comandos, chamada STMT. O 8 | símbolos ID e LIT representam, respectivamente, identificadores da 9 | linguagem e constantes inteiras. 10 | 11 | EXP ::= ID 12 | | EXP > EXP 13 | | LIT 14 | 15 | STMT ::= if (EXP) then STMT 16 | | ID[EXP] := EXP 17 | 18 | 1. Escreva uma árvore sintática abstrata (AST) para um comando pertencente a linguagem acima. 19 | 20 | 21 | 2. Descreva informalmente regras de tipo para a linguagem acima. 22 | 23 | 24 | 3. Escreva uma função com loop e, em seguida, coloque a função no formato SSA. 25 | 26 | 27 | 4. Ilustre com exemplos as seguintes otimizações de código: 28 | 29 | - Propagação de constantes (Constant Folding and Propagation) 30 | - Elimintação de Subexpressão Comum (Common Subexpression Elimination) 31 | - Redução de Força (Reduction of Strength) 32 | 33 | -------------------------------------------------------------------------------- /provas/2018-1-FINAL.txt: -------------------------------------------------------------------------------- 1 | Prof. Marcelo d'Amorim 2 | Final e Segunda Chamada Compiladores 3 | Recife, 4 de Julho de 2018 4 | 5 | 1. [2 pontos] Escreva um parser recursivo descendente para a gramática 6 | abaixo. 7 | 8 | A := Id "(" B ")" 9 | B := Id | Id "," B 10 | 11 | 12 | 13 | 2. [2 pontos] Considerando o fragmento abaixo de uma gramática para 14 | uma linguagem imperativa qualquer. 15 | 16 | STMT => if (EXP) then STMT 17 | | Id := EXP 18 | 19 | Descreva informalmente regras de tipo associadas a cada um dos 20 | comandos--"if" e atribuição. 21 | 22 | 23 | 24 | 3. [2 pontos] Explique vantanges e desvantages de se usar coletores de 25 | lixo. 26 | 27 | 28 | 29 | 4. [2 pontos] Explique o que são dependência de dados e qual sua 30 | relação com o formato SSA. 31 | 32 | 33 | 34 | 35 | 5. [2 pontos] Ilustre com exemplos as seguintes otimizações de código: 36 | 37 | - Desdobramento e Propagação de constantes (Constant Folding and Propagation) 38 | - Eliminação de Subexpressão Comum (Common Subexpression Elimination) 39 | - Redução de Força (Reduction of Strength) 40 | -------------------------------------------------------------------------------- /provas/2018-2-FINAL.txt: -------------------------------------------------------------------------------- 1 | Prof. Marcelo d'Amorim 2 | Final e Segunda Chamada Compiladores 3 | Recife, 13 de Dezembro de 2018 4 | 5 | 1. [5 pontos] Responda: 6 | 7 | - qual a vantagem de se organizar um compilador em dois módulos: 8 | front-end e back-end? 9 | 10 | - qual a utilidade de um cross-compiler? 11 | 12 | - por que o backend de um compilador frequentemente gera código 13 | assembly ao invés de código de máquina diretamente? 14 | 15 | - por que o uso de um coletor de lixo "mark-and-sweep" nao seria uma 16 | boa ideia para a execução de um sistema de tempo real? 17 | 18 | - por que nao é viavel usar um parser recursivo descendente para 19 | qualquer gramática? 20 | 21 | 22 | 2. [3 pontos] Considerando uma linguagem imperativa qualquer, descreva 23 | regras de tipo que vc. usaria para o comando de atribuição em arrays. 24 | 25 | 26 | 3. [2 pontos] Ilustre, com exemplo, a otimização de código abaixo. 27 | 28 | - Movimentação de código invariante de loop ("Loop Invariant Code Motion") 29 | -------------------------------------------------------------------------------- /provas/2019-1-FINAL.txt: -------------------------------------------------------------------------------- 1 | Prova de Segunda Chamada (e Final) de Compiladores, 2019.1 2 | Marcelo d'Amorim 3 | 15 de Julho, 2019 4 | 5 | A gramática abaixo define uma categoria sintática para expressões, 6 | chamada EXP, e uma categoria sintática para comandos, chamada STMT. O 7 | símbolos ID e LIT representam, respectivamente, identificadores da 8 | linguagem e constantes inteiras. 9 | 10 | EXP ::= ID 11 | | EXP > EXP 12 | | LIT 13 | 14 | STMT ::= if EXP then STMT 15 | | print EXP 16 | 17 | 1. [1 ponto] Escreva uma árvore sintática abstrata (AST) para um 18 | comando pertencente a linguagem acima. 19 | 20 | 2. [3 pontos] Complemente a gramática acima com: 21 | 22 | (1) declaração de variáveis com tipos inteiro e arrays de inteiros 23 | 24 | (2) comando de atribuição a variável (considere casos onde variável é de tipo array) 25 | 26 | 27 | 3. [3 pontos] Descreva ao lado de cada produção gramatical a regra de tipo 28 | correspondente que poderia ser checada durante a análise semântica 29 | 30 | 31 | 4. [1 ponto] Coloque o código abaixo no formato SSA 32 | 33 | if (x > y) then 34 | if (x < z) then 35 | x = 10 36 | 37 | 5. [2 pontos] Para que serve uma gramática de atributos? E qual a 38 | diferença entre uma gramática de atribuitos sintetizados e uma 39 | gramática de atributos herdados? 40 | -------------------------------------------------------------------------------- /provas/2019-2-FINAL.txt: -------------------------------------------------------------------------------- 1 | Prof. Marcelo d'Amorim 2 | Final e Segunda Chamada Compiladores 3 | Recife, 5 de Dezembro de 2019 4 | 5 | 1. [3 pontos] Descreva uma gramática livre de contexto para uma 6 | linguagem de programação com as seguintes características: 7 | 8 | - declaração de variáveis com tipos char, bool, e int 9 | - constantes para char, bool, e int 10 | - declaração de função 11 | - atribuição 12 | - chamada de função 13 | 14 | 2. [1 ponto] É possível escrever um parser recursivo descendente para 15 | a gramática do quesito anterior? Explique. 16 | 17 | 3. [3 pontos] Descreva, em linguagem natural, regras de tipo para cada 18 | uma das produções da sua gramática 19 | 20 | 4. [3 pontos] Ilustre, com exemplos, as otimização de código abaixo. 21 | 22 | - Desdobramento e propagação de constantes ("Constant Folding and Propagation") 23 | - Movimentação de código invariante de loop ("Loop Invariant Code Motion") 24 | - Redução de força ("Strength Reduction") 25 | - Eliminação de subexpressões comum ("Common Subexpression Elimination") 26 | -------------------------------------------------------------------------------- /slides-aulas/README.txt: -------------------------------------------------------------------------------- 1 | Ordem Cronologica das Aulas 2 | 3 | Analise 4 | ======= 5 | 6 | intro.pptx 7 | conceitos-basicos.pptx 8 | analise-lexica.pptx 9 | analise-sintatica.pptx 10 | analise-semantica.pptx 11 | 12 | Sintese 13 | ======= 14 | 15 | representacoes-intermediarias.pptx 16 | analise-estatica.pptx 17 | ambiente-exec-e-geracao-codigo.pptx 18 | aplicacoes.pptx 19 | -------------------------------------------------------------------------------- /slides-aulas/ambiente-exec-e-geracao-codigo.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/slides-aulas/ambiente-exec-e-geracao-codigo.pptx -------------------------------------------------------------------------------- /slides-aulas/ambiente-exec.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/slides-aulas/ambiente-exec.pptx -------------------------------------------------------------------------------- /slides-aulas/analise-estatica.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/slides-aulas/analise-estatica.pptx -------------------------------------------------------------------------------- /slides-aulas/analise-lexica.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/slides-aulas/analise-lexica.pptx -------------------------------------------------------------------------------- /slides-aulas/analise-semantica.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/slides-aulas/analise-semantica.pptx -------------------------------------------------------------------------------- /slides-aulas/analise-sintatica.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/slides-aulas/analise-sintatica.pptx -------------------------------------------------------------------------------- /slides-aulas/aplicacoes.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/slides-aulas/aplicacoes.pptx -------------------------------------------------------------------------------- /slides-aulas/conceitos-basicos.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/slides-aulas/conceitos-basicos.pptx -------------------------------------------------------------------------------- /slides-aulas/geracao-de-codigo.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/slides-aulas/geracao-de-codigo.pptx -------------------------------------------------------------------------------- /slides-aulas/intro.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/slides-aulas/intro.pptx -------------------------------------------------------------------------------- /slides-aulas/representacoes-intermediarias.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damorim/compilers-cin/e2f3a18e4cded92276b9def254452910f28faa50/slides-aulas/representacoes-intermediarias.pptx --------------------------------------------------------------------------------