Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
hskom
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hugo Hörnquist
hskom
Commits
080c53ca
Commit
080c53ca
authored
Feb 27, 2021
by
Hugo Hörnquist
Browse files
Options
Downloads
Patches
Plain Diff
Minor cleanup for PDF.
parent
3f1da918
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
LysKom/ProtocolA.lhs
+9
-7
9 additions, 7 deletions
LysKom/ProtocolA.lhs
LysKom/ProtocolA/Types.lhs
+2
-1
2 additions, 1 deletion
LysKom/ProtocolA/Types.lhs
doc/main.tex
+1
-16
1 addition, 16 deletions
doc/main.tex
with
12 additions
and
24 deletions
LysKom/ProtocolA.lhs
+
9
−
7
View file @
080c53ca
...
@@ -56,16 +56,18 @@ commentParser = Comment <$> (char '#' *> whitespaces *> manyTill anyChar eol)
...
@@ -56,16 +56,18 @@ commentParser = Comment <$> (char '#' *> whitespaces *> manyTill anyChar eol)
\item[version] strings. Mostly ignored
\item[version] strings. Mostly ignored
\begin{code}
\begin{code}
protoEditionParser :: GenParser Char () ProtocolAItem
protoEditionParser :: GenParser Char () ProtocolAItem
protoEditionParser
= fmap ProtoEdition $
protoEditionParser
string "%PROTOEDITION" *> whitespaces *> word
= fmap ProtoEdition $
string "%PROTOEDITION" *> whitespaces *> word
protoVerParser :: GenParser Char () ProtocolAItem
protoVerParser :: GenParser Char () ProtocolAItem
protoVerParser
= fmap ProtoVer $
protoVerParser
string "%PROTOVER" *> whitespaces *> word
= fmap ProtoVer $
string "%PROTOVER" *> whitespaces *> word
lysKomDVersionParser :: GenParser Char () ProtocolAItem
lysKomDVersionParser :: GenParser Char () ProtocolAItem
lysKomDVersionParser = fmap LysKomDVersion $
lysKomDVersionParser
string "%LYSKOMDVERSION" *> whitespaces *> word
= fmap LysKomDVersion $ string "%LYSKOMDVERSION"
*> whitespaces
*> word
\end{code}
\end{code}
\item[aliases], which come in three variants, all handled through a simple helper.
\item[aliases], which come in three variants, all handled through a simple helper.
...
...
This diff is collapsed.
Click to expand it.
LysKom/ProtocolA/Types.lhs
+
2
−
1
View file @
080c53ca
...
@@ -212,7 +212,8 @@ selection (
...
@@ -212,7 +212,8 @@ selection (
selectionFieldParser :: GenParser Char () (Int, String, (String, LysType))
selectionFieldParser :: GenParser Char () (Int, String, (String, LysType))
selectionFieldParser
selectionFieldParser
= (,,)
= (,,)
<$> (intParser <* char '=') <*> (withWS word)
<$> (intParser <* char '=')
<*> withWS word
<*> structFieldParser <* whitespaces
<*> structFieldParser <* whitespaces
selectionTypeParser :: GenParser Char () LysType
selectionTypeParser :: GenParser Char () LysType
...
...
This diff is collapsed.
Click to expand it.
doc/main.tex
+
1
−
16
View file @
080c53ca
...
@@ -58,9 +58,6 @@ Frist step is to take the specification of Protocol A and parse it into
...
@@ -58,9 +58,6 @@ Frist step is to take the specification of Protocol A and parse it into
something we can handle. Ideally a ready made parser would be useful, but the
something we can handle. Ideally a ready made parser would be useful, but the
variant of ASN.1 (Abstract Syntax Notation One) which was used is slightly non-standard.
variant of ASN.1 (Abstract Syntax Notation One) which was used is slightly non-standard.
See appendix~
\ref
{
app:ast
}
for sample output for all parsers defined in this
chapter.
\input
{
lhs/LysKom/ProtocolA.lhs
}
\input
{
lhs/LysKom/ProtocolA.lhs
}
\input
{
lhs/LysKom/ProtocolA/Types.lhs
}
\input
{
lhs/LysKom/ProtocolA/Types.lhs
}
\input
{
lhs/LysKom/ProtocolA/Requests.lhs
}
\input
{
lhs/LysKom/ProtocolA/Requests.lhs
}
...
@@ -78,9 +75,6 @@ Haskell code from it. Now we start actually looking towards actual data!
...
@@ -78,9 +75,6 @@ Haskell code from it. Now we start actually looking towards actual data!
\label
{
sec:datatype
}
\label
{
sec:datatype
}
\input
{
lhs/Datatype.lhs
}
\input
{
lhs/Datatype.lhs
}
\section
{
Notes
}
\input
{
lhs/Notes.lhs
}
\chapter
{
Binding it Together
}
\chapter
{
Binding it Together
}
\label
{
cha:binding
}
\label
{
cha:binding
}
...
@@ -93,15 +87,6 @@ Haskell code from it. Now we start actually looking towards actual data!
...
@@ -93,15 +87,6 @@ Haskell code from it. Now we start actually looking towards actual data!
We need some extra functions for making everything else go together.
We need some extra functions for making everything else go together.
This includes extra parsers, a main method, and code for other things.
This includes extra parsers, a main method, and code for other things.
\input
{
lhs/LysKom/ProtocolA/Helpers.lhs
}
\lstinputlisting
{
lhs/LysKom/ProtocolA/Helpers.hs
}
\chapter
{
AST examples
}
\label
{
app:ast
}
Here follows some examples on syntax trees constructed from the parser
detailed in chapter~
\ref
{
cha:bnfast
}
. The section isn't really necessary, but
should be good as a reference when figuring out how the parser contraction
works.
\input
{
lhs/Ast.lhs
}
\end{document}
\end{document}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment