Digitala Vetenskapliga Arkivet

Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Analys och visualisering av beslutspunkter i C#-kod med hjälp av parsergenerering
Karlstad University, Faculty of Health, Science and Technology (starting 2013), Department of Mathematics and Computer Science (from 2013).
Karlstad University, Faculty of Health, Science and Technology (starting 2013), Department of Mathematics and Computer Science (from 2013).
2025 (Swedish)Independent thesis Basic level (professional degree), 10 credits / 15 HE creditsStudent thesisAlternative title
Analysis and visualization of decision points in C#-code using parser generation (English)
Abstract [sv]

Detta examensarbete behandlar utvecklingen av ett analysverktyg som med hjälp avparsergenerering automatiskt identifierar och tolkar beslutspunkter i C#-kod för ett au-tomatiserat transportsystem. Behovet av transparens i sådana system är stort, då beslut-slogiken ofta är svår att överblicka manuellt för en maskinoperatör. Arbetets mål hardärför varit att skapa ett verktyg som översätter if -satser, metodanrop och returvärdentill ett mer begripligt format.För att uppnå detta utvecklades en parser i programspråket C# med ANTLR somgrund(se avsnitt 2.3). Parsern är uppdelad i tre komponenter: lexer, parser och visitor.Dessa samverkar för att bygga ett syntaxträd och extrahera logiska beslut från inlästprogramkod. Analysen visualiseras med tydlig formattering och förenklade uttryck somunderlättar felsökning och vidareutveckling.Parsern utvärderades genom en jämförelse med ett AI-baserat verktyg. Resultatetvisar att den egenutvecklade parsern är träffsäker, transparent och förutsägbar, vilket görden lämplig att integrera i industriella sammanhang där beslutslogik måste granskas.AI-verktyget är däremot starkare i sin språkliga presentation, men brister i systemin-tegration och repeterbarhet. Parsern som utvecklats erbjuder därmed en tekniskt robustlösning med potential för framtida utökning och integration.

Abstract [en]

This thesis presents the development of an analysis tool that using parser generation,automatically identifies and interprets decision points in C# code for an automatedtransport system. The need for transparency in such systems is significant, as the de-cision logic is often difficult for a machine operator to interpret manually. The goal ofthe project has therefore been to create a tool that translates if -statements, method calls,and return values into a more comprehensible format.To achieve this, a parser was developed in the C# programming language usingANTLR as its foundation(see section 2.3). The parser consists of three main components:lexer, parser, and visitor. These work together to construct a syntax tree and extract lo-gical decisions from the input code. The analysis is visualized through clear indentationand simplified expressions, facilitating debugging and further development.The parser was evaluated through a comparison with an AI-based tool. The resultsshow that the custom-built parser is accurate, transparent, and predictable, making itsuitable for integration in industrial environments where decision logic must be revi-ewed. The AI tool offers stronger linguistic presentation but lacks system integrationand repeatability. The developed parser thus provides a technically robust solution withpotential for future expansion and integration.

Place, publisher, year, edition, pages
2025. , p. 47
National Category
Computer Systems Computer Sciences
Identifiers
URN: urn:nbn:se:kau:diva-105981OAI: oai:DiVA.org:kau-105981DiVA, id: diva2:1978697
Subject / course
Computer Science
Educational program
Engineering: Computer Engineering (300 ECTS credits)
Supervisors
Examiners
Available from: 2025-07-30 Created: 2025-06-27 Last updated: 2026-02-12Bibliographically approved

Open Access in DiVA

fulltext(5160 kB)97 downloads
File information
File name FULLTEXT01.pdfFile size 5160 kBChecksum SHA-512
8fea2d30b8cbe55bddbc0a72ba6df790a855a6591167ce405d7025d08475038aa0984c728fbb92740f56428c0aaf0676cf2f607aea9d229490bf13befddcd9b6
Type fulltextMimetype application/pdf

By organisation
Department of Mathematics and Computer Science (from 2013)
Computer SystemsComputer Sciences

Search outside of DiVA

GoogleGoogle Scholar
Total: 98 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 257 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf