Re: REGEX (Not allowing file extenstions) or the dot
From: Jürgen Exner (jurgenex_at_hotmail.com)
Date: 10/04/03
- Next message: Tad McClellan: "Re: REGEX (Not allowing file extenstions) or the dot"
- Previous message: Purl Gurl: "Re: waitpid and alarms"
- In reply to: sts_at_news.sts: "REGEX (Not allowing file extenstions) or the dot"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 04 Oct 2003 04:35:14 GMT
sts@news.sts wrote:
> REGULAR EXPRESSION
>
> PROGRAM: Quake2
> CODE: C+
>
[long convoluted explanation of some syntax snipped]
You may not realize it as such but to me this sounds like you want to write
a parser and context checker for a language that you created.
And you are not even sure how the language works.
My advice would be to
- first define a formal language, just as you would define any programming
language
- then write a parser for it, starting with lexical and syntax analysis
- then your test for the file extensions or not file extensions will become
just one simple context condition among many others. And it will be easy to
test because you know that at that point in the tree you need to test for
exactly that condition and nothing else and you don't need to test for that
condition anywhere else, either.
As this is not really related to Perl you may get more detailed advice in a
NG that actually deals with artificial languages and parsing, e.g a compiler
construction NG.
jue
- Next message: Tad McClellan: "Re: REGEX (Not allowing file extenstions) or the dot"
- Previous message: Purl Gurl: "Re: waitpid and alarms"
- In reply to: sts_at_news.sts: "REGEX (Not allowing file extenstions) or the dot"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]