コード例 #1
0
ファイル: Symbol.cs プロジェクト: mobilligy/scriptsharp
 protected Symbol(SymbolType type, string name, Symbol parent)
 {
     _type = type;
     _name = name;
     _parent = parent;
     _transformAllowed = true;
 }
コード例 #2
0
ファイル: Symbol.cs プロジェクト: Konctantin/CSharpAssembler
 /// <summary>
 /// Initializes a new instance of the <see cref="Symbol"/> class.
 /// </summary>
 /// <param name="symbolType">The type of symbol.</param>
 public Symbol(SymbolType symbolType)
     : this(symbolType, null)
 {
     #region Contract
     Contract.Requires<InvalidEnumArgumentException>(Enum.IsDefined(typeof(SymbolType), symbolType));
     #endregion
 }
コード例 #3
0
        private static XamlShapes.Shape CreateSymbolFromVectorStyle(VectorStyle style, double opacity = 1, SymbolType symbolType = SymbolType.Ellipse, double width = SymbolStyle.DefaultWidth, double height = SymbolStyle.DefaultHeight)
        {
            var path = new XamlShapes.Path { StrokeThickness = 0 };  //The SL StrokeThickness default is 1 which causes blurry bitmaps

            if (style.Fill != null && (style.Fill.Color != null || style.Fill.BitmapId != -1))
                path.Fill = style.Fill.ToXaml();
            else
                path.Fill = new XamlMedia.SolidColorBrush(XamlColors.Transparent);

            if (style.Outline != null)
            {
                path.Stroke = new XamlMedia.SolidColorBrush(style.Outline.Color.ToXaml());
                path.StrokeThickness = style.Outline.Width;
                path.StrokeDashArray = style.Outline.PenStyle.ToXaml();
            }

            if (symbolType == SymbolType.Ellipse)
                path.Data = CreateEllipse(width, height);
            else
                path.Data = CreateRectangle(width, height);

            path.Opacity = opacity;

            return path;
        }
コード例 #4
0
ファイル: SingleGraph.cs プロジェクト: Kelvin312/KantVino
        public void AddCurve(GraphPane pane, string name, string measure, Color color, SymbolType sType, int capacity)
        {
            _dataPointList = new RollingPointPairList(capacity);

            // Добавим кривую пока еще без каких-либо точек
            _myCurve = pane.AddCurve(string.Format("{0} ({1})",name,measure), _dataPointList, color, sType);
        }
コード例 #5
0
ファイル: ClassSymbol.cs プロジェクト: mobilligy/scriptsharp
 protected ClassSymbol(SymbolType type, string name, NamespaceSymbol parent)
     : base(type, name, parent)
 {
     _inheritanceDepth = -1;
     _minimizationDepth = -1;
     _transformationCookie = -1;
 }
コード例 #6
0
ファイル: Symbol.cs プロジェクト: famerij/EdgeGraph
 public Symbol(char _symbol, SymbolType _type, Interpreter _interpreter, string _interpreterMethod)
 {
     symbol = _symbol;
     type = _type;
     interpreter = _interpreter;
     interpreterMethod = _interpreterMethod;
 }
コード例 #7
0
 /// <summary>
 /// Constuctor for function symbol
 /// </summary>
 /// <param name="name"></param>
 /// <param name="symbolType"></param>
 /// <param name="label"></param>
 /// <param name="paramList"></param>
 /// <param name="returnVar"></param>
 public FunctionSymbol(string name,SymbolType symbolType,string label,
     List<Parameter> paramList,VariableType returnVar)
     : base(name,symbolType,label,paramList)
 {
     this.returnVar = returnVar;
     this.variableType = returnVar;
 }
 public GrammarNodeDExistsVisitor(String nameIn, SymbolType symbolTypeIn)
 {
     name = nameIn;
     symbolType = symbolTypeIn;
     rulesVisited = new List<NonterminalHeadD>();
     found = false;
 }
コード例 #9
0
ファイル: Symbol.cs プロジェクト: si2dharth/Learntronics
 public static Symbol create(SymbolType type)
 {
     Transform t = null;
     switch (type) {
         case SymbolType.Resistor:
             t = Instantiate(parent.resistorSym.transform) as Transform;
             break;
         case SymbolType.Lamp:
             t = Instantiate(parent.lampSym.transform) as Transform;
             break;
         case SymbolType.Switch:
             t = Instantiate(parent.switchSym.transform) as Transform;
             break;
         case SymbolType.Battery:
             t = Instantiate(parent.batterySym.transform) as Transform;
             break;
         case SymbolType.And:
             t = Instantiate(parent.andSym.transform) as Transform;
             break;
         case SymbolType.Or:
             t = Instantiate(parent.orSym.transform) as Transform;
             break;
         case SymbolType.Not:
             t = Instantiate(parent.notSym.transform) as Transform;
             break;
         default:
             return null;
     }
     return t.GetComponent(typeof(Symbol)) as Symbol;
 }
コード例 #10
0
 /// <summary>
 /// Constructor for parameter symbol
 /// </summary>
 /// <param name="name"></param>
 /// <param name="symbolType"></param>
 /// <param name="parameter"></param>
 public ParameterSymbol(string name,SymbolType symbolType, Parameter parameter,
     VariableType variableType)
     : base(name,symbolType)
 {
     base.variableType = variableType;
     this.parameter = parameter;
 }
コード例 #11
0
 /// <summary>
 /// Constructor for Procedure Symbol
 /// </summary>
 /// <param name="name"></param>
 /// <param name="symbolType"></param>
 /// <param name="label"></param>
 /// <param name="paramList"></param>
 public ProcedureSymbol(string name, SymbolType symbolType,string label,
     List<Parameter> paramList)
     : base(name, symbolType)
 {
     this.label = label;
     this.paramList = paramList;
 }
コード例 #12
0
ファイル: LineHelper.cs プロジェクト: hkiaipc/fnq
 /// <summary>
 /// 
 /// </summary>
 /// <param name="text"></param>
 /// <param name="color"></param>
 /// <param name="width"></param>
 /// <param name="symbol"></param>
 public LineHelper(string text, Color color, int width, SymbolType symbol)
 {
     this.Text = text;
     this.Color = color;
     this.LineWidth = width;
     this.SymbolType = symbol;
 }
コード例 #13
0
ファイル: Label.cs プロジェクト: Konctantin/CSharpAssembler
 /// <summary>
 /// Initializes a new instance of the <see cref="Label"/> class
 /// that defines a symbol with the specified type and identifier.
 /// </summary>
 /// <param name="identifier">The identifier of the defined symbol.</param>
 /// <param name="symbolType">The type of symbol defined.</param>
 /// <remarks>
 /// The <see cref="DefinedSymbol"/> property holds the symbol that is defined.
 /// </remarks>
 public Label(string identifier, SymbolType symbolType)
     : this(new Symbol(symbolType, identifier))
 {
     #region Contract
     Contract.Requires<InvalidEnumArgumentException>(Enum.IsDefined(typeof(SymbolType), symbolType));
     #endregion
 }
コード例 #14
0
ファイル: Symbol.cs プロジェクト: kkkkkt/PSM_SDK_SLOT
 /// <summary>
 /// コンストラクタ
 /// </summary>
 public Symbol(SpriteUV sprite, SymbolType type)
 {
     sprite.Scale = new Sce.PlayStation.Core.Vector2(1.0f);
     sprite.Quad.S = sprite.TextureInfo.TextureSizef;
     sprite.CenterSprite();
     Image = sprite;
     Type = type;
 }
コード例 #15
0
ファイル: TypeSymbol.cs プロジェクト: fugaku/scriptsharp
        protected TypeSymbol(SymbolType type, string name, NamespaceSymbol parent)
            : base(type, name, parent) {
            Debug.Assert(parent != null);

            _memberTable = new Dictionary<string, MemberSymbol>();
            _members = new List<MemberSymbol>();
            _applicationType = true;
        }
コード例 #16
0
 /// <summary>
 /// Constructor for Variable Symbol
 /// </summary>
 /// <param name="name"></param>
 /// <param name="size"></param>
 /// <param name="offset"></param>
 public VariableSymbol( string name, SymbolType symbolType, VariableType var,int size, 
     int offset)
     : base(name,symbolType)
 {
     this.size = size;
     this.offset = offset;
     this.variableType = var;
 }
コード例 #17
0
ファイル: Symbol.cs プロジェクト: Konctantin/CSharpAssembler
        /// <summary>
        /// Initializes a new instance of the <see cref="Symbol"/> class.
        /// </summary>
        /// <param name="symbolType">The type of symbol.</param>
        /// <param name="identifier">The identifier of the symbol; or <see langword="null"/>.</param>
        public Symbol(SymbolType symbolType, string identifier)
        {
            #region Contract
            Contract.Requires<InvalidEnumArgumentException>(Enum.IsDefined(typeof(SymbolType), symbolType));
            #endregion

            this.symbolType = symbolType;
            this.identifier = identifier;
        }
コード例 #18
0
ファイル: GrammarRule.cs プロジェクト: thomasfn/Taron
 /// <summary>
 /// Gets the index of the specified symbol type in the match list, or -1 if not found
 /// </summary>
 /// <param name="symbol"></param>
 /// <param name="offset"></param>
 /// <returns></returns>
 public int IndexOfMatchSymbol(SymbolType symbol, int offset = 0)
 {
     for (int i = offset; i < MatchSymbols.Length; i++)
     {
         if (MatchSymbols[i] == symbol)
             return i;
     }
     return -1;
 }
コード例 #19
0
ファイル: Line.cs プロジェクト: eprimo/Linc-Reporting-Service
 public Line()
 {
     mVisible = true;
     mLabel = "";
     mPoints = new DataPointList();
     mColor = Color.Black;
     mWidth = 1;
     mSymbolType = SymbolType.None;
 }
コード例 #20
0
ファイル: Line.cs プロジェクト: eprimo/Linc-Reporting-Service
 public Line(string label, DataPointList points)
 {
     mVisible = true;
     mLabel = label;
     mPoints = points;
     mColor = Color.Black;
     mWidth = 1;
     mSymbolType = SymbolType.None;
 }
コード例 #21
0
ファイル: Symbol.cs プロジェクト: kopelli/Visual-StyleCop
        /// <summary>
        /// Initializes a new instance of the Symbol class.
        /// </summary>
        /// <param name="text">
        /// The item text.
        /// </param>
        /// <param name="symbolType">
        /// The symbol type.
        /// </param>
        /// <param name="location">
        /// The location of the token within the code document.
        /// </param>
        internal Symbol(string text, SymbolType symbolType, CodeLocation location)
        {
            Param.AssertValidString(text, "text");
            Param.Ignore(symbolType);
            Param.AssertNotNull(location, "location");

            this.text = text;
            this.symbolType = symbolType;
            this.location = location;
        }
コード例 #22
0
ファイル: SymbolTable.cs プロジェクト: walter-artica/r5asm
 public Symbol(SymbolType symt, string name, uint val)
 {
     this.type = symt;
     this.name = name;
     this.val = val;
     this.sectType = SectionType.Null;
     this.exported = false;
     this.index = 0;
     this.strindex = 0;
 }
コード例 #23
0
ファイル: BaseGraphClass.cs プロジェクト: windygu/asxinyunet
		public static void CreateChartForInt(ZedGraphControl zgc ,int[] data,
		                                     string titleName ,string lblName,
		                                     Color color,SymbolType symType )
		{
			double[] res = new double[data.Length ] ;
			for (int i = 0 ; i <data.Length ; i ++)
			{
				res [i ] = (double )data [i ] ;
			}
			CreateChartForDouble(zgc ,res , titleName ,lblName ,color ,symType ) ;
		}
コード例 #24
0
ファイル: TypeHelper.cs プロジェクト: paulochang/DecafIde
 public static SymbolType getGreatestType(SymbolType leftType, SymbolType rightType)
 {
     if (!isEquivalentType(leftType, rightType))
         throw new Exception("Incomparable types");
     else
     {
         if (leftType == rightType)
             return leftType;
         else
             return SymbolType.Tint;
     }
 }
コード例 #25
0
 public void AddCurve(string label, double[] xData, double[] yData,
     Color color, SymbolType symbolType, bool isLineVisible)
 {
     CurveProperties item = new CurveProperties();
     item.label = label;
     item.xData = xData;
     item.yData = yData;
     item.color = color;
     item.simbolType = symbolType;
     item.isLineVisible = isLineVisible;
     this.curveItems.Add(item);
 }
コード例 #26
0
ファイル: Verifier.cs プロジェクト: Throttle/compiler
        public Symbol Add(string name, SymbolType type, object syntaxObject, object codeObject)
        {
            string prefix = PrefixFromType(type);

            if (m_Hashtable.Contains(prefix + name))
                throw new Exception("Symbol already exists in symbol table.");

            Symbol symbol = new Symbol(name, type, syntaxObject, codeObject);
            m_Hashtable.Add(prefix + name, symbol);

            return symbol;
        }
コード例 #27
0
        /// <summary>
        /// Create a new <see cref="FilledLineItem"/> using the specified properties.
        /// </summary>
        /// <param name="label">The _label that will appear in the legend.</param>
        /// <param name="upperPoints">A <see cref="IPointList"/> of double precision value pairs that define
        /// the X and upper Y values for this curve</param>
        /// <param name="lowerPoints">A <see cref="IPointList"/> of double precision value pairs that define
        /// the X and lower Y values for this curve</param>
        /// <param name="color">A <see cref="System.Drawing.Color"/> value that will be applied to
        /// the <see cref="Line"/> and <see cref="Symbol"/> properties.
        /// </param>
        /// <param name="symbolType">A <see cref="SymbolType"/> enum specifying the
        /// type of symbol to use for this <see cref="LineItem"/>.  Use <see cref="SymbolType.None"/>
        /// to hide the symbols.</param>
        /// <param name="lineWidth">The width (in points) to be used for the <see cref="Line"/>.  This
        /// width is scaled based on <see cref="PaneBase.CalcScaleFactor"/>.  Use a value of zero to
        /// hide the line (see <see cref="ZedGraph.LineBase.IsVisible"/>).</param>
        public FilledLineItem( string label, IPointList upperPoints, IPointList lowerPoints, System.Drawing.Color color, SymbolType symbolType, float lineWidth )
            : base(label)
        {
            Points = upperPoints ?? new PointPairList();
            LowerPoints = lowerPoints ?? new PointPairList();

            _line = new FilledLine( color );
            if ( lineWidth == 0 )
                _line.IsVisible = false;
            else
                _line.Width = lineWidth;

            _symbol = new Symbol( symbolType, color );
        }
