pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DESIGN subcommand in GLM


From: Ben Pfaff
Subject: Re: DESIGN subcommand in GLM
Date: Fri, 14 Aug 2009 14:27:28 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Jason Stover <address@hidden> writes:

> I'm thinking about how to write the parser for the DESIGN
> subcommand. My question is where to start reading. I have been reading
> the code in lexer.c and variable-parser.c.  Before I dive in, I just
> want to know if I'm looking in the right place.
>
> An example of the use of the DESIGN subcommand might look like this:
>
> DESIGN A, B, A*D
>
> ...which tells me the design matrix should have a column for the
> variable A, a column for the variable B, and columns for an
> interaction between variables A and D. Another possibility
> is 
>
> DESIGN A, B, A(B)
>
> ...which tells me the variable A is "nested" in the variable B
> (which sounds backwards, but that's the notation).
>
> To write the parser, should I be looking at something like lex_get,
> or is there a set of higher-level functions that will do the job?

You will probably need to use lex_get() level functions somewhat.

For parsing a single variable name, parse_variable() is the right
function.  For parsing multiple variable names with support for
ranges, etc. (e.g. "VAR001 TO VAR003"), parse_variables() is
useful.

I do have plans for an easier parsing infrastructure.  Someday...
-- 
Ben Pfaff 
http://benpfaff.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]