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
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
---
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,
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
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
---
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,
---
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
---
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 @@
, 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
---
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
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
>
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
12 matches
Mail list logo