[system] / trunk / pg / lib / Parser / Context.pm Repository:
ViewVC logotype

Log of /trunk/pg/lib/Parser/Context.pm

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 5696 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Jun 14 12:14:21 2008 UTC (11 years, 8 months ago) by dpvc
File length: 6933 byte(s)
Diff to previous 5439
Added

	 no strict "refs"

to try to avoid new error checking in Perl 5.10.

Revision 5439 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Aug 28 21:53:42 2007 UTC (12 years, 5 months ago) by dpvc
File length: 6915 byte(s)
Diff to previous 5369
Updated contexts to include a "name" field that at least tracks what
context you started with (though it can be modified and no longer be
the same as the original context).

Remove the individual named variables in the Default.pm file; they are
now available only through the %Parser::Context::Default::context
hash.

Remove the >< and . operators, the <...> parentheses, the norm and
unit functions, and the i, j, and k constants from the Point context.
So the Point context no longer includes vectors and vector
operaterations.

Revision 5369 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Aug 19 00:30:41 2007 UTC (12 years, 6 months ago) by dpvc
File length: 6862 byte(s)
Diff to previous 5252
The "undef" in Parser::Context->getCopy(undef,"NAME") is no longer
needed, and will be ignored if provided, but you can now use

    Parser::Context->getCopy("NAME");

which is more reasonable to read.

Revision 5252 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 9 06:01:48 2007 UTC (12 years, 6 months ago) by dpvc
File length: 6761 byte(s)
Diff to previous 5238
Make sure ^ is quoted in character patterns so it doesn't become a
negatted character pattern.

Revision 5238 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Aug 7 04:30:59 2007 UTC (12 years, 6 months ago) by dpvc
File length: 6755 byte(s)
Diff to previous 5116
Use getCopy() rather than depricated get() method.

Revision 5116 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 3 10:44:30 2007 UTC (12 years, 7 months ago) by dpvc
File length: 6751 byte(s)
Diff to previous 4994
Modified the method used to tokenize a formula to use one large
pattern that includes all the token types rather than individual
patterns for variables, strings, operators, and so on.  This allows
the Parser to handle the situation where a token of one type is a
prefix of a token of another type (e.g., < as a parenthesis but <- as
an operator) without worrying about which one is checked first.  The
new mtheod is also more flexible about having additional patterns
(like quoted strings, or arbitrary variable names) and about
specifying the order in which they are applied.

Revision 4994 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jun 10 01:17:29 2007 UTC (12 years, 8 months ago) by dpvc
File length: 5159 byte(s)
Diff to previous 4981
Update to handle the fact that the Value package now includes the
context with all MathObjects.  (This may still need some work.)

