Skip to content

Commit 2941b2f

Browse files
committed
Move automaton table
1 parent 89ba99c commit 2941b2f

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

src/Client/Index.fs

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ let update (msg: Msg) (model: Model) : Model * Cmd<Msg> =
419419
|> SweetAlert.Run
420420

421421

422-
let projectSyntactical (grammar: Grammar) analysisTable lexSpec lexer (head: string, body: string) dispatch =
422+
let projectSyntactical (grammar: Grammar) lexSpec lexer (head: string, body: string) dispatch =
423423
let viewProductionRule (head, body) =
424424
Bulma.columns [
425425
columns.isVCentered
@@ -633,17 +633,10 @@ let projectSyntactical (grammar: Grammar) analysisTable lexSpec lexer (head: str
633633
column.isFull
634634
prop.children [ viewSpec ]
635635
]
636-
match analysisTable with
637-
| None -> ()
638-
| Some table ->
639-
Bulma.column [
640-
column.isFull
641-
prop.children [ table ]
642-
]
643636
]
644637
]
645638

646-
let projectLexical spec analysisTable (kind, name, body) dispatch =
639+
let projectLexical spec (kind, name, body) dispatch =
647640
// kinds of regular definitions
648641
let tokenOption = "token"
649642
let fragmentOption = "fragment"
@@ -958,13 +951,6 @@ let projectLexical spec analysisTable (kind, name, body) dispatch =
958951
column.isFull
959952
prop.children [ viewSpec ]
960953
]
961-
match analysisTable with
962-
| None -> ()
963-
| Some table ->
964-
Bulma.column [
965-
column.isFull
966-
prop.children [ table ]
967-
]
968954
]
969955
]
970956

@@ -1095,17 +1081,15 @@ let main model dispatch =
10951081
Bulma.cardContent [
10961082
projectLexical
10971083
model.Project.Lexicon
1098-
model.LexicalAnalysisTable
10991084
model.RegularDefinitionText
11001085
dispatch ]
11011086
]
11021087
| Syntactical ->
11031088
Bulma.card [
1104-
Bulma.cardHeader [ cardTitle "LL(1) Grammar" ]
1089+
Bulma.cardHeader [ cardTitle "LL(1) BNF Grammar" ]
11051090
Bulma.cardContent [
11061091
projectSyntactical
11071092
model.Project.Syntax
1108-
model.SyntacticalAnalysisTable
11091093
model.Project.Lexicon
11101094
model.Lexer
11111095
model.GrammarProductionText
@@ -1126,6 +1110,22 @@ let main model dispatch =
11261110
]
11271111
]
11281112

1113+
let tableInterface =
1114+
Bulma.card [
1115+
Bulma.cardHeader [ cardTitle "Automaton" ]
1116+
Bulma.cardContent [
1117+
match model.Phase with
1118+
| Lexical ->
1119+
match model.LexicalAnalysisTable with
1120+
| None -> ()
1121+
| Some table -> table
1122+
| Syntactical ->
1123+
match model.SyntacticalAnalysisTable with
1124+
| None -> ()
1125+
| Some table -> table
1126+
]
1127+
]
1128+
11291129
Bulma.columns [
11301130
columns.isMultiline
11311131
columns.isCentered
@@ -1140,6 +1140,10 @@ let main model dispatch =
11401140
column.isHalfWidescreen
11411141
prop.children [ recognitionInterface ]
11421142
]
1143+
Bulma.column [
1144+
column.isFull
1145+
prop.children [ tableInterface ]
1146+
]
11431147
]
11441148
]
11451149

0 commit comments

Comments
 (0)