Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
7b654a83
Unverified
Commit
7b654a83
authored
Jun 06, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
with reserved words automaton
parent
ae9d247d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
30 deletions
+6
-30
include/cif++/parser.hpp
+4
-28
src/dictionary_parser.cpp
+2
-2
src/parser.cpp
+0
-0
No files found.
include/cif++/parser.hpp
View file @
7b654a83
...
@@ -112,7 +112,8 @@ class sac_parser
...
@@ -112,7 +112,8 @@ class sac_parser
DATA
,
DATA
,
LOOP
,
LOOP
,
GLOBAL
,
GLOBAL
,
SAVE
,
SAVE_
,
SAVE_NAME
,
STOP
,
STOP
,
Tag
,
Tag
,
Value
Value
...
@@ -127,7 +128,8 @@ class sac_parser
...
@@ -127,7 +128,8 @@ class sac_parser
case
CIFToken
:
:
DATA
:
return
"DATA"
;
case
CIFToken
:
:
DATA
:
return
"DATA"
;
case
CIFToken
:
:
LOOP
:
return
"LOOP"
;
case
CIFToken
:
:
LOOP
:
return
"LOOP"
;
case
CIFToken
:
:
GLOBAL
:
return
"GLOBAL"
;
case
CIFToken
:
:
GLOBAL
:
return
"GLOBAL"
;
case
CIFToken
:
:
SAVE
:
return
"SAVE"
;
case
CIFToken
:
:
SAVE_
:
return
"SAVE"
;
case
CIFToken
:
:
SAVE_NAME
:
return
"SAVE+name"
;
case
CIFToken
:
:
STOP
:
return
"STOP"
;
case
CIFToken
:
:
STOP
:
return
"STOP"
;
case
CIFToken
:
:
Tag
:
return
"Tag"
;
case
CIFToken
:
:
Tag
:
return
"Tag"
;
case
CIFToken
:
:
Value
:
return
"Value"
;
case
CIFToken
:
:
Value
:
return
"Value"
;
...
@@ -135,32 +137,6 @@ class sac_parser
...
@@ -135,32 +137,6 @@ class sac_parser
}
}
}
}
enum
class
CIFValue
{
Int
,
Float
,
Numeric
,
String
,
TextField
,
Inapplicable
,
Unknown
};
static
constexpr
const
char
*
get_value_name
(
CIFValue
type
)
{
switch
(
type
)
{
case
CIFValue
:
:
Int
:
return
"Int"
;
case
CIFValue
:
:
Float
:
return
"Float"
;
case
CIFValue
:
:
Numeric
:
return
"Numeric"
;
case
CIFValue
:
:
String
:
return
"String"
;
case
CIFValue
:
:
TextField
:
return
"TextField"
;
case
CIFValue
:
:
Inapplicable
:
return
"Inapplicable"
;
case
CIFValue
:
:
Unknown
:
return
"Unknown"
;
default:
return
"Invalid type parameter"
;
}
}
// get_next_char takes a char from the buffer, or if it is empty
// get_next_char takes a char from the buffer, or if it is empty
// from the istream. This function also does carriage/linefeed
// from the istream. This function also does carriage/linefeed
// translation.
// translation.
...
...
src/dictionary_parser.cpp
View file @
7b654a83
...
@@ -127,7 +127,7 @@ class dictionary_parser : public parser
...
@@ -127,7 +127,7 @@ class dictionary_parser : public parser
datablock
dict
(
m_token_value
);
datablock
dict
(
m_token_value
);
datablock
::
iterator
cat
=
dict
.
end
();
datablock
::
iterator
cat
=
dict
.
end
();
match
(
CIFToken
::
SAVE
);
match
(
CIFToken
::
SAVE
_NAME
);
while
(
m_lookahead
==
CIFToken
::
LOOP
or
m_lookahead
==
CIFToken
::
Tag
)
while
(
m_lookahead
==
CIFToken
::
LOOP
or
m_lookahead
==
CIFToken
::
Tag
)
{
{
if
(
m_lookahead
==
CIFToken
::
LOOP
)
if
(
m_lookahead
==
CIFToken
::
LOOP
)
...
@@ -183,7 +183,7 @@ class dictionary_parser : public parser
...
@@ -183,7 +183,7 @@ class dictionary_parser : public parser
}
}
}
}
match
(
CIFToken
::
SAVE
);
match
(
CIFToken
::
SAVE
_
);
if
(
isCategorySaveFrame
)
if
(
isCategorySaveFrame
)
{
{
...
...
src/parser.cpp
View file @
7b654a83
This diff is collapsed.
Click to expand it.
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