Ejemplo n.º 1
0
        public override void Visit(StructMemberCallAST structCall)
        {
            if (_stateInfo.isConst)
            {
                throw new Exception("Expression must be constant");
            }

            for (var i = 0; i < structCall.variableNames.Count; i++)
            {
                if (i == 0)
                {
                    _stateInfo.lookForEnum = true;
                }

                var ast = structCall.variableNames[i];

                ast.Accept(this);

                if (i != structCall.variableNames.Count - 1)
                {
                    var structTypeInfo = _symTableManager.
                                         LookupTypeInfo(_stateInfo.currentFile, _stateInfo.currentType.ToString());

                    if (structTypeInfo == null ||
                        (structTypeInfo.kind == TypeKind.ENUM &&
                         structCall.variableNames[i].ToString() != structTypeInfo.type.ToString()))
                    {
                        throw new Exception("Invalid struct variable " + structCall.variableNames[i]);
                    }

                    _stateInfo.structOrEnum = structTypeInfo;
                }
            }

            _stateInfo.structOrEnum = null;
        }
Ejemplo n.º 2
0
 public override void Visit(StructMemberCallAST structMemberCall)
 {
 }
Ejemplo n.º 3
0
 public virtual void Visit(StructMemberCallAST structMemberCall)
 {
 }