[Mesa-dev] [PATCH] glsl-compiler: ast: Precise locations positions.

2014-02-03 Thread Sir Anthony
I'm using mesa glsl-compiler as backend for glsl-debugger interface with heavy use of locations for graphical representation. Locations proposed by original parser is wrong in most cases, because it uses yylloc for all bison rules. This patch includes: 1. Change locations setup in glsl_parser.yy

[Mesa-dev] [PATCH] glsl-compiler: ast: Precise locations positions.

2014-02-03 Thread Sir Anthony
1. Change locations setup in glsl_parser.yy from yylloc to appropriate token locations. 2. Addition of two fields in ast_node location to hold end position of token. 3. Addition of ast_node method to setup range locations (for aggregate tokens). 4. Fix for glcpp-lex.l. It handled spaces wrong and

[Mesa-dev] [PATCH 4/4] glsl: Change locations from yylloc to appropriate tokens positions.

2014-02-05 Thread Sir Anthony
--- src/glsl/glsl_parser.yy | 215 +--- 1 file changed, 114 insertions(+), 101 deletions(-) diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index 928c57e..c6a585f 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -386,

[Mesa-dev] [PATCH 0/4] glsl: Precise location positions for ast_node.

2014-02-05 Thread Sir Anthony
These patches changes the ast_node location holding by adding tokens end position and assignment of it along with previously tracked start position. Bison rules was updated to set appropriate tokens locations instead of yylloc. Sir Anthony (4): glsl: Update lexers in glsl and glcpp to hande

[Mesa-dev] [PATCH] glcpp: Do not remove spaces to preserve locations.

2014-02-05 Thread Sir Anthony
After preprocessing by glcpp all adjacent spaces were replaced by single one and glsl parser received column-shifted shader source. It negatively affected ast location set up and produced wrong error messages for heavily-spaced shaders. --- src/glsl/glcpp/glcpp-lex.l

[Mesa-dev] [PATCH 1/4] glsl: Update lexers in glsl and glcpp to hande end position of token.

2014-02-05 Thread Sir Anthony
--- src/glsl/glcpp/glcpp-lex.l | 3 ++- src/glsl/glsl_lexer.ll | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/glsl/glcpp/glcpp-lex.l b/src/glsl/glcpp/glcpp-lex.l index c0709a2..188e454 100644 --- a/src/glsl/glcpp/glcpp-lex.l +++ b/src/glsl/glcpp/glcpp-lex.l @@ -47,

[Mesa-dev] [PATCH 3/4] glsl: Add ast_node method to set location range.

2014-02-05 Thread Sir Anthony
--- src/glsl/ast.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/glsl/ast.h b/src/glsl/ast.h index a9352f9..8e54ddc 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -98,6 +98,20 @@ public: } /** +* Set the source location range of an AST node using two lo

[Mesa-dev] [PATCH 2/4] glsl: Extend ast location structure to hande end token position.

2014-02-05 Thread Sir Anthony
--- src/glsl/ast.h | 22 +- src/glsl/glsl_parser_extras.cpp | 6 -- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 2d6f3a2..a9352f9 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -75,10 +75,10 @@

Re: [Mesa-dev] [PATCH] glsl-compiler: ast: Precise locations positions.

2014-02-05 Thread Sir Anthony
, it means 000-content-with-spaces must work the opposite way. I'll change it and add to glcpp patch too. On Tue, 04 Feb 2014 16:06:46 -0800 Carl Worth wrote: > Sir Anthony writes: > > 1. Change locations setup in glsl_parser.yy from yylloc to appropriate > > token locations

[Mesa-dev] [PATCH] glsl: Make ast_node location comments more informative.

2014-02-06 Thread Sir Anthony
--- src/glsl/ast.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 8e54ddc..50b95bf 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -116,10 +116,10 @@ public: */ struct { unsigned source; /**< GLSL sourc

Re: [Mesa-dev] [PATCH 4/4] glsl: Change locations from yylloc to appropriate tokens positions.

2014-02-06 Thread Sir Anthony
may occurs here to throw message if any. Anything I can think of now is prototype errors either components with their own locations. On Wed, 05 Feb 2014 12:41:58 -0800 Carl Worth wrote: > Sir Anthony writes: > > Thanks for this patch series. It looks great to me. I sent a separate >

Re: [Mesa-dev] [PATCH 4/4] glsl: Change locations from yylloc to appropriate tokens positions.

2014-02-06 Thread Sir Anthony
Yes, I will be very grateful if someone will do it. Thanks. On Thu, 06 Feb 2014 12:40:21 -0800 Carl Worth wrote: > Sir Anthony writes: > > This is tough question, I thought about it some time and concluded > > that some function class must include body range, otherwise there