]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/parser.h
Implement the ternary operator in GLSL
[libs/gl.git] / source / glsl / parser.h
index 376ccc6cd77fa996d02aeff1aa0baf59aea6167b..c98867a3791e866ecd31a9c7cc5076e7443482cf 100644 (file)
@@ -50,7 +50,6 @@ private:
        static bool is_interpolation_qualifier(const std::string &);
        static bool is_precision_qualifier(const std::string &);
        static bool is_qualifier(const std::string &);
-       static bool is_builtin_type(const std::string &);
        bool is_type(const std::string &);
        bool is_identifier(const std::string &);
 
@@ -60,18 +59,25 @@ private:
        void preprocess_pragma_msp();
        void preprocess_stage();
 
-       RefPtr<Statement> parse_global_declaration();
+       template<typename T>
+       RefPtr<T> create_node();
        template<typename T>
        RefPtr<T> parse_with_recovery(RefPtr<T> (Parser::*)());
+       RefPtr<Statement> parse_global_declaration();
        RefPtr<Statement> parse_statement();
        RefPtr<Import> parse_import();
        RefPtr<Precision> parse_precision();
        RefPtr<Layout> parse_layout();
        template<typename T>
        void parse_block(Block &, bool, RefPtr<T> (Parser::*)());
-       RefPtr<Expression> parse_expression(unsigned = 0);
+       RefPtr<Expression> parse_expression(const Operator * = 0);
+       RefPtr<Literal> parse_literal();
        RefPtr<BinaryExpression> parse_binary(const RefPtr<Expression> &, const Operator &);
+       RefPtr<TernaryExpression> parse_ternary(const RefPtr<Expression> &, const Operator &);
        RefPtr<FunctionCall> parse_function_call(const VariableReference &);
+       RefPtr<TypeDeclaration> parse_type_declaration();
+       RefPtr<BasicTypeDeclaration> parse_basic_type_declaration();
+       RefPtr<ImageTypeDeclaration> parse_image_type_declaration();
        RefPtr<StructDeclaration> parse_struct_declaration();
        RefPtr<VariableDeclaration> parse_variable_declaration();
        RefPtr<VariableDeclaration> parse_variable_declaration_with_layout();