thats my code so far, I'm trying to make a lisp -> bash compiler. this is what i have so far for the tokenizer part of the parser written in bash unfortunately my regexp knowledge is quite weak, i need help, so far this works by changing every ( and ) into a "parens". I want to change the ( into a "start_parens'\n'" and the ) into a "'\n'end_parens" in one pass/regexp. is this possible?#!/bin/bash
filename=$1
rm -f output.ir
one=`cat $filename`
echo -e ${one//[()]/'\n'parens'\n'} >> output.ir
edit: meanig can i do conditional substring replacement?
Bookmarks