Esempio n. 1
0
        protected override int GetHashCode(ISymbolTableProvider symbolTableProvider)
        {
            var result = HashSignature;

            if (IsNullValue())
            {
                return(HashTypeAnnotations(result, symbolTableProvider));
            }

            if (_bigInteger == null)
            {
                var lv = LongValue;
                // Throw away top 32 bits if they're not interesting.
                // Otherwise n and -(n+1) get the same hash code.
                result ^= (int)lv;
                var hiWord = (int)(lv >> 32);
                if (hiWord != 0 && hiWord != -1)
                {
                    result ^= hiWord;
                }
            }
            else
            {
                result = _bigInteger.Value.GetHashCode();
            }

            return(HashTypeAnnotations(result, symbolTableProvider));
        }
Esempio n. 2
0
        public static UnboundReferences ParseBimlFiles(IEnumerable<BimlFile> bimlFiles, ISymbolTableProvider astRootNode, LanguageSettings languageSettings)
        {
            var unboundReferences = new UnboundReferences();
            foreach (BimlFile bimlFile in bimlFiles)
            {
                var xdocument = bimlFile.XDocument;
                if (xdocument != null && xdocument.Root != null)
                {
                    try
                    {
                        SideEffectManager.SideEffectMode = AstSideEffectMode.NoSideEffects;
                        ParseDocument(bimlFile, astRootNode, unboundReferences, languageSettings);
                        SideEffectManager.SideEffectMode = AstSideEffectMode.ConsistencySideEffects;

                        bimlFile.IsParseable = true;
                    }
                    catch (Exception)
                    {
                        bimlFile.IsParseable = false;
                    }
                }
            }

            unboundReferences.ResolveAll(astRootNode.SymbolTable);
            return unboundReferences;
        }
Esempio n. 3
0
 protected override int GetHashCode(ISymbolTableProvider symbolTableProvider)
 {
     if (!IsNull)
     {
         return(BooleanValue ? TrueHash : FalseHash);
     }
     return(HashTypeAnnotations(HashSignature, symbolTableProvider));
 }
Esempio n. 4
0
        protected override void WriteBodyTo(IIonWriter writer, ISymbolTableProvider symbolTableProvider)
        {
            if (IsNullValue())
            {
                writer.WriteNull(IonType.Bool);
                return;
            }

            writer.WriteBool(IsBoolTrue());
        }
Esempio n. 5
0
        protected override int GetHashCode(ISymbolTableProvider symbolTableProvider)
        {
            var result = HashSignature;

            if (!IsNullValue())
            {
                result ^= TextValue.GetHashCode();
            }

            return(HashTypeAnnotations(result, symbolTableProvider));
        }
Esempio n. 6
0
 protected override void WriteBodyTo(IIonWriter writer, ISymbolTableProvider symbolTableProvider)
 {
     if (IsNullValue())
     {
         writer.WriteNull(IonType.Int);
     }
     else if (_bigInteger != null)
     {
         writer.WriteInt(_bigInteger.Value);
     }
     else
     {
         writer.WriteInt(_longValue);
     }
 }
Esempio n. 7
0
 protected override void WriteBodyTo(IIonWriter writer, ISymbolTableProvider symbolTableProvider)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 8
0
 protected override int GetHashCode(ISymbolTableProvider symbolTableProvider)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 9
0
 protected override void WriteBodyTo(IIonWriter writer, ISymbolTableProvider symbolTableProvider) => writer.WriteNull();
Esempio n. 10
0
 protected override int GetHashCode(ISymbolTableProvider symbolTableProvider)
 => HashTypeAnnotations(HashSignature, symbolTableProvider);
Esempio n. 11
0
        public static UnboundReferences ParseBimlFiles(IEnumerable <BimlFile> bimlFiles, ISymbolTableProvider astRootNode, LanguageSettings languageSettings)
        {
            var unboundReferences = new UnboundReferences();

            foreach (BimlFile bimlFile in bimlFiles)
            {
                var xdocument = bimlFile.XDocument;
                if (xdocument != null && xdocument.Root != null)
                {
                    try
                    {
                        SideEffectManager.SideEffectMode = AstSideEffectMode.NoSideEffects;
                        ParseDocument(bimlFile, astRootNode, unboundReferences, languageSettings);
                        SideEffectManager.SideEffectMode = AstSideEffectMode.ConsistencySideEffects;

                        bimlFile.IsParseable = true;
                    }
                    catch (Exception)
                    {
                        bimlFile.IsParseable = false;
                    }
                }
            }

            unboundReferences.ResolveAll(astRootNode.SymbolTable);
            return(unboundReferences);
        }
Esempio n. 12
0
 protected override void WriteBodyTo(IIonWriter writer, ISymbolTableProvider symbolTableProvider) => writer.WriteString(TextValue);