Beispiel #1
0
        public IToken Create(int type, string text)
        {
            var result = new MyToken()
            {
                Text = text,
                Type = type,
            };

            return(result);
        }
Beispiel #2
0
        public IToken Create(Tuple <ITokenSource, ICharStream> source, int type, string text, int channel, int start, int stop, int line, int charPositionInLine)
        {
            var result = new MyToken()
            {
                Channel     = channel,
                Column      = charPositionInLine,
                InputStream = source.Item2,
                Line        = line,
                StartIndex  = start,
                StopIndex   = stop,
                Text        = text,
                Type        = type,
            };

            //var size = TestSize<MyToken>.SizeOf(result);
            return(result);
        }