# HG changeset patch # User Windel Bouwman # Date 1373015938 -7200 # Node ID 6875360e8390c670c8b66ebb1689ec78159213d7 # Parent 003c8a976fffebd0c38d4e6f5cbb7176b7a81519 Remove semantics diff -r 003c8a976fff -r 6875360e8390 python/c3/semantics.py --- a/python/c3/semantics.py Fri Jul 05 11:18:48 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -from . import astnodes -from .scope import Scope, topScope -from ppci import CompilerError - -class Semantics: - """ This class constructs the AST from parser input """ - def __init__(self, diag): - self.diag = diag - def addSymbol(self, s): - if self.curScope.hasSymbol(s.name): - msg = 'Redefinition of {0}'.format(s.name) - raise CompilerError(msg, s.loc) - else: - self.curScope.addSymbol(s) - def actOnFuncDef2(self, parameters, returntype, body): - self.curFunc.body = body - paramtypes = [p.typ for p in parameters] - self.curFunc.typ = astnodes.FunctionType(paramtypes, returntype) - self.curFunc = None - self.curScope = self.curScope.parent -