An implementation of a regular exression parser, which checks whether a given string matches a given regular expression or not. This regular expression metacharacters follow the POSIX standards.
An implementation of a regex parser accepting POSIX based regular expressions as given here http://jlsoper.tripod.com/regExp/Use_Regular_Expressions.html as input.
Instructions for running the C parser:
- gcc parser.c
- ./a.out
- Enter the regular expression,
- Enter the test string,
Instructions for running the Python Interactive Parser
- python3 interactive_parser.py
Instructions for running the Scala Interactive Parser
- cd scala/src
- pass the full path to parser.c as a commandline argument : eg : scala Parser.scala /Users/shubhi/Public/ProgrammingLanguages/parser
Instructions for running the Swift Parser
- swift parser_swift.swift
- To check for different inputs, open parser_swift.swift in an editor and pass the regex and the string to "shell". eg: shell("./parser","a+bc", "aabc"), where a+bc is the regex and aabc is the test string.
Instructions for running the GO Parser
- Create a workspace for GO
- Create a folder named src in the workspace
- Create a folder "parser_go" in the src folder
- Copy the parser_go.go provided in the main folder to the parser_go folder
- Open parser_go.go in an editor and change the path of the compiled parser on line 10 eg: command := "/Users/avaniarora/Desktop/ProgrammingLanguages/./parser" + " " + regex + " " + text
- After saving the changes, on the terminal a) go build //compiles the go program b) ./parser_go