Example #1
0
        public static Node CreateNumberToken(float value)
        {
            var pattern = new TokenPattern((int)HlslConstants.NUMBER,
                                           "NUMBER", TokenPattern.PatternType.STRING, value.ToString("0.0######", CultureInfo.InvariantCulture));

            return(new Token(pattern, pattern.GetPattern(), 1, 1));
        }
Example #2
0
        public static Node CreateVoidToken()
        {
            TokenPattern patternVoid = new TokenPattern((int)HlslConstants.VOID,
                                                        "VOID", TokenPattern.PatternType.STRING, "void");

            return(new Token(patternVoid, patternVoid.GetPattern(), 1, 1));
        }
Example #3
0
        public static Node CreateEqualToken()
        {
            TokenPattern patternEqual = new TokenPattern((int)HlslConstants.EQUAL,
                                                         "EQUAL", TokenPattern.PatternType.STRING, "=");

            return(new Token(patternEqual, patternEqual.GetPattern(), 1, 1));
        }
Example #4
0
        public static Node CreateNewLineToken()
        {
            TokenPattern patternNEW_LINE = new TokenPattern((int)HlslConstants.NEWLINE,
                                                            "NEWLINE", TokenPattern.PatternType.STRING, "\n");

            return(new Token(patternNEW_LINE, patternNEW_LINE.GetPattern(), 1, 1));
        }
Example #5
0
        public static Node CreateVaryingToken()
        {
            TokenPattern patternVarying = new TokenPattern((int)HlslConstants.VARYING,
                                                           "VARYING", TokenPattern.PatternType.STRING, "varying");

            return(new Token(patternVarying, patternVarying.GetPattern(), 1, 1));
        }
Example #6
0
        public static Node CreateDotCommaToken()
        {
            TokenPattern patternDOT_COMMA = new TokenPattern((int)HlslConstants.DOT_COMMA,
                                                             "DOT_COMMA", TokenPattern.PatternType.STRING, ";");

            return(new Token(patternDOT_COMMA, patternDOT_COMMA.GetPattern(), 1, 1));
        }
Example #7
0
        public static Node CreateSpaceToken()
        {
            TokenPattern patternWHITESPACE = new TokenPattern((int)HlslConstants.WHITESPACE,
                                                              "WHITESPACE", TokenPattern.PatternType.STRING, " ");

            return(new Token(patternWHITESPACE, patternWHITESPACE.GetPattern(), 1, 1));
        }
 public static Node CreateVaryingToken()
 {
     TokenPattern patternVarying = new TokenPattern((int) HlslConstants.VARYING,
                                "VARYING", TokenPattern.PatternType.STRING, "varying");
     return new Token(patternVarying, patternVarying.GetPattern(), 1, 1);
 }
 public static Node CreateVoidToken()
 {
     TokenPattern patternVoid = new TokenPattern((int)HlslConstants.VOID,
                                "VOID", TokenPattern.PatternType.STRING, "void");
     return new Token(patternVoid, patternVoid.GetPattern(), 1, 1);
 }
 public static Node CreateSpaceToken()
 {
     TokenPattern patternWHITESPACE = new TokenPattern((int) HlslConstants.WHITESPACE,
                               "WHITESPACE", TokenPattern.PatternType.STRING, " ");
     return new Token(patternWHITESPACE, patternWHITESPACE.GetPattern(), 1, 1);
 }
 public static Node CreateNumberToken(float value)
 {
     var pattern = new TokenPattern((int)HlslConstants.NUMBER,
                                 "NUMBER", TokenPattern.PatternType.STRING, value.ToString("0.0######",CultureInfo.InvariantCulture));
     return new Token(pattern, pattern.GetPattern(), 1, 1);
 }
 public static Node CreateNewLineToken()
 {
     TokenPattern patternNEW_LINE = new TokenPattern((int) HlslConstants.NEWLINE,
                                "NEWLINE", TokenPattern.PatternType.STRING, "\n");
     return new Token(patternNEW_LINE, patternNEW_LINE.GetPattern(), 1, 1);
 }
 public static Node CreateEqualToken()
 {
     TokenPattern patternEqual = new TokenPattern((int)HlslConstants.EQUAL,
                                 "EQUAL", TokenPattern.PatternType.STRING, "=");
     return new Token(patternEqual, patternEqual.GetPattern(), 1, 1);
 }
 public static Node CreateDotCommaToken()
 {
     TokenPattern patternDOT_COMMA = new TokenPattern((int) HlslConstants.DOT_COMMA,
                               "DOT_COMMA", TokenPattern.PatternType.STRING, ";");
     return new Token(patternDOT_COMMA, patternDOT_COMMA.GetPattern(), 1, 1);
 }