summaryrefslogtreecommitdiff
path: root/static/v10/man5/fsm.10.5
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 21:07:28 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 21:07:28 -0400
commit711594636704defae873be1a355a292505585afd (patch)
tree59ee13f863830d8beba6cfd02bbe813dd486c26f /static/v10/man5/fsm.10.5
parent3258a063c1f189d7b019e40e525b46bef9b9a7b1 (diff)
docs: Added UNIX V10 Manuals
Diffstat (limited to 'static/v10/man5/fsm.10.5')
-rw-r--r--static/v10/man5/fsm.10.5116
1 files changed, 116 insertions, 0 deletions
diff --git a/static/v10/man5/fsm.10.5 b/static/v10/man5/fsm.10.5
new file mode 100644
index 00000000..9d601d5f
--- /dev/null
+++ b/static/v10/man5/fsm.10.5
@@ -0,0 +1,116 @@
+.TH FSM 10.5 UCDS
+.SH NAME
+fsm \- finite state machine language format
+.SH DESCRIPTION
+.B Fsm
+is designed to write finite state machines.
+It assumes that there are
+some number of input and output pins.
+These must be declared first.
+The input clock speed can also be declared so that the compiler will
+calculate the length of loops given in the time format.
+The input programs resemble C.
+There must be a procedure
+named
+.B main
+for the compiler to proceed.
+Procedures declared "inline"
+are called directly by the compiler to generate inline code. Otherwise
+the syntax is very familiar.
+Note that all procedures
+.B must
+be declared void.
+Therefore, there are no expressions on the return
+statement.
+.PP
+The
+.IR yacc (1)
+syntax for
+.I fsm
+is given below:
+.sp
+.nf
+.ta 20n +3n
+program : declarations procedures
+declarations : declarations declaration ;
+ | empty
+declaration : input
+ | outputDecl
+input : \f5INPUT\fP inputDetails
+inputDetails : BIT ID
+ | \f5FIELD ID < NUMBER : NUMBER >\fP
+ | \f5CLOCK\fP clockFrequency frequency
+clockFrequency : \f5NUMBER\fP
+ | \f5NUMBER . NUMBER\fP
+frequency : \f5MHZ\fP
+ | \f5KHZ\fP
+outputDecl : \f5OUTPUT\fP outputDetails
+outputDetails : \f5BIT ID\fP
+ | \f5FIELD ID < NUMBER : NUMBER >\fP
+procedures : procedures procedure
+ | empty
+procedure : inline \f5VOID ID\fP ( id_list ) statement
+inline : \f5INLINE\fP
+ | empty
+statements : statements statement
+ | empty
+statement : output
+ | loop
+ | do
+ | enabled
+ | ifprefix statement
+ | ifelseprefix statement
+ | while
+ | repeat
+ | goto
+ | break
+ | continue
+ | call
+ | label statement
+ | \f5{\fP statements \f5}\fP
+ | \f5;\fP
+call : \f5ID (\fP expression_list \f5) ;\fP
+loop : \f5LOOP\fP statement
+enabled : \f5ENABLED\fP statement
+ifprefix : \f5IF\fP boolean
+ifelseprefix : ifprefix statement \f5ELSE\fP
+while : \f5WHILE\fP whileHead boolean whileTail statement
+do : \f5DO\fP statement dopart \f5;\fP
+dopart : \f5UNTIL\fP boolean
+ | \f5WHILE\fP boolean
+repeat : \f5REPEAT NUMBER DO\fP statement
+output : \f5OUTPUT (\fP field_list \f5)\fP outputSuffix \f5;\fP
+outputSuffix : \f5FOR\fP timesOrCycles
+timesOrCycles : \f5NUMBER\fP times
+ | \f5NUMBER CYCLES\fP
+times : \f5NS\fP
+ | \f5US\fP
+ | \f5MS\fP
+goto : \f5GOTO ID\fP
+break : \f5BREAK\fP
+continue : \f5CONTINUE\fP
+label : \f5ID :\fP
+boolean : \f5(\fP expression \f5)\fP
+id_list : \f5ID\fP
+ | id_list \f5, ID\fP
+ | empty
+expression_list : expression
+ | expression_list \f5,\fP expression
+ | empty
+field_list : field
+ | field_list \f5,\fP field
+field : \f5ID =\fP expression
+expression : \f5(\fP expression \f5)\fP
+ | expression \f5+\fP expression
+ | expression \f5-\fP expression
+ | expression \f5&\fP expression
+ | expression \f5|\fP expression
+ | expression \f5^\fP expression
+ | expression \f5>>\fP expression
+ | expression \f5<<\fP expression
+ | \f5~\fP expression
+ | \f5!\fP expression
+ | \f5INPUT ( ID )\fP
+ | \f5ID\fP
+ | \f5NUMBER\fP
+.fi