Giter Site home page Giter Site logo

robertkirkman / dfa-scanner-cs3361 Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 88 KB

Program in C to read a deterministic finite automaton from a formatted text file, use it to scan a second text file, and print the detected tokens to the terminal. For CS 3361-001 Spring 2020 TTU.

C 99.67% Makefile 0.33%

dfa-scanner-cs3361's People

Contributors

robertkirkman avatar wecantallbelosers avatar

Watchers

 avatar

dfa-scanner-cs3361's Issues

Parentheses are not supported as transition characters

buildTransitonArr() and buildTransitionTriple() functions do not support parentheses as transition characters. This is against the specification, whichstates that transition characters may be any character except for '{', '}', and ','. Please rewrite.

buildTransitionTriple() only supports alphabetical characters.

The definitions of buildTokenPair() and buildTransitionTriple() in automaton.c ONLY support alphabetical characters. The specification states that transition characters may be "all characters that a programmer can use EXCEPT the THREE characters '{’, ’}’ and ’,’." Please rewrite to support this.

initFileBuf tries to use fseek() and ftell() to compute the size of a regular file, which is UB

initFileBuf tries to use fseek(filePtr, 0, SEEK_END) to compute the size of a file passed as a shell parameter, which is undefined behavior according to the C standard specification; see here and The ISO 99 C Standard Specification Footnote 268. Please rewrite this either in an OS-agnostic manner, or use preprocessor directives to at least support different implementations for Windows, Linux and MacOS.

scan() populates an array instead of providing a single token at a time, which is out of spec

scan() provides information about the tokens by populating the array tokenFinalStatesArr. According to the specifcation, the output of scan must be one token instead of a sequence of tokens. Please refactor, for example, into two functions, one which satisfies the requirements of the specification for the function scan(), and one perhaps named scanDriver() to manipulate that function into the existing structure of this application.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.