예제 #1
0
        public static string GetName(this RadAsmTokenType type)
        {
            switch (type)
            {
            case RadAsmTokenType.FunctionParameter:
                return("argument");

            case RadAsmTokenType.Label:
                return("label");

            case RadAsmTokenType.GlobalVariable:
                return("global variable");

            case RadAsmTokenType.LocalVariable:
                return("local variable");

            case RadAsmTokenType.FunctionName:
                return("function");

            case RadAsmTokenType.Instruction:
                return("instruction");

            default:
                return("unknown");
            }
        }
예제 #2
0
 public TextTag(RadAsmTokenType type, Span span)
 {
     Type = type;
     Span = span;
 }
예제 #3
0
 public DefinitionToken(RadAsmTokenType tokenType, TrackingToken trackingToken, ITextSnapshot snapshot)
     : base(tokenType, trackingToken, snapshot)
 {
     References = new LinkedList <IAnalysisToken>();
     _text      = base.GetText();
 }
예제 #4
0
 public ClassifiedTextBuilder AddClassifiedText(RadAsmTokenType tokenType, string text)
 {
     _classifiedTextRuns.AddLast(new ClassifiedTextRun(tokenType.GetClassificationTypeName(), text));
     return(this);
 }
예제 #5
0
 public VariableToken(RadAsmTokenType type, TrackingToken token, ITextSnapshot snapshot, TrackingToken defaultValue = default)
     : base(type, token, snapshot)
 {
     DefaultValue = defaultValue;
 }
예제 #6
0
        private bool IsLeftOrRightBracket(int type, RadAsmTokenType lBracket, RadAsmTokenType rBracket)
        {
            var tokenType = _tokenizer.GetTokenType(type);

            return(tokenType == lBracket || tokenType == rBracket);
        }
예제 #7
0
 public InstructionToken(RadAsmTokenType tokenType, TrackingToken trackingToken, ITextSnapshot snapshot)
     : base(tokenType, trackingToken, snapshot)
 {
     Parameters = new LinkedList <IAnalysisToken>();
 }
예제 #8
0
 public ReferenceToken(RadAsmTokenType tokenType, TrackingToken trackingToken, ITextSnapshot snapshot, DefinitionToken definitionToken)
     : base(tokenType, trackingToken, snapshot)
 {
     Definition = definitionToken;
     Definition.AddReference(this);
 }
예제 #9
0
 public FunctionToken(RadAsmTokenType tokenType, TrackingToken trackingToken, ITextSnapshot snapshot)
     : base(tokenType, trackingToken, snapshot)
 {
 }
예제 #10
0
 public static void AddTag(this IList <TextTag> tags, RadAsmTokenType type, int start, int length) =>
 tags.Add(new TextTag(type, new Span(start, length)));
예제 #11
0
 public static void AddTag(this IList <TextTag> tags, RadAsmTokenType type, Span span) =>
 tags.Add(new TextTag(type, span));
예제 #12
0
 private static bool IsTypeOf(this IDocumentTokenizer tokenizer, int tokenType,
                              RadAsmTokenType targetTokenType) =>
 tokenizer.GetTokenType(tokenType) == targetTokenType;
예제 #13
0
 public AnalysisToken(RadAsmTokenType tokenType, TrackingToken trackingToken, ITextSnapshot snapshot)
 {
     Type          = tokenType;
     TrackingToken = trackingToken;
     Span          = new SnapshotSpan(snapshot, TrackingToken.GetSpan(snapshot));
 }
예제 #14
0
 public static string GetClassificationTypeName(this RadAsmTokenType tokenType) =>
 _classificationTypeNames[tokenType];
예제 #15
0
 public IncludeToken(RadAsmTokenType tokenType, TrackingToken trackingToken, ITextSnapshot snapshot)
     : base(tokenType, trackingToken, snapshot)
 {
     throw new NotImplementedException();
 }