Ejemplo n.º 1
0
        public AssemblyGenerator(SyntaticAnalyserResult syntaticAnalyserResult)
        {
            _syntaticAnalyserResult = syntaticAnalyserResult ?? throw new ArgumentNullException(nameof(syntaticAnalyserResult));

            _stringList = new List <string>()
            {
                "global _main\n\n", "extern  _GetStdHandle@4", "extern  _WriteFile@20",
                "extern  _ExitProcess@4\n\n", "section .text\n", "_main:\n\n"
            };
        }
Ejemplo n.º 2
0
 public SyntacticAnalyser(List <Token> tokens)
 {
     _tokens                      = tokens;
     _lookAhead                   = tokens.FirstOrDefault();
     _c3eAnalyserResults          = new List <C3EAnalyserResult>();
     _syntaticAnalyserResult      = new SyntaticAnalyserResult();
     _varStack                    = new Stack <Token>();
     _temporaryVarStack           = new Stack <Token>();
     _temporaryVarStackAcumulator = new Stack <Token>();
     _c3eStack                    = new Stack <string>();
     _temporaryVarCounter         = 0;
     _c3eLineCounter              = 0;
 }