Mercurial > pub > Impl
view Lib/IMPL/Text/Parser/Chunk.pm @ 241:f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
*TTDocuments now storing creation parameters
*TTControls automatically propagating layout and title meta to their attributes
+Added UnauthorizaedException web exception
*minor fixes
author | sergey |
---|---|
date | Thu, 18 Oct 2012 04:49:55 +0400 |
parents | d1676be8afcc |
children | 4ddb27ff4a0b |
line wrap: on
line source
package IMPL::Text::Parser::Chunk; use strict; use warnings; use parent qw(IMPL::Object IMPL::Object::Autofill); use IMPL::Class::Property; use IMPL::Class::Property::Direct; use constant { OP_REGEXP => 1, OP_STRING => 2, OP_REFERENCE => 3, OP_CHUNK => 4, OP_SWITCH => 5, OP_REPEAT => 7 }; BEGIN { public _direct property chunkName => prop_get; public _direct property opStream => prop_get; } sub Regexp { my ($this,$rx) = @_; if (ref $rx eq 'Regexp') { } elsif (not ref $rx) { $rx = q/$rx/; } else { die new IMPL::InvalidArgumentException('A regular expression required'); } push @{$this->{$opStream}}, [OP_REGEXP, $rx]; } sub String { my ($this,$str) = @_; die new IMPL::InvalidArgumentException("A simple value is required") if ref $str; push @{$this->{$opStream}}, [OP_STRING, $str]; } sub Reference { my ($this,$ref) = @_; die new IMPL::InvalidArgumentException("A simple value is reqiured") if ref $ref; push @{$this->{$opStream}}, [OP_REFERENCE, $ref]; } sub Chunk { my ($this,$chunk) = @_; die new IMPL::InvalidArgumentException unless UNIVERSAL::isa($chunk,'IMPL::Text::Parser::Chunk'); push @{$this->{$opStream}}, [OP_CHUNK, $chunk]; } sub Switch { my $this = shift; push @{$this->{$opStream}}, [OP_SWITCH, @_]; } sub Repeat { my ($this,$chunk,$min,$max) = @_; die new IMPL::InvalidArgumentException unless UNIVERSAL::isa($chunk,'IMPL::Text::Parser::Chunk'); push @{$this->{$opStream}}, [OP_REPEAT, $chunk, $min, $max ]; } 1; __END__ =pod =head1 DESCRIPTION Именованный поток операций =head1 MEMBERS =level =item C<<$obj->>> =back =cut