Revision 4981 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 7 12:35:02 2007 UTC (12 years, 8 months ago) by dpvc
File length: 5238 byte(s)
Diff to previous 4928
Context() now always makes a copy of the context, even if it comes
from the problem's local contxt table.  That way it will work
consistently no matter where the context comes from.  (In the past, if
PGcourse.pl made a local copy of a context that it could modify, for
example, then Context() would not copy it when it was called, and that
means problems that relied on Context(name) resetting the context to
its original values would not work properly.

Revision 4928 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Apr 17 00:36:16 2007 UTC (12 years, 10 months ago) by dpvc
File length: 5521 byte(s)
Diff to previous 3714
Modified the way the Parser-based versions of the traditional answer
checkers get copies of their contexts.  They now use a new method
getCopy to obtain the copy either from the problem's context table or
the default table (rather than only from the default).  That way the
instructor can use parserCustomization.pl to customize the contexts
used by the answer checkers.

Revision 3714 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Oct 16 02:44:34 2005 UTC (14 years, 4 months ago) by dpvc
File length: 5136 byte(s)
Diff to previous 3569
Modified context data objects to provide a copy method so that the
various types of data can copy themselves (and can provide a more
comprehensive copy if necessary).

Revision 3569 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 25 03:40:44 2005 UTC (14 years, 5 months ago) by dpvc
File length: 5237 byte(s)
Diff to previous 3370
Fixed problem with Context's not properly initializing themselves with
the WW environment parameters (like zeroLevelTol and useBaseTenLog).
The copy method and the method that did an initialized copy used to be
separate routines, but that turned out to be unnecessary, so they have
now been merged (copy always tries to initialize the WW values when it
can, and when the copied context doesn't already have them).

The reason this is complicated is that a number contexts are set up
before the global.conf data is available, so these can't be
initialized with the WW values.  Also, these default contexts are
stored in the persistant processes, and we don't want to leave
possibly course-specific values lying around in them, so whenever a
context is selected, it is copied from the standard version and the
WW parameters are inserted into it.  The problem author can only
modify the copy, not the original, so this is OK with mod_perl.

The context's copy method now always tries to initialize (we used to
have to call initCoopy to get a copy that has the WW parameters
inserted).  That turned out to cause trouble with code that handled
contexts without the usual Context() command.

Revision 3370 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 12 22:29:53 2005 UTC (14 years, 7 months ago) by dpvc
File length: 5249 byte(s)
Diff to previous 3193
A first pass at making parser error messages localizable.  The
Context()->{error}{msg} hash can be used to specify translations of
the standard messages.  For example,

    Context()->{error}{msg}{'Division by zero'} = "Don't divide by zero, dude!";
    Context()->{error}{msg}{'Function '%s' has too many inputs'} =
        "You passed too many arguments to '%s'";

(I didn't translate into another language, here, but you could do
that, too.)

The msg hash could also be used within answer checkers to make certain
answer messages more appropriate for the given type of expected answer.

Revision 3193 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 16 13:33:59 2005 UTC (14 years, 11 months ago) by dpvc
File length: 5246 byte(s)
Diff to previous 2907
Fixed a typo.

Revision 2907 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Oct 12 20:44:20 2004 UTC (15 years, 4 months ago) by dpvc
File length: 5246 byte(s)
Diff to previous 2796
In StandardPrecedence mode, make the precedence of function apply
match that in use by that AlgParser.

Revision 2796 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Sep 19 01:15:03 2004 UTC (15 years, 5 months ago) by dpvc
File length: 5244 byte(s)
Diff to previous 2678
Added flags that control the reductions performed by
Formula()->reduce.  Each reduction operation can be individually
enabled or disabled in the context, and in the reduce() call itself.

More complex reductions need to be developed.

Revision 2678 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 23 23:55:37 2004 UTC (15 years, 6 months ago) by dpvc
File length: 4872 byte(s)
Diff to previous 2665
Modified the parser so that the classes for the various object
constructors are stored in the context table rather than hard-coded
into the parser.  That way, you can override the default classes with
your own.  This gives you even more complete control to modify the
parser.  (You had been able to replace the definitions of operators,
functions and list-like objects, but could not override the behaviour
of numbers, strings, variables, and so on.  Now you can.)

This effects most of the files, but only by changing the name of the
calls that create the various objects.

There are also a couple of other minor fixes.

Revision 2665 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Aug 22 00:41:44 2004 UTC (15 years, 6 months ago) by dpvc
File length: 4782 byte(s)
Diff to previous 2664
Made the default context be Numeric context rather than Full context.
Since there is only one variable in this context, it will speed up
function answer checking.  It will also encourage you to choose the
correct context explicitly.

Also changed Complex context to have z as the only variable.  If you
want x and y as reals, you need to add them in by hand.  Again, this
is for efficiency in answer checking.

Revision 2664 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Aug 21 22:02:14 2004 UTC (15 years, 6 months ago) by dpvc
File length: 4779 byte(s)
Diff to previous 2647
Added a file to perform WeBWorK-specific modifications to the
Parser/Value packages.  (I've tried to make these independent of
WeBWorK, so you can use them in other perl code if you want to.)

The parameters for fuzzy reals and some of the other parameters now
are taken from the pg->{ansEvalDefaults} values (as defined in
global.conf or course.conf).  More still needs to be done with this,
however.

Revision 2647 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 19 12:18:56 2004 UTC (15 years, 6 months ago) by dpvc
File length: 4769 byte(s)
Diff to previous 2620
Context() now accepts a reference to an actual Context object rather
than a name of a predefined context, and will switch to that.

Revision 2620 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Aug 15 12:02:05 2004 UTC (15 years, 6 months ago) by dpvc
File length: 4691 byte(s)
Diff to previous 2619
Had to put back the global context variable after all.  :-(
It gets reset in Parser.pl, so it should be OK even with mod_perl.

Revision 2619 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Aug 15 00:45:46 2004 UTC (15 years, 6 months ago) by dpvc
File length: 4500 byte(s)
Diff to previous 2579
Modified Context() function so that it no longer uses a global package
variable for storing the user's context table.

Revision 2579 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 9 21:38:01 2004 UTC (15 years, 6 months ago) by dpvc
File length: 4502 byte(s)
Diff to previous 2558
Significant update to new parser.

New features include:

  Better control over format of vector output (you can now
    specify ijk-format rather than <...> format)

  "Fuzzy" reals, where the relations like == return true when the
    two values are "close enough".  (This is controlable using
    parameters similar to those used in NUM_CMP).

  The fuzzy reals are now used in vectors/points/matrices/complexes/intervals
    and so on so that their relations will also be fuzzy.  E.g.,
    (1E-13,2) == (0,3) will be true, and norm(Vector(0,1E-13)) will
    equal 0.

  The two main portions of the parser (the Parser and Value packages)
    now share a common context object for configuration purposes.

Revision 2558 - (view) (download) (as text) (annotate) - [select for diffs]
Added Wed Jul 28 20:32:33 2004 UTC (15 years, 6 months ago) by sh002i
File length: 5299 byte(s)
merged changes from rel-2-1-a1 -- stop using that branch.

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9