Example #1
0
        internal void AddPropertyTag(Arc start, Arc end, CfgGrammar.CfgProperty propertyInfo)
        {
            Tag tag = new Tag(this, propertyInfo);

            _tags.Add(tag);
            start.AddStartTag(tag);
            end.AddEndTag(tag);
        }
Example #2
0
        internal void AddSemanticInterpretationTag(Arc arc, CfgGrammar.CfgProperty propertyInfo)
        {
            Tag tag = new Tag(this, propertyInfo);

            _tags.Add(tag);
            arc.AddStartTag(tag);
            arc.AddEndTag(tag);
        }
Example #3
0
        internal CfgSemanticTag(StringBlob symbols, CfgGrammar.CfgProperty property)
        {
            int iWord;

            _flag1       = _flag2 = _flag3 = 0;
            _valueOffset = 0;
            _varInt      = 0;
            _varDouble   = 0;

            _propId = property._ulId;
            if (property._pszName != null)
            {
                _nameOffset = symbols.Add(property._pszName, out iWord);
            }
            else
            {
                _nameOffset = 0; // Offset must be zero if no string
            }
#pragma warning disable 0618     // VarEnum is obsolete
            switch (property._comType)
            {
            case 0:
            case VarEnum.VT_BSTR:
                if (property._comValue != null)
                {
                    _valueOffset = symbols.Add((string)property._comValue, out iWord);
                }
                else
                {
                    _valueOffset = 0;     // Offset must be zero if no string
                }
                break;

            case VarEnum.VT_I4:
                _varInt = (int)property._comValue;
                break;

            case VarEnum.VT_BOOL:
                _varInt = (bool)property._comValue ? unchecked (0xffff) : 0;
                break;

            case VarEnum.VT_R8:
                _varDouble = (double)property._comValue;
                break;

            default:
                System.Diagnostics.Debug.Assert(false, "Unknown Semantic Tag type");
                break;
            }
#pragma warning restore 0618
            PropVariantType = property._comType;
            ArcIndex        = 0;
        }
Example #4
0
        internal CfgSemanticTag(StringBlob symbols, CfgGrammar.CfgProperty property)
        {
            _flag1       = (_flag2 = (_flag3 = 0u));
            _valueOffset = 0;
            _varInt      = 0;
            _varDouble   = 0.0;
            _propId      = property._ulId;
            int idWord;

            if (property._pszName != null)
            {
                _nameOffset = symbols.Add(property._pszName, out idWord);
            }
            else
            {
                _nameOffset = 0;
            }
            switch (property._comType)
            {
            case VarEnum.VT_EMPTY:
            case VarEnum.VT_BSTR:
                if (property._comValue != null)
                {
                    _valueOffset = symbols.Add((string)property._comValue, out idWord);
                }
                else
                {
                    _valueOffset = 0;
                }
                break;

            case VarEnum.VT_I4:
                _varInt = (int)property._comValue;
                break;

            case VarEnum.VT_BOOL:
                _varInt = (((bool)property._comValue) ? 65535 : 0);
                break;

            case VarEnum.VT_R8:
                _varDouble = (double)property._comValue;
                break;
            }
            PropVariantType = property._comType;
            ArcIndex        = 0u;
        }
Example #5
0
 internal Tag(Backend be, CfgGrammar.CfgProperty property)
 {
     _be     = be;
     _cfgTag = new CfgSemanticTag(be.Symbols, property);
 }