public override void Visit(EnumAST enumAST) { var typeInfo = new CustomTypeInfo { type = enumAST, kind = TypeKind.ENUM, scopeId = _currentScope.id, position = _currentNodePosition, memberNameType = new Dictionary <string, TypeAST>() }; foreach (var member in enumAST.Values) { var variableDec = member as VariableDecAST; typeInfo.memberNameType.Add(variableDec.Name, variableDec.Type); } AddType(typeInfo); if (_currentScope.id != 0) { return; } GlobalTypes.Add(enumAST.Name); }
public override void Visit(EnumAST enumAST) { foreach (var enumValue in enumAST.Values) { var variableDecAssign = enumValue as VariableDecAssignAST; if (variableDecAssign == null) { continue; } var enumAssignExprType = _exprTypeVisitor.GetAstNodeType(_currentFileName, _currentScopeId, _currentNodePosition, variableDecAssign.ExpressionValue, true); if (!Vocabulary.Ints.Contains(enumAssignExprType.ToString())) { throw new Exception("Invalid enum assignment type"); } } }
public override void Visit(EnumAST enumAST) { }
public virtual void Visit(EnumAST enumAST) { }