Writing code to read commands from a file - understanding markup style strings using Python2019 Community Moderator ElectionBest way to strip punctuation from a string in PythonUnicode (UTF-8) reading and writing to files in PythonConverting from a string to boolean in Python?How do I trim whitespace from a Python string?Writing a list to a file with PythonPython Print String To Text FileReading entire file in PythonHow to read a large file, line by line, in PythonHow to read a text file into a string variable and strip newlines?Why is reading lines from stdin much slower in C++ than Python?

Wrapping homogeneous python objects

Hausdorff dimension of the boundary of fibres of Lipschitz maps

How can an organ that provides biological immortality be unable to regenerate?

Naive Monte Carlo, MCMC and their use in Bayesian Theory

A Ri-diddley-iley Riddle

Is honey really a supersaturated solution? Does heating to un-crystalize redissolve it or melt it?

Unfrosted light bulb

Is it insecure to send a password in a `curl` command?

Is there a term for accumulated dirt on the outside of your hands and feet?

Worshiping one God at a time?

What exactly term 'companion plants' means?

In Aliens, how many people were on LV-426 before the Marines arrived​?

In what cases must I use 了 and in what cases not?

Replace four times with sed

Bash - pair each line of file

Fewest number of steps to reach 200 using special calculator

How to get the n-th line after a grepped one?

What does "Four-F." mean?

Synchronized implementation of a bank account in Java

Does the attack bonus from a Masterwork weapon stack with the attack bonus from Masterwork ammunition?

What is the significance behind "40 days" that often appears in the Bible?

Variable completely messes up echoed string

Is there a hypothetical scenario that would make Earth uninhabitable for humans, but not for (the majority of) other animals?

Why is indicated airspeed rather than ground speed used during the takeoff roll?



Writing code to read commands from a file - understanding markup style strings using Python



2019 Community Moderator ElectionBest way to strip punctuation from a string in PythonUnicode (UTF-8) reading and writing to files in PythonConverting from a string to boolean in Python?How do I trim whitespace from a Python string?Writing a list to a file with PythonPython Print String To Text FileReading entire file in PythonHow to read a large file, line by line, in PythonHow to read a text file into a string variable and strip newlines?Why is reading lines from stdin much slower in C++ than Python?










0















I would like to write a program to read a psudoocode style text file that reads structured commands in a text file and "understands" the logic written in the file. Specifically, I would like to convert PlantUML syntax, into a UML style definition for certain files (specifically a sequence diagram)



the typical file would look like this:



@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml


As per the PlantUML spec, there are many conditions for this file (syntax and language wise) -- but I plan to read this file, and interface through the Standard API of a specific UML tool, to draw the diagram in that particular tool.



I am stuck as to HOW i would apply logic to understand the logic, given instructions could be on multi-line, and some commands could have html injected into the word, as an example,
Alice -[#0000FF]->Bob : ok



I have tried some initial attempts, and am happy to post my attempt, however, the question is rather if there are any standard frameworks to break this logic down -- do I just implement many "case" style statements and execute a function for each case?










share|improve this question






















  • pypi.org/project/plantuml Have you seen this?

    – jmiguel
    Mar 6 at 22:14












  • Thank you!. I did not look at that. I think it will help to move from UML form back to PlantUML syntax, however, i dont think it will help for the reverse.

    – Hightower
    Mar 6 at 22:40















0















I would like to write a program to read a psudoocode style text file that reads structured commands in a text file and "understands" the logic written in the file. Specifically, I would like to convert PlantUML syntax, into a UML style definition for certain files (specifically a sequence diagram)



the typical file would look like this:



@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml


As per the PlantUML spec, there are many conditions for this file (syntax and language wise) -- but I plan to read this file, and interface through the Standard API of a specific UML tool, to draw the diagram in that particular tool.



I am stuck as to HOW i would apply logic to understand the logic, given instructions could be on multi-line, and some commands could have html injected into the word, as an example,
Alice -[#0000FF]->Bob : ok



I have tried some initial attempts, and am happy to post my attempt, however, the question is rather if there are any standard frameworks to break this logic down -- do I just implement many "case" style statements and execute a function for each case?










share|improve this question






















  • pypi.org/project/plantuml Have you seen this?

    – jmiguel
    Mar 6 at 22:14












  • Thank you!. I did not look at that. I think it will help to move from UML form back to PlantUML syntax, however, i dont think it will help for the reverse.

    – Hightower
    Mar 6 at 22:40













0












0








0








I would like to write a program to read a psudoocode style text file that reads structured commands in a text file and "understands" the logic written in the file. Specifically, I would like to convert PlantUML syntax, into a UML style definition for certain files (specifically a sequence diagram)



the typical file would look like this:



@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml


As per the PlantUML spec, there are many conditions for this file (syntax and language wise) -- but I plan to read this file, and interface through the Standard API of a specific UML tool, to draw the diagram in that particular tool.



I am stuck as to HOW i would apply logic to understand the logic, given instructions could be on multi-line, and some commands could have html injected into the word, as an example,
Alice -[#0000FF]->Bob : ok



I have tried some initial attempts, and am happy to post my attempt, however, the question is rather if there are any standard frameworks to break this logic down -- do I just implement many "case" style statements and execute a function for each case?










share|improve this question














I would like to write a program to read a psudoocode style text file that reads structured commands in a text file and "understands" the logic written in the file. Specifically, I would like to convert PlantUML syntax, into a UML style definition for certain files (specifically a sequence diagram)



the typical file would look like this:



@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml


As per the PlantUML spec, there are many conditions for this file (syntax and language wise) -- but I plan to read this file, and interface through the Standard API of a specific UML tool, to draw the diagram in that particular tool.



I am stuck as to HOW i would apply logic to understand the logic, given instructions could be on multi-line, and some commands could have html injected into the word, as an example,
Alice -[#0000FF]->Bob : ok



I have tried some initial attempts, and am happy to post my attempt, however, the question is rather if there are any standard frameworks to break this logic down -- do I just implement many "case" style statements and execute a function for each case?







python parsing text






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 6 at 21:51









HightowerHightower

55121843




55121843












  • pypi.org/project/plantuml Have you seen this?

    – jmiguel
    Mar 6 at 22:14












  • Thank you!. I did not look at that. I think it will help to move from UML form back to PlantUML syntax, however, i dont think it will help for the reverse.

    – Hightower
    Mar 6 at 22:40

















  • pypi.org/project/plantuml Have you seen this?

    – jmiguel
    Mar 6 at 22:14












  • Thank you!. I did not look at that. I think it will help to move from UML form back to PlantUML syntax, however, i dont think it will help for the reverse.

    – Hightower
    Mar 6 at 22:40
















pypi.org/project/plantuml Have you seen this?

– jmiguel
Mar 6 at 22:14






pypi.org/project/plantuml Have you seen this?

– jmiguel
Mar 6 at 22:14














Thank you!. I did not look at that. I think it will help to move from UML form back to PlantUML syntax, however, i dont think it will help for the reverse.

– Hightower
Mar 6 at 22:40





Thank you!. I did not look at that. I think it will help to move from UML form back to PlantUML syntax, however, i dont think it will help for the reverse.

– Hightower
Mar 6 at 22:40












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55032732%2fwriting-code-to-read-commands-from-a-file-understanding-markup-style-strings-u%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55032732%2fwriting-code-to-read-commands-from-a-file-understanding-markup-style-strings-u%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

Алба-Юлія

Захаров Федір Захарович