Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
Takin
mag-core
Commits
1d5c154c
Verified
Commit
1d5c154c
authored
Oct 30, 2020
by
Tobias WEBER
Browse files
bugfixes
parent
7cc8aedc
Changes
6
Hide whitespace changes
Inline
Side-by-side
tools/scanbrowser/CMakeLists.txt
View file @
1d5c154c
...
...
@@ -73,7 +73,7 @@ include_directories(
"
${
PROJECT_SOURCE_DIR
}
"
"
${
PROJECT_SOURCE_DIR
}
/ext"
"
${
PROJECT_SOURCE_DIR
}
/ext/qcp"
"
${
PROJECT_SOURCE_DIR
}
/../.."
"
${
PROJECT_SOURCE_DIR
}
/../../ext"
"
${
PROJECT_SOURCE_DIR
}
/../../ext/qcp"
"
${
PROJECT_SOURCE_DIR
}
/cli"
"
${
Boost_INCLUDE_DIRS
}
"
"
${
Boost_INCLUDE_DIRS
}
/.."
"
${
Boost_INCLUDE_DIRS
}
"
"
${
Boost_INCLUDE_DIRS
}
/.."
"
${
FLEX_INCLUDE_DIRS
}
"
"
${
PROJECT_BINARY_DIR
}
/parser"
"
${
QCP_INCLUDE_DIRS
}
"
)
...
...
tools/scanbrowser/cli/clilexer.l
View file @
1d5c154c
...
...
@@ -59,7 +59,7 @@ real {uinteger}(\.[0-9]*)?|\.[0-9]+
. {
c
ontex
t.PrintError(std::string("Lexer error: Unknown token: \"") + yytext + std::string("\""));
ct
x
.PrintError(std::string("Lexer error: Unknown token: \"") + yytext + std::string("\""));
}
...
...
tools/scanbrowser/cli/cliparser.cpp
View file @
1d5c154c
...
...
@@ -41,7 +41,7 @@ void CliParserContext::PrintErrorString(const std::string &err)
void
yy
::
CliParser
::
error
(
const
std
::
string
&
err
)
{
c
ontex
t
.
PrintError
(
std
::
string
(
"Parser error: "
)
+
err
+
std
::
string
(
"."
));
ct
x
.
PrintError
(
std
::
string
(
"Parser error: "
)
+
err
+
std
::
string
(
"."
));
}
void
CliParserContext
::
SetLexerInput
(
std
::
istream
&
istr
)
...
...
@@ -49,8 +49,8 @@ void CliParserContext::SetLexerInput(std::istream &istr)
m_lex
.
switch_streams
(
&
istr
/*, &std::cout*/
);
}
extern
yy
::
CliParser
::
symbol_type
yylex
(
CliParserContext
&
c
ontex
t
)
extern
yy
::
CliParser
::
symbol_type
yylex
(
CliParserContext
&
ct
x
)
{
return
c
ontex
t
.
GetLexer
().
yylex
(
c
ontex
t
);
return
ct
x
.
GetLexer
().
yylex
(
ct
x
);
}
// ----------------------------------------------------------------------------
tools/scanbrowser/cli/cliparser.h
View file @
1d5c154c
...
...
@@ -44,7 +44,7 @@ protected:
public:
CliLexer
(
CliParserContext
*
ctx
=
nullptr
);
virtual
yy
::
CliParser
::
symbol_type
yylex
(
CliParserContext
&
c
ontex
t
);
virtual
yy
::
CliParser
::
symbol_type
yylex
(
CliParserContext
&
ct
x
);
};
template
<
class
t_real_cli
>
t_real_cli
str_to_real
(
const
std
::
string
&
str
);
...
...
@@ -500,8 +500,8 @@ public:
#undef YY_DECL
#define YY_DECL yy::CliParser::symbol_type CliLexer::yylex(CliParserContext &c
ontex
t)
extern
yy
::
CliParser
::
symbol_type
yylex
(
CliParserContext
&
c
ontex
t
);
#define YY_DECL yy::CliParser::symbol_type CliLexer::yylex(CliParserContext &ct
x
)
extern
yy
::
CliParser
::
symbol_type
yylex
(
CliParserContext
&
ct
x
);
#define yyterminate() return yy::CliParser::token::yytokentype(YY_NULL);
...
...
tools/scanbrowser/cli/cliparser.y
View file @
1d5c154c
...
...
@@ -14,7 +14,7 @@
%code requires { #include "cliparser_types.h" }
%code { #include "cliparser.h" }
%param { CliParserContext &c
ontex
t }
%param { CliParserContext &ct
x
}
// terminals
...
...
@@ -51,7 +51,7 @@
commands
: commands command
{ c
ontex
t.AddAST($2); }
{ ct
x
.AddAST($2); }
| /* eps */
{ $$ = nullptr; }
;
...
...
tools/setup/convmag.cpp
View file @
1d5c154c
...
...
@@ -390,13 +390,13 @@ void convert_spacegroup(std::istream& istr, ptree::ptree& prop, const std::strin
}
void
convert_table
(
const
char
*
pcInFile
,
const
char
*
pcOutFile
)
bool
convert_table
(
const
char
*
pcInFile
,
const
char
*
pcOutFile
)
{
std
::
ifstream
istr
(
pcInFile
);
if
(
!
istr
)
{
std
::
cerr
<<
"Cannot open
\"
"
<<
pcInFile
<<
"
\"
."
<<
std
::
endl
;
return
;
return
false
;
}
std
::
vector
<
std
::
tuple
<
std
::
string
,
t_mat
>>
vecPtOps
,
vecHexPtOps
;
...
...
@@ -427,12 +427,22 @@ void convert_table(const char* pcInFile, const char* pcOutFile)
std
::
cout
<<
"
\n
"
;
/*ptree::write_xml(pcOutFile, prop,
std::locale(),
ptree::xml_writer_make_settings('\t', 1, std::string("utf-8")));*/
ptree
::
write_info
(
pcOutFile
,
prop
,
std
::
locale
(),
ptree
::
info_writer_make_settings
(
'\t'
,
1
));
try
{
/*ptree::write_xml(pcOutFile, prop,
std::locale(),
ptree::xml_writer_make_settings('\t', 1, std::string("utf-8")));*/
ptree
::
write_info
(
pcOutFile
,
prop
,
std
::
locale
(),
ptree
::
info_writer_make_settings
(
'\t'
,
1
));
}
catch
(
const
std
::
exception
&
ex
)
{
std
::
cerr
<<
"Error in setup tool: "
<<
ex
.
what
()
<<
std
::
endl
;
return
false
;
}
return
true
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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