Ejemplo n.º 1
0
        public override Statement Interprete(string src, int line)
        {
            var returns = new DecStmt();
            returns.Line = line;
            var regexp = new Regex(Parser.Grammar.GetPattern("vardec").ToString());
            Match match = regexp.Match(src);

            if (match.Success)
            {
                returns.Name = match.Groups["Name"].Value;
                returns.Type = match.Groups["Type"].Value;

                returns.Value = StatmentVarHandler.HandleVar(match.Groups["Value"].Value, match.Groups["Type"].Value);
                return returns;
            }

            return null;
        }
Ejemplo n.º 2
0
        public override Statement Interprete(string src, int line)
        {
            var returns = new DecStmt();

            returns.Line = line;
            var   regexp = new Regex(Parser.Grammar.GetPattern("vardec").ToString());
            Match match  = regexp.Match(src);

            if (match.Success)
            {
                returns.Name = match.Groups["Name"].Value;
                returns.Type = match.Groups["Type"].Value;

                returns.Value = StatmentVarHandler.HandleVar(match.Groups["Value"].Value, match.Groups["Type"].Value);
                return(returns);
            }

            return(null);
        }
Ejemplo n.º 3
0
 public virtual void Visit(DecStmt dec)
 {
 }