コード例 #28
0
        /// <summary>
        /// Constructs and instance of a SymbolReference
        /// </summary>
        /// <param name="symbolType">The higher level type of the symbol</param>
        /// <param name="scriptExtent">The script extent of the symbol</param>
        /// <param name="filePath">The file path of the symbol</param>
        /// <param name="sourceLine">The line contents of the given symbol (defaults to empty string)</param>
        public SymbolReference(SymbolType symbolType, IScriptExtent scriptExtent, string filePath = "", string sourceLine = "")
        {
            // TODO: Verify params
            this.SymbolType = symbolType;
            this.SymbolName = scriptExtent.Text;
            this.ScriptRegion = ScriptRegion.Create(scriptExtent);
            this.FilePath = filePath;
            this.SourceLine = sourceLine;

            // TODO: Make sure end column number usage is correct

            // Build the display string
            //this.DisplayString =
            //    string.Format(
            //        "{0} {1}")
        }
コード例 #29
0
ファイル: Program.cs プロジェクト: jan-fri/Translation
        private void AnalizeLecsicalSymbolType()
        {
            for (_counter = 0; _counter < _line.Length; _counter++)
            {
                if (_error)
                    break;

                _symbol = _line[_counter];

                if (_symbol == '(')
                {
                    _lecsicalSymbolType = SymbolType.left_parenthesis;
                    Console.WriteLine("{0}: {1}", _lecsicalSymbolType, _symbol);
                }
                else if (_symbol == ')')
                {
                    _lecsicalSymbolType = SymbolType.right_parenthesis;
                    Console.WriteLine("{0}: {1}", _lecsicalSymbolType, _symbol);
                }
                else if (_symbol == '*' || _symbol == '+' || _symbol == '/' || _symbol == '-')
                {
                    _lecsicalSymbolType = SymbolType.operation;
                    Console.WriteLine("{0}: {1}", _lecsicalSymbolType, _symbol);
                }
                else if (char.IsDigit(_symbol))
                {
                    _lecsicalSymbolType = SymbolType.integer;
                    GetNumber();
                }
                else if (char.IsLetter(_symbol))
                {
                    _lecsicalSymbolType = SymbolType.identifier;
                    GetWord();
                }
                else if (char.IsWhiteSpace(_symbol))
                {
                    continue;
                }
                else
                {
                    Console.WriteLine("Symbol not recognized, canceling translation");
                    break;
                }

            }
        }
コード例 #30
0
ファイル: CompilerService.cs プロジェクト: pauliv2/OneScript
        public int DefineVariable(string name, SymbolType type)
        {
            RegisterScopeIfNeeded();

            try
            {
                int varIdx;
                if (type == SymbolType.Variable)
                    varIdx = _currentContext.DefineVariable(name).CodeIndex;
                else
                    varIdx = _currentContext.DefineProperty(name).CodeIndex;

                _predefinedVariables.Add(varIdx);
                return varIdx;
            }
            catch
            {
                _currentContext.PopScope();
                _scope = null;
                throw;
            }
        }
コード例 #31
0
ファイル: GraphingBase.cs プロジェクト: diehard2/stochfit
        protected virtual void AddCurvetoGraph(PointPairList list, string DataName, Color linecolor, SymbolType type, int symbolsize, DashStyle style, bool isSmoothed, string tag)
        {
            LineItem myCurve = m_cMyPane.AddCurve(DataName, list, linecolor, type);

            myCurve.Symbol.Fill          = new Fill(Color.DeepSkyBlue, Color.Red);
            myCurve.Symbol.Fill.Type     = FillType.GradientByZ;
            myCurve.Symbol.Fill.RangeMin = 0;
            myCurve.Symbol.Fill.RangeMax = 1;
            myCurve.Symbol.Size          = symbolsize;
            myCurve.Line.Style           = style;
            myCurve.Line.IsAntiAlias     = true;
            myCurve.Tag = tag;

            myCurve.Line.IsSmooth = isSmoothed;
        }
コード例 #32
0
ファイル: LineItem.cs プロジェクト: ziyushijie/VSCodeDemo
 /// <summary>
 /// Create a new <see cref="LineItem"/> using the specified properties.
 /// </summary>
 /// <param name="label">The _label that will appear in the legend.</param>
 /// <param name="points">A <see cref="IPointList"/> of double precision value pairs that define
 /// the X and Y values for this curve</param>
 /// <param name="color">A <see cref="Color"/> value that will be applied to
 /// the <see cref="Line"/> and <see cref="Symbol"/> properties.
 /// </param>
 /// <param name="symbolType">A <see cref="SymbolType"/> enum specifying the
 /// type of symbol to use for this <see cref="LineItem"/>.  Use <see cref="SymbolType.None"/>
 /// to hide the symbols.</param>
 public LineItem(string label, IPointList points, Color color, SymbolType symbolType)
     : this(label, points, color, symbolType, ZedGraph.LineBase.Default.Width)
 {
 }
コード例 #33
0
 protected MemberSymbol(SymbolType type, string name, TypeSymbol parent, TypeSymbol associatedType)
     : base(type, name, parent)
 {
     AssociatedType = associatedType;
 }
コード例 #34
0
        public bool IsArgumentTypeCompatible(SymbolType parameterType, Data argument)
        {
            switch (parameterType)
            {
            case SymbolType.Int:
                if (argument.Type == SymbolType.Int || argument.Type == SymbolType.Instance)
                {
                    // TODO think about giving warning if somebody passes instance to int argument
                    return(true);
                }
                break;

            case SymbolType.Float:

                if (argument.Type == SymbolType.Int && argument.Category == DataCategory.Literal)
                {
                    return(true);
                }

                if (argument.Type == SymbolType.Float)
                {
                    if (argument.Category == DataCategory.Literal || argument.Category == DataCategory.Variable)
                    {
                        return(true);
                    }
                }

                break;

            case SymbolType.String:
                if (argument.Type == SymbolType.String)
                {
                    return(true);
                }

                break;

            case SymbolType.Instance:
                if (argument.Type == SymbolType.Instance && argument.Category == DataCategory.Variable)
                {
                    return(true);
                }

                break;

            case SymbolType.Func:
                if (argument.Type == SymbolType.Func && argument.Category == DataCategory.Variable)
                {
                    return(true);
                }

                if (argument.Type == SymbolType.Instance && argument.Category == DataCategory.Variable)
                {
                    return(true);
                }

                break;
            }

            return(false);
        }
コード例 #35
0
 private static void DrawPointWithVectorStyle(SKCanvas canvas, VectorStyle vectorStyle,
                                              Point destination, float opacity, SymbolType symbolType = SymbolType.Ellipse)
 {
     canvas.Save();
     canvas.Translate((float)destination.X, (float)destination.Y);
     DrawPointWithVectorStyle(canvas, vectorStyle, opacity, symbolType);
     canvas.Restore();
 }
コード例 #36
0
 private bool AreEqulSymbolTypes(SymbolType type)
 {
     return(type == currentSymbolType);
 }
コード例 #37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Iodine.Compiler.Symbol"/> class.
 /// </summary>
 /// <param name="type">Type of symbol.</param>
 /// <param name="name">Name of the symbol.</param>
 /// <param name="index">Symbol index.</param>
 public Symbol(SymbolType type, string name, int index)
 {
     Name  = name;
     Index = index;
     Type  = type;
 }
コード例 #38
0
ファイル: Symbol.cs プロジェクト: usamabintariq/NCache
        /* constructor */

        /// Creates a new Symbol object.
        internal Symbol(int p_index, String p_name, SymbolType p_kind)
        {
            m_tableIndex = p_index;
            m_name       = p_name;
            m_kind       = p_kind;
        }
コード例 #39
0
 public LabelInfo(SymbolType type = SymbolType.Undefined, int address = 0)
     : this()
 {
     Type    = type;
     Address = address;
 }
コード例 #40
0
 protected LocalSymbol(SymbolType type, string name, MemberSymbol parent, TypeSymbol valueType)
     : base(type, name, parent)
 {
     ValueType = valueType;
 }
コード例 #41
0
ファイル: Symbol.cs プロジェクト: usamabintariq/NCache
 ///
 internal protected void CopyData(Symbol p_symbol)
 {
     m_name       = p_symbol.Name;
     m_kind       = p_symbol.Kind;
     m_tableIndex = p_symbol.TableIndex;
 }
コード例 #42
0
 protected PropertySymbol(SymbolType type, string name, TypeSymbol parent, TypeSymbol propertyType)
     : base(type, name, parent, propertyType)
 {
 }
コード例 #43
0
ファイル: Function.cs プロジェクト: chhoumann/p4
 protected Function(SymbolType returnType)
 {
     ReturnType = returnType;
 }
コード例 #44
0
ファイル: GraphingBase.cs プロジェクト: diehard2/stochfit
        protected virtual void AddCurvetoGraph(PointPairList list, PointPairList elist, string DataName, Color linecolor, SymbolType type, int symbolsize, string tag)
        {
            LineItem myCurve = m_cMyPane.AddCurve(DataName, list, linecolor, type);

            myCurve.Symbol.Fill          = new Fill(Color.DeepSkyBlue, Color.Red);
            myCurve.Symbol.Fill.Type     = FillType.GradientByZ;
            myCurve.Symbol.Fill.RangeMin = 0;
            myCurve.Symbol.Fill.RangeMax = 1;
            myCurve.Symbol.Size          = symbolsize;
            myCurve.Line.IsAntiAlias     = true;
            myCurve.Line.IsSmooth        = true;
            myCurve.Tag = tag;

            if (elist != null)
            {
                ErrorBarItem myECurve;
                myECurve = m_cMyPane.AddErrorBar("", elist, Color.Black);
                myECurve.Bar.PenWidth = 1f;
                // Use the HDash symbol so that the error bars look like I-beams

                myECurve.Bar.Symbol.Type = SymbolType.HDash;
                /// myECurve.Bar.Symbol.Border.Width = .1f;
                myECurve.Bar.Symbol.IsVisible = true;
                myECurve.Bar.Symbol.Size      = 2;
            }
        }
コード例 #45
0
        /// <summary>
        /// Inserts a new symbol with defined parameters into the lookup structure.
        /// </summary>
        /// <param name="name">Name.</param>
        /// <param name="start">Start.</param>
        /// <param name="size">Size.</param>
        /// <param name="type">SymbolType.</param>
        /// <param name="binding">Symbol binding</param>
        /// <param name="isThumb">If set to <c>true</c>, symbol is marked as a thumb symbol.</param>
        public void InsertSymbol(string name, SymbolAddress start, SymbolAddress size, SymbolType type = SymbolType.NotSpecified, SymbolBinding binding = SymbolBinding.Global, bool isThumb = false)
        {
            var symbol = new Symbol(start, start + size, name, type, binding, isThumb);

            InsertSymbol(symbol);
        }
コード例 #46
0
 public virtual bool Visit(SymbolType symbolType)
 {
     return(true);
 }
コード例 #47
0
        public Symbol GetSymbolByType(SymbolType type)
        {
            int idx = GetSymbolIdxByType(type);

            return((idx == -1) ? null : Symbols[idx]);
        }
コード例 #48
0
 public VisualMap ItemSymbol(SymbolType itemSymbol)
 {
     this.itemSymbol = itemSymbol;
     return(this);
 }
コード例 #49
0
ファイル: Symbol.cs プロジェクト: MatthewChrobak/GC-Toolchain
 private Symbol()
 {
     this.Type = SymbolType.Token;
     this.ID   = "$";
     this.Tag  = null;
 }
コード例 #50
0
 public void WriteResultToFile(SymbolType type)
 {
     fileWriter.WriteLine(type.ToString());
 }
コード例 #51
0
        public Compability GetAssignmentCompability(SymbolType lValueType, Data rValue)
        {
            switch (lValueType)
            {
            case SymbolType.Int:
                if (rValue.Type == SymbolType.Int)
                {
                    return(Compability.Full);
                }

                if (rValue.Type == SymbolType.Instance && rValue.Category == DataCategory.Variable)
                {
                    // TODO, check if this is worth supporting
                    return(Compability.Full);
                }

                break;

            case SymbolType.Float:

                if (rValue.Type == SymbolType.Int && rValue.Category == DataCategory.Literal)
                {
                    // var float x;
                    // x = 2; // 2 can be counted as IntegerLiteral or FloatLiteral
                    return(Compability.Full);
                }

                if (rValue.Type == SymbolType.Float)
                {
                    if (rValue.Category == DataCategory.Literal || rValue.Category == DataCategory.FunctionInvocation)
                    {
                        return(Compability.Full);
                    }
                }

                break;

            case SymbolType.String:
                if (rValue.Type == SymbolType.String)
                {
                    return(Compability.Full);
                }

                break;

            case SymbolType.Instance:
                if (rValue.Type == SymbolType.Instance && rValue.Category == DataCategory.FunctionInvocation)
                {
                    return(Compability.Full);
                }

                break;

            case SymbolType.Func:
                if (rValue.Type == SymbolType.Func && rValue.Category == DataCategory.Variable)
                {
                    return(Compability.Full);
                }

                if (rValue.Type == SymbolType.Instance && rValue.Category == DataCategory.Variable)
                {
                    return(Compability.Full);
                }

                break;
            }

            return(Compability.None);
        }
コード例 #52
0
ファイル: BadgeSymbol.cs プロジェクト: why/HGroupBadge
 public BadgeSymbol(SymbolType type, BadgeColor color, BadgePosition position)
 {
     Type     = type;
     Color    = color;
     Position = position;
 }
コード例 #53
0
 public SymbolToken(SymbolType type) =>
コード例 #54
0
        /// <summary>
        /// Creates DatSymbol from Symbol
        /// </summary>
        public DatSymbol(Symbol symbol)
        {
            IsFunction    = symbol is FunctionSymbol;
            IsAddressable = symbol is BlockSymbol;

            Index = symbol.Index;
            Name  = symbol.Path;

            switch (symbol)
            {
            case FunctionSymbol functionSymbol:
                OffClsRet = (uint)functionSymbol.BuiltinType;
                break;

            case AttributeSymbol attributeSymbol:
                OffClsRet = (uint)attributeSymbol.Offset;
                break;

            case ClassSymbol classSymbol:
                OffClsRet = (uint)classSymbol.Size;
                break;

            default:
                OffClsRet = 0;
                break;
            }


            switch (symbol)
            {
            case FunctionSymbol functionSymbol:
                Count = (uint)functionSymbol.ParametersCount;
                break;

            case ClassSymbol classSymbol:
                Count = (uint)classSymbol.AttributesCount;
                break;

            case IArraySymbol arraySymbol:
                Count = (uint)arraySymbol.Size;
                break;

            case ExternalParameterSymbol _:
                Count = 0;
                break;

            case PrototypeSymbol _:
                Count = 0;
                break;

            case InstanceSymbol _:
                Count = 0;
                break;

            default:
                Count = 1;
                break;
            }

            BuiltinType = IsFunction ? SymbolType.Func : symbol.BuiltinType;
            if (symbol is ConstSymbol && symbol.BuiltinType == SymbolType.Func)
            {
                BuiltinType = SymbolType.Int;
            }

            Flags = symbol.Flags;

            if (!symbol.Path.StartsWith(".")) // .HELPER_INSTANCE symbol (used for nested attributes) is automatically created
            {
                FileIndex  = (uint)symbol.Node.Location.FileIndex;
                Line       = (uint)symbol.Node.Location.Line;
                LinesCount = (uint)symbol.Node.Location.LinesCount;
                Column     = (uint)symbol.Node.Location.Column;
                CharsCount = (uint)symbol.Node.Location.CharsCount;
            }

            switch (symbol)
            {
            case ClassSymbol classSymbol:
                Content = new object[] { classSymbol.Offset };
                break;

            case BlockSymbol blockSymbol:
                Content = new object[] { blockSymbol.FirstTokenAddress };
                break;

            case AttributeSymbol _:
                Content = new object[] {};
                break;

            case StringConstSymbol stringConstSymbol:
                Content = stringConstSymbol.Content;
                break;

            case ConstSymbol constSymbol:
                Content = constSymbol.Content;
                break;

            case VarSymbol _:
                Content = new object[Count];
                for (int i = 0; i < Count; ++i)
                {
                    switch (BuiltinType)
                    {
                    case SymbolType.String:
                        Content[i] = "";
                        break;

                    case SymbolType.Float:
                        Content[i] = 0.0f;
                        break;

                    default:
                        Content[i] = 0;
                        break;
                    }
                }
                break;

            case ExternalParameterSymbol externalParameterSymbol:
                if (externalParameterSymbol.BuiltinType == SymbolType.Instance || externalParameterSymbol.BuiltinType == SymbolType.Func)
                {
                    Content = new object[] { 0 };
                }
                else
                {
                    Content = new object[] {};
                }
                break;

            case ParameterSymbol _:
                switch (BuiltinType)
                {
                case SymbolType.String:
                    Content = new object[] { "" };
                    break;

                case SymbolType.Float:
                    Content = new object[] { 0.0f };
                    break;

                default:
                    Content = new object[] { 0 };
                    break;
                }
                break;

            default:
                Content = new object[] {};
                break;
            }

            ParentIndex = -1;
            switch (symbol)
            {
            case SubclassSymbol subclassSymbol:
                if (subclassSymbol.Path.StartsWith("."))     // .HELPER_INSTANCE symbol (used for nested attributes) is automatically created
                {
                    ParentIndex = -1;
                }
                else
                {
                    ParentIndex = subclassSymbol.InheritanceParentSymbol.Index;
                }

                break;

            case AttributeSymbol attributeSymbol:
                ParentIndex = attributeSymbol.ParentBlockSymbol.Index;
                break;

            case VarSymbol varSymbol:
                if (varSymbol.ComplexType is ClassSymbol classSymbol)
                {
                    ParentIndex = classSymbol.Index;
                }
                break;

            case ParameterSymbol parameterSymbol:
                if (parameterSymbol.ComplexType is ClassSymbol classSymbol2)
                {
                    ParentIndex = classSymbol2.Index;
                }
                break;
            }
        }
コード例 #55
0
        private static void DrawPointWithSymbolStyle(SKCanvas canvas, SymbolStyle style,
                                                     Point destination, float opacity, SymbolType symbolType, float mapRotation)
        {
            canvas.Save();
            canvas.Translate((float)destination.X, (float)destination.Y);
            canvas.Scale((float)style.SymbolScale, (float)style.SymbolScale);
            if (style.SymbolOffset.IsRelative)
            {
                canvas.Translate((float)(SymbolStyle.DefaultWidth * style.SymbolOffset.X), (float)(-SymbolStyle.DefaultWidth * style.SymbolOffset.Y));
            }
            else
            {
                canvas.Translate((float)style.SymbolOffset.X, (float)-style.SymbolOffset.Y);
            }
            if (style.SymbolRotation != 0)
            {
                var rotation = (float)style.SymbolRotation;
                if (style.RotateWithMap)
                {
                    rotation += mapRotation;
                }
                canvas.RotateDegrees(rotation);
            }

            DrawPointWithVectorStyle(canvas, style, opacity, symbolType);
            canvas.Restore();
        }
コード例 #56
0
        /// <summary>
        /// Creates DatSymbol from binary (DAT formatted) stream
        /// </summary>
        public DatSymbol(DatBinaryReader reader)
        {
            var hasName = Convert.ToBoolean(reader.ReadUInt32());

            if (hasName)  // TODO is it even possible for symbol to not have name?
            {
                Name = reader.ReadString();
            }

            OffClsRet = reader.ReadUInt32();

            uint bitField = reader.ReadUInt32();

            Count       = bitField & 0xFFF;
            BuiltinType = (SymbolType)((bitField & 0xF000) >> 12);
            Flags       = (SymbolFlag)((bitField & 0x3F0000) >> 16);

            FileIndex  = reader.ReadUInt32();
            Line       = reader.ReadUInt32();
            LinesCount = reader.ReadUInt32();
            Column     = reader.ReadUInt32();
            CharsCount = reader.ReadUInt32();

            Content = new object[] {};

            if (!Flags.HasFlag(SymbolFlag.ClassVar))
            {
                switch (BuiltinType)
                {
                case SymbolType.Class:
                case SymbolType.Func:
                case SymbolType.Instance:
                case SymbolType.Prototype:
                    Content = new object[] { reader.ReadInt32() };
                    break;

                default:
                    Content = new object[Count];
                    for (int i = 0; i < Count; ++i)
                    {
                        switch (BuiltinType)
                        {
                        case SymbolType.String:
                            Content[i] = reader.ReadString();
                            break;

                        case SymbolType.Float:
                            Content[i] = reader.ReadSingle();
                            break;

                        default:
                            Content[i] = reader.ReadInt32();
                            break;
                        }
                    }
                    break;
                }
            }

            ParentIndex = reader.ReadInt32();
        }
コード例 #57
0
ファイル: LineItem.cs プロジェクト: ziyushijie/VSCodeDemo
 /// <summary>
 /// Create a new <see cref="LineItem"/> using the specified properties.
 /// </summary>
 /// <param name="label">The _label that will appear in the legend.</param>
 /// <param name="x">An array of double precision values that define
 /// the independent (X axis) values for this curve</param>
 /// <param name="y">An array of double precision values that define
 /// the dependent (Y axis) values for this curve</param>
 /// <param name="color">A <see cref="Color"/> value that will be applied to
 /// the <see cref="Line"/> and <see cref="Symbol"/> properties.
 /// </param>
 /// <param name="symbolType">A <see cref="SymbolType"/> enum specifying the
 /// type of symbol to use for this <see cref="LineItem"/>.  Use <see cref="SymbolType.None"/>
 /// to hide the symbols.</param>
 public LineItem(string label, double[] x, double[] y, Color color, SymbolType symbolType)
     : this(label, new PointPairList(x, y), color, symbolType)
 {
 }
コード例 #58
0
        private void Resolve(ITypedSymbol typedSymbol)
        {
            Symbol symbol = (Symbol)typedSymbol;

            SymbolType symbolBuiltinType = symbol.BuiltinType;

            DeclarationNode typedSymbolNode = (DeclarationNode)symbol.Node;

            CustomTypeDeclarationNode customTypeDeclarationNode = (CustomTypeDeclarationNode)typedSymbolNode;

            if (symbolBuiltinType == SymbolType.Uninitialized) // if symbolBuiltinType isn't one of the simple builtin types
            {
                // TODO think of: differentiate NotAClassError and UnknownTypeNameError
                if (_symbolTable.ContainsKey(typedSymbol.TypeName))
                {
                    Symbol typeSymbol = _symbolTable[typedSymbol.TypeName];

                    if (typeSymbol is ClassSymbol)
                    {
                        typedSymbol.ComplexType = typeSymbol;
                        symbol.BuiltinType      = SymbolType.Instance;
                        symbolBuiltinType       = SymbolType.Instance;


                        DeclarationNode declarationNode = (DeclarationNode)typeSymbol.Node;
                        declarationNode.Usages.Add(customTypeDeclarationNode.TypeNameNode);
                    }
                    else
                    {
                        typedSymbolNode.Annotations.Add(new UnknownTypeNameError(customTypeDeclarationNode.TypeNameNode.Value, customTypeDeclarationNode.TypeNameNode.Location));
                        return;
                    }
                }
                else
                {
                    typedSymbolNode.Annotations.Add(new UnknownTypeNameError(customTypeDeclarationNode.TypeNameNode.Value, customTypeDeclarationNode.TypeNameNode.Location));
                    return;
                }
            }

            switch (typedSymbol)
            {
            case FunctionSymbol _:
                switch (symbolBuiltinType)
                {
                case SymbolType.Class:
                case SymbolType.Prototype:
                case SymbolType.Func:
                    symbol.BuiltinType = SymbolType.Uninitialized;
                    typedSymbolNode.Annotations.Add(new UnsupportedFunctionTypeError(customTypeDeclarationNode.TypeNameNode.Location));
                    return;
                }

                break;

            case IArraySymbol _:
                switch (symbolBuiltinType)
                {
                case SymbolType.Int:
                case SymbolType.String:
                case SymbolType.Func:
                case SymbolType.Float:         // very limited type
                    break;

                default:
                    symbol.BuiltinType = SymbolType.Uninitialized;
                    typedSymbolNode.Annotations.Add(new UnsupportedArrayTypeError(customTypeDeclarationNode.TypeNameNode.Location));
                    return;
                }
                break;

            case NestableSymbol _:
                switch (symbolBuiltinType)
                {
                case SymbolType.Class:
                case SymbolType.Prototype:
                case SymbolType.Void:
                    symbol.BuiltinType = SymbolType.Uninitialized;
                    typedSymbolNode.Annotations.Add(new UnsupportedTypeError(customTypeDeclarationNode.TypeNameNode.Location));
                    return;
                }
                break;
            }
        }
コード例 #59
0
ファイル: GraphingBase.cs プロジェクト: diehard2/stochfit
        public virtual void LoadfromArray(string name, double[] X, double[] Y, Color color, SymbolType symbol, int symbolsize, bool isSmoothed, string tag)
        {
            PointPairList list = new PointPairList(X, Y);

            AddCurvetoGraph(list, name, color, symbol, symbolsize, isSmoothed, tag);
            m_alDatainGraph.Add(name);
        }
コード例 #60
0
 protected MethodSymbol(SymbolType type, string name, TypeSymbol parent, TypeSymbol returnType)
     : base(type, name, parent, returnType)
 {
 }