Automata-based programming

The program in C++ using object-oriented style could look like this: To minimize changes not directly related to the subject of the article, the input/output getchar and putchar functions from the standard library of C are being used.Its main advantages over code using state-transition tables are that virtual function calls are often more efficient than table lookups, that state-transition criteria are more explicit than in tabular format, and that it is easier to add actions accompanying state transitions.The combination of possible states can generate a wide variety of events, thus defining a more complex production cycle.There are commonly parallel branches running together and alternatives selected according to different events, schematically represented below: Automata-based programming is widely used in lexical and syntactic analyses.For instance, UML-based software architecture development uses state diagrams to specify the behaviour of the program.Thinking in terms of automata (steps and states) can also be used to describe semantics of some programming languages.Alexander Ollongren in his book[2] explains the so-called Vienna method of programming languages semantics description which is fully based on formal automata.Automata-based techniques were used widely in the domains where there are algorithms based on automata theory, such as formal language analyses.[3] One of the earliest mentions of automata-based programming as a general technique is found in the paper by Peter Naur, 1963.Such methods must not call each other nor themselves, neither directly nor indirectly, otherwise the object can not be considered to be implemented in an automata-based manner.
The state diagram of a finite-state machine that prints the first word of each line of an input stream. The machine follows exactly one transition on each step, depending on the current state and the encountered character. The action accompanying a transition is either a no-operation or the printing of the encountered character, denoted with print .
Automata-based programming (Shalyto's approach)programming paradigmfinite-state machineautomata theoryTuring machinesMarkov algorithmswhitespacenewlineend-of-filefinite-state machinesstate-transition tablestate diagramobject-oriented programmingencapsulateinput/outputstate design patternautomationpseudo-codelexicalsyntactic analysesevent-driven programmingformal specificationcommunication protocolsprogramming languagesContinuationsSchemecall/ccPeter NaurTuring machineprogram statecomputer programimperativelocal variablesinstruction pointerCellular automatonNondeterministic programmingState patternEsterelProgramming paradigmsComparison by languageStructuredJackson structuresBlock-structuredModularNon-structuredProceduralProgramming in the large and in the smallDesign by contractInvariant-basedNested functionObject-orientedcomparisonClass-basedPrototype-basedObject-basedImmutable objectPersistentUniform Function Call SyntaxDeclarativeFunctionalRecursiveAnonymous functionPartial applicationHigher-orderPurely functionalStrictDependent typesFunctional logicPoint-free styleExpression-orientedApplicativeConcatenativeFunction-levelValue-levelDataflowFlow-basedReactiveFunctional reactiveSignalsStreamsSynchronousAbductive logicAnswer setConstraintConstraint logicInductive logicNondeterministicOntologyProbabilistic logicAlgebraic modelingActionCommandSpacecraftDifferentiableEnd-userGrammar-orientedInterface descriptionLanguage-orientedList comprehensionLow-codeModelingNatural languageNon-English-basedPage descriptionfiltersProbabilisticQuantumScientificScriptingSet-theoreticSimulationStack-basedSystemTactileTemplatingTransformationGraph rewritingProductionPatternVisualConcurrentdistributedparallelActor-basedAutomatic mutual exclusionChoreographic programmingConcurrent logicConcurrent constraint logicConcurrent OOMacroprogrammingMultitier programmingOrganic computingParallel programming modelsPartitioned global address spaceProcess-orientedRelativistic programmingService-orientedStructured concurrencyMetaprogrammingAttribute-orientedAutomaticInductiveDynamicExtensibleGenericHomoiconicityInteractiveHygienicMetalinguistic abstractionMulti-stageProgram synthesisBayesianInferentialby demonstrationby exampleReflectiveSelf-modifying codeSymbolicTemplateSeparationof concernsAspectsComponentsData-drivenData-orientedEvent-drivenFeaturesIntentionalLiterateSubjects