Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tobias Hunger
qt-creator
Commits
f76234f1
Commit
f76234f1
authored
Feb 21, 2011
by
Erik Verbruggen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed left-overs from initial development.
parent
3787aa7a
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
597 deletions
+0
-597
src/libs/glsl/tests/main.cpp
src/libs/glsl/tests/main.cpp
+0
-92
src/libs/glsl/tests/test.pro
src/libs/glsl/tests/test.pro
+0
-14
src/libs/glsl/tools/kwgen.cpp
src/libs/glsl/tools/kwgen.cpp
+0
-406
src/libs/glsl/tools/mkvisitor.py
src/libs/glsl/tools/mkvisitor.py
+0
-85
No files found.
src/libs/glsl/tests/main.cpp
deleted
100644 → 0
View file @
3787aa7a
#include <glslengine.h>
#include <glslparser.h>
#include <glsllexer.h>
#include <glslastdump.h>
#include <glslsemantic.h>
#include <glslsymbols.h>
#include <glsltypes.h>
#include <QtCore/QTextStream>
#include <iostream>
#include <fstream>
#include <cstring>
#include <cassert>
#include <cstdio>
using
namespace
GLSL
;
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif
namespace
{
QTextStream
qout
(
stdout
,
QIODevice
::
WriteOnly
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
variant
=
0
;
while
(
argc
>
1
&&
argv
[
1
][
0
]
==
'-'
&&
argv
[
1
][
1
]
==
'-'
)
{
if
(
!
strcmp
(
argv
[
1
],
"--version=1.20"
))
{
variant
|=
Lexer
::
Variant_GLSL_120
;
}
else
if
(
!
strcmp
(
argv
[
1
],
"--version=1.50"
))
{
variant
|=
Lexer
::
Variant_GLSL_150
;
}
else
if
(
!
strcmp
(
argv
[
1
],
"--version=4.00"
))
{
variant
|=
Lexer
::
Variant_GLSL_400
;
}
else
if
(
!
strcmp
(
argv
[
1
],
"--version=es"
))
{
variant
|=
Lexer
::
Variant_GLSL_ES_100
;
}
else
if
(
!
strcmp
(
argv
[
1
],
"--shader=vertex"
))
{
variant
|=
Lexer
::
Variant_VertexShader
;
}
else
if
(
!
strcmp
(
argv
[
1
],
"--shader=fragment"
))
{
variant
|=
Lexer
::
Variant_FragmentShader
;
}
else
{
std
::
cerr
<<
"glsl: unknown option: "
<<
argv
[
1
]
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
++
argv
;
--
argc
;
}
if
(
argc
!=
2
)
{
std
::
cerr
<<
"glsl: no input file"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
std
::
ifstream
fin
(
argv
[
1
]);
if
(
!
fin
)
{
std
::
cerr
<<
"glsl: No such file or directory"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
fin
.
seekg
(
0
,
std
::
ios
::
end
);
size_t
size
=
fin
.
tellg
();
fin
.
seekg
(
0
,
std
::
ios
::
beg
);
char
*
source
=
new
char
[
size
];
fin
.
read
(
source
,
size
);
fin
.
close
();
if
(
!
variant
)
variant
=
Lexer
::
Variant_Mask
&
~
Lexer
::
Variant_Reserved
;
else
if
((
variant
&
(
Lexer
::
Variant_VertexShader
|
Lexer
::
Variant_FragmentShader
))
==
0
)
variant
|=
Lexer
::
Variant_VertexShader
|
Lexer
::
Variant_FragmentShader
;
Engine
engine
;
Parser
parser
(
&
engine
,
source
,
size
,
variant
);
TranslationUnitAST
*
ast
=
parser
.
parse
();
std
::
cout
<<
argv
[
1
]
<<
(
ast
?
" OK "
:
" KO "
)
<<
std
::
endl
;
ASTDump
dump
(
qout
);
dump
(
ast
);
Semantic
sem
;
Scope
*
globalScope
=
engine
.
newNamespace
();
sem
.
translationUnit
(
ast
,
globalScope
,
&
engine
);
delete
source
;
delete
ast
;
return
EXIT_SUCCESS
;
}
src/libs/glsl/tests/test.pro
deleted
100644 → 0
View file @
3787aa7a
TEMPLATE
=
app
CONFIG
-=
app_bundle
CONFIG
+=
console
TARGET
=
glsl
DEPENDPATH
+=
.
INCLUDEPATH
+=
.
..
QT
=
core
#
Input
SOURCES
+=
main
.
cpp
include
(..
/
glsl
-
lib
.
pri
)
src/libs/glsl/tools/kwgen.cpp
deleted
100644 → 0
View file @
3787aa7a
This diff is collapsed.
Click to expand it.
src/libs/glsl/tools/mkvisitor.py
deleted
100755 → 0
View file @
3787aa7a
#!/usr/bin/python
import
sys
try
:
file
=
open
(
sys
.
argv
[
1
],
"r"
)
klass
=
sys
.
argv
[
2
]
except
:
print
(
"Usage: mkvisitor.py grammar.txt classname"
)
exit
()
lines
=
file
.
readlines
()
ruleno
=
0
print
(
"""
#include "glslast.h"
namespace GLSL {
class %s
{
typedef void (%s::*dispatch_func)(AST *);
static dispatch_func dispatch[];
public:
void accept(AST *ast)
{
if (! ast)
return;
else if (Operator *op = ast->asOperator())
(this->*dispatch[op->ruleno])(ast);
}
template <typename It>
void accept(It first, It last)
{
for (; first != last; ++first)
accept(*first);
}
private:"""
%
(
klass
,
klass
))
for
line
in
lines
:
sections
=
line
.
split
()
if
len
(
sections
)
and
sections
[
1
]
==
"::="
:
ruleno
=
ruleno
+
1
print
(
" void on_%s_%d(AST *);"
%
(
sections
[
0
],
ruleno
))
print
(
"};"
)
print
(
"} // end of namespace GLSL"
)
print
(
"""
#include <iostream>
using namespace GLSL;
namespace {
bool debug = false;
}
"""
)
print
(
"%s::dispatch_func %s::dispatch[] = {"
%
(
klass
,
klass
))
ruleno
=
0
for
line
in
lines
:
sections
=
line
.
split
()
if
len
(
sections
)
and
sections
[
1
]
==
"::="
:
ruleno
=
ruleno
+
1
print
(
" &%s::on_%s_%d,"
%
(
klass
,
sections
[
0
],
ruleno
))
print
(
"0, };
\n
"
)
ruleno
=
0
for
line
in
lines
:
sections
=
line
.
split
()
if
len
(
sections
)
and
sections
[
1
]
==
"::="
:
ruleno
=
ruleno
+
1
print
(
"""// %svoid %s::on_%s_%d(AST *ast)
{
if (debug)
std::cout << "%s" << std::endl;
Operator *op = ast->asOperator();
accept(op->begin(), op->end());
}
"""
%
(
line
,
klass
,
sections
[
0
],
ruleno
,
line
[:
-
3
]))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment