コード例 #1
0
 public static MyError BadAttributeError(PyObj pyObj, IdentifierSegment identifierSegment)
 {
     return(new MyError(String.Format("El atributo: {0} no existe en el tipo: {1}",
                                      identifierSegment.Id,
                                      TypeConstants.GetMyTypeName(pyObj.GetMyType()))
                        ));
 }
コード例 #2
0
        //Retorna error o memblock
        public Word GetMember(IdentifierSegment identifierSegment)
        {
            if (Visitor == null)
            {
                throw new Exception("Tiene que inicializar visitor con InitVisitor antes de usar cualquier GetMember");
            }
            var result      = Visitor.GetGlobalAttribute(identifierSegment);
            var firstResult = result;

            if (!result.IsError())
            {
                return(result);
            }
            foreach (var import in Imports)
            {
                result = import.GetMember(identifierSegment);
                if (!result.IsError())
                {
                    return(result);
                }
            }
            return(firstResult);
        }
コード例 #3
0
 public Word GetGlobalAttribute(IdentifierSegment identifierSegment)
 {
     return(GlobalScope.Get(identifierSegment.Id));
 }