using pdf.js in mvc : Best pdf to jpg converter SDK application API .net windows wpf sharepoint GrGenNET-Manual6-part1942

5.3 PatternPart
47
NOTE(21)
Theapplicationofaruleisnotdeterministic(remembertheexampleoftheintroductionin
Section1.6),theremay bemorethanonesubgraphthatmatchesthepattern. . Inthiscase
thelocationwhichisrewrittenischosenarbitrarily(infactmatchingisjuststoppedafterthe
rstmatchfollowinganimplementation-denedorderisfound). Butwhenyoucomputeall
matches,youcanselectdeterministicallyoneofthemwithapost-matcheslter,cf.chapter
15,oryoucandosoonAPIlevel,seechapter24.
The rule fromthe rule set to apply in contrast is s chosen deterministically y by y default t by
thegraphrewritesequence (GrGen.NETfollowstheprogrammedincontrasttothegraph
grammarapproach),butyoucanintroducenon-determinismtherewiththe$ agprepended
toasequenceoperator,cf. 9.1,orthededicatedindeterministicchoicesspeciedinsection
18.3.
PatternStatement
-
Graphlet
-
;
-
HomomorphySpecication
-
;
-
exact
-
induced
-
(
-
Ident
,
-
)
-
if
-
f
-
BooleanExpr
-
;
-
g
-
if
-
(
-
BooleanExpr
-
)
-
;
-
NestedPattern
-
SubpatternEntityDeclaration
-
Thesemanticsofthevariouspatternstatementsaregivenbelow:
Graphlet
Graphlets specify connectedsubgraphs. . SeeSection5.1for r adetailedexplanationof
graphlets.
Isomorphic/HomomorphicMatching
SeeSubsection5.3.1foradiscussionofthis.
AttributeConditions
TheJava-likeattribute conditions (keywordif) inthepatternpartallowfor further
restrictionoftheapplicabilityofarule.ThepatterncanonlymatchiftheBooleanEx-
pression(seechapter6)isevaluatedtotrue.
PatternModiers
Additionallytomodiersthatapplytoapatternasawhole,youmayalsospecifypat-
ternmodiersforaspecicsetofnodes.Accordinglythelistofidentiersforapattern
modiermustnotcontainanyedgeidentier. SeeSection10.1for r anexplanationof
theexactandinducedmodiers.
Best pdf to jpg converter - Convert PDF to JPEG images in C#.net, ASP.NET MVC, WinForms, WPF project
How to convert PDF to JPEG using C#.NET PDF to JPEG conversion / converter library control SDK
convert pdf to jpg for online; convert pdf into jpg online
Best pdf to jpg converter - VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.net, ASP.NET MVC, WinForms, WPF project
Online Tutorial for PDF to JPEG (JPG) Conversion in VB.NET Image Application
.pdf to jpg; convert pdf to gif or jpg
48
RuleLanguage
NestedPattern
willbeexplainedin7.1,7.2,7.3,7.4.
SubpatternEntityDeclaration
willbeexplainedin8.1.
Keepinmindthatusingtypeconstraintsorthetypeofoperatormightbehelpful. See
Section6.7forfurtherinformation.
ReturnStatement
-
return
-
(
-
Ident
-
Expression
,
-
)
-
;
-
Returnedgraphelements (givenby theirname) andvalueentities (givenbyanexpression
computingthem)mustappearinthesameorderasdenedbythereturntypes inthesig-
nature(seeSection5.2,ActionSignature). Their r types mustbecompatibletothereturn
typesspecied.
NOTE(22)
Ifyou are using a graphat t the API levelwithout shell-provided d names s accessible by y the
nameof-operator,youmaywanttonumberthegraphelementsfordumpinglikethis(alter-
natively youmayusetheuniqueindex,cf. 22.2.9;it t doesnotallowyoumanualhandling,
butitalsoaltogethersparesyoufrommanualhandling):
1
rulenumberNode(var id:int): (int)
2
{
3
n:NodeWithIntId;
4
if{ n.id==0;}
5
6
modify {
7
eval {
8
n.id= id;
9
}
10
return(id+ 1);
11
}
12
}
5.3.1 IsomorphicandHomomorphicMatching
HomomorphySpecication
-
hom
-
(
-
Ident
,
-
)
-
;
-
independent
-
(
-
Ident
-
TypeConstraint
-
)
-
;
-
ThematchingofpatternelementstohostgraphelementsinGrGen.NETisisomorphic
(injective)bydefault,i.e. twopatternelements s cannot t beboundtothesamehost t graph
Online Convert PDF to Jpeg images. Best free online PDF JPEG
Online PDF to JPEG Converter. Download Free Trial. Convert a PDF File to JPG. Drag and drop your PDF in the box above and we'll convert the files for you.
convert pdf file to jpg; batch convert pdf to jpg
Online Convert Jpeg to PDF file. Best free online export Jpg image
Online JPEG to PDF Converter. Download Free Trial. Convert a JPG to PDF. You can drag and drop your JPG file in the box, and then start
convert pdf image to jpg image; .pdf to .jpg online
5.4 Replace/ModifyPart
49
element. Thehomoperatorspeciesthenodesoredgesthatmaybematchedhomomorphi-
cally. Incontrasttothedefaultisomorphicmatching,thespeciedgraphelementsmaybe
mappedtothesamegraphelementinthehostgraph. Notethatthe e graphelements must
haveacommonsubtype.Severalhomomorphicallymatchedgraphelementswillbemapped
toagraphelementofacommonsubtype. InExample58nodesn1andn2maybethesame
node. Thisis s possiblebecausetheyareofthesametype(NodeTypeA).InsideaNAC/PAC
the hom operator may y only y operate ongraphelements s that t are either dened d or used in
theNAC/PAC(cf.7.1/7.2). Nestednegative/independentblocksinheritthehomdeclara-
tionsoftheirnestingpattern. IncontrasttopreviousversionsofGrGenhomdelarationsare
non-transitive,i.ehom(a,b)andhom(b,c)don’tcausehom(a,c)unlessspecied.
Theindependent operator species the node or edge given n within the parentheses s to
be homomorphic to all the other patternelements. . Withthe e constraint clause following,
exceptionscanbegivendeningthepatternelementsitmustbedistinctto. Thuswegota
specicationmoderequestinghomomorphicmatchingwithadditionalisomorphyexceptions
incontrasttothedefaultmode,requestingisomorphicmatchingwithadditionalhomomor-
phy exception. . It t is recommendedto not t use e the independent operator, it it potentially
dangerousallowingtocarryoutcon ictingrewrites,withanelementatobedeleted,element
b to be kept,andelement c to be retyped,allmapping to the same graphelement (you
willexperiencefunnyeectsand/orcrashesinthiscase;thehomoperatoroerssomestatic
checksagainstthis).Theoperatorisavailableasalastresortforsomesituationsinmatching
complexstructureswithiteratedandsubpatterns,inwhichitis unfeasibleor not possible
toexplicitlygiveelementsthepatternelementmaybehomomorphicto,becausetheywere
matchedinapatternatanarbitrarydistanceinthederivationpathwhichonlydynamically
calledthepatternofinterest,i.e.theycan’tbereferencedbyname,cf.8.4.
5.4 Replace/ModifyPart
Besides specifyingthepattern,a maintask ofa ruleis to specify thetransformation n ofa
matchedsubgraph withinthe host t graph. . Sucha a transformationspecicationdenes the
transition from the left t hand d side (LHS) ) to the right hand d side (RHS), i.e. which graph
elements ofamatchwillbekept,whichofthemwillbedeletedandwhichgraphelements
havetobenewlycreated.
5.4.1 ImplicitDenitionofthePreservationMorphismr
Intheorythetransformationspecicationisdonebydeningthepreservationmorphismr.
InGrGen.NET thepreservationmorphismrisdenedimplicitlybyusingnamesbothin
L
R
H
H
0
PatternGraph
Matchm
HostGraph
RewriteGraph
ResultGraph
PreservationMorphismr
Rule
RuleApplication
Figure5.1: ProcessofGraphTransformation
patterngraphlets andrewrite graphlets. . Remember r that to eachof thegraph h elementsa
name is bound to, either user denedor internally dened. . If f such a name is s used ina
rewritegraphlet,thedenotedgraphelementwillbekept. Otherwisethegraphelementwill
C# WPF PDF Viewer SDK to convert and export PDF document to other
Best PDF Viewer control as well as a powerful .NET WinForms application to image file formats with high quality, support converting PDF to PNG, JPG, BMP and
convert pdf to jpg converter; pdf to jpeg
C# PDF Convert to Images SDK: Convert PDF to png, gif images in C#
Best PDF converter SDK for Visual Studio .NET for converting PDF to image in C#.NET Support exporting PDF to multiple image forms, including Jpg, Png, Bmp
best pdf to jpg converter for; change pdf to jpg file
50
RuleLanguage
bedeleted.Bydeninganameinarewritegraphletacorrespondinggraphelementwillbe
newly created. . Soinarewrite e patternanonymous graphelements willalways be created.
Usinganamemultipletimeshasthesameeectasasingleusingoccurrence. Incaseofa
con ictbetweendeletionandpreservation,deletionisprioritized. Ifanincidentnodeofan
edgegetsdeleted,theedgewillbedeletedaswell(incompliancetotheSPOsemantics).
Pattern(LHS)
Rewrite(RHS) r:L !R
Meaning
x:T;
x;
r:lhs:x7!rhs:x
Preservation
x:T;
lhs:x=2def(r)
Deletion
x:T;
rhs:x=2ran(r)
Creation
x:T;
x:T;
|
Illegal,redenitionof x
-e:T-> ;
-e-> x:Node;
|
Illegal,redirectionof e
x:N -e:E-> y:N; ; x x -e-> ;
r:flhs:xg7!frhs:xg Deletionofy.Hencedel-
etionofe.
Table5.1: Denitionofthepreservationmorphismr
5.4.2 SpecicationModesforGraphTransformation
Forthetaskofrewriting,GrGen.NETprovidestwodierentmodes:Areplacemodeanda
modifymode.
Replacemode
Thesemanticsofthismodeistodeleteeverygraphelementofthepatternthatisnot
used(referenced)intherewritepart,keepeverygraphelementthatisused,andcreate
every additionally dened d graphelement. . \Using" " meansthat the name of agraph
elementoccursinarewritegraphlet. Attributecalculationsarenousingoccurrences.
InExample11thenodesvarnodeandn3willbekept.Thenoden1isreplacedbythe
noden5preservingn1’sedges. Theanonymousedgeinstancebetweenn1andn2only
occursinthepatternandthereforegetsdeleted.
SeeSection5.4.1foradetailedexplanationofthetransformationsemantics.
Modifymode
Themodifymodecanberegardedasarewritepartinreplacemode,whereeverypattern
graphelementisadded(occurs)beforetherstrewritestatement. Inparticularallthe
anonymous graph h elements s are e kept. . Additionally y this s mode supports the delete
operatorthatdeleteseveryelementgivenasanargument.Deletiontakesplaceafterall
otherrewriteoperations. Multipledeletionofthesamegraphelementisallowed(but
pointless)aswellasdeletionofjustcreatedelements(pointless,too).
NOTE (23)
Ingeneralmodify modeshouldbe preferredasitallows toreadtherewrite part as
adiofthechanges tobe made tothe patternpart,whereasreplace moderequires
comparingtheLHSandRHSpatternwhilereadingtondoutaboutthechanges.Only
ifmostofthepatternistobedeletedisthereplacemodeadvantageous,pinpointing
whatshouldstay.(Furthermoreitmightbesimplertogeneratecodefor,justdumping
bothpatterns.)
C# Create PDF from images Library to convert Jpeg, png images to
Best and professional C# image to PDF converter SDK for Visual Studio .NET. Batch convert PDF documents from multiple image formats, including Jpg, Png, Bmp, Gif
convert pdf document to jpg; convert pdf image to jpg online
VB.NET PDF - Convert PDF with VB.NET WPF PDF Viewer
Best WPF PDF Viewer control as well as a powerful PDF converter. PDF to image file formats with high quality, support converting PDF to PNG, JPG, BMP and GIF.
convert pdf document to jpg; convert pdf into jpg
5.4 Replace/ModifyPart
51
EXAMPLE(12)
HowmightExample11lookinmodifymode? Wehavetodenominatetheanonymousedge
betweenn1andn2inordertodeleteit.Thenodevarnodeshouldbekeptanddoesnotneed
toappearinthemodifypart.Sowehave
1
ruleSomeRuleExtModify(varnode:Node):(Node,EdgeTypeB) {
2
...
3
n1-e0:Edge-> n2;
4
...
5
modify {
6
n5:NodeTypeC<n1>;
7
n3-e1:EdgeTypeB-> n5;
8
delete(e0);
9
eval {
10
...
5.4.3 Syntax
Rewrite
-
replace
-
modify
-
f
RewriteStatement
-
ReturnStatement

ExecStatement
-
g
-
Selectswhetherreplacemodeormodifymodeisused.Severalrewritestatementsdescribethe
transformationfromthepatternsubgraphtothedestinationsubgraph.TheReturnStatement
wasalreadyintroduced,fortestsitcanappearinthepatternpart. Insiderulesitcanonly
begivenintherewritepart. TheExecStatement t willbeintroducedinchapter11.
RewriteStatement
-
Graphlet
-
;
-
delete
-
(
-
Ident
,
-
)
-
;
-
eval
-
f
-
ComputationStatement
-
g
-
SubpatternRewriteApplication
-
Thesemanticsofthevariousrewritestatementsare:
VB.NET Create PDF from images Library to convert Jpeg, png images
Best and professional image to PDF converter SDK for Visual Studio .NET. Support create PDF from multiple image formats in VB.NET, including Jpg, Png, Bmp
change pdf to jpg; change from pdf to jpg
VB.NET PDF Convert to Images SDK: Convert PDF to png, gif images
Best adobe PDF to image converter SDK for Visual Studio .NET. Convert PDF documents to multiple image formats, including Jpg, Png, Bmp, Gif, Tiff, Bitmap
convert pdf to jpg for online; batch pdf to jpg converter online
52
RuleLanguage
Graphlet
Analogous to apatterngraphlet; ; aspecicationofaconnectedsubgraph. . Itsgraph
elementsareeitherkeptbecausetheyareelementsofthepatternoraddedotherwise.
Namesdenedinthepatternpartmustnotberedenedintherewritegraphlet. See
Section5.1foradetailedexplanationofgraphlets.
Deletion
Thedeleteoperatorisonlyavailableinmodifymode.Itdeletesthespeciedpattern
graph elements. . Multiple e occurrences s of f delete e statements are allowed. . Deletion
statements areexecutedafter r all l other r rewrite statements. . Multiple e deletionofthe
samegraphelementisallowed(butpointless)aswellasdeletionofjustcreatedelements
(pointless,too).
Computation(AttributeEvaluation)
Ifaruleisapplied,thentheattributesofmatchedandinsertedgraphelementswillbe
recalculatedaccordingtotheevalstatements. Besidesattributeevaluations,further
computations maybeexecutedandside eects applied, , see Chapter12for r moreon
this.
SubpatternRewriteApplication
willbeexplainedin8.2.
Severalattributeevaluationpartsmaybegivenwithintherewriteblock. Multipleeval-
uationstatementswillbeinternallyconcatenated,preservingtheir order. . Evaluationtakes
placebeforeanygraphelementspeciedtobedeletedbytherulegetsdeletedandafterall
thenewelements(accordingtotherulerewritepart)havebeencreated.Youmayread(and
write,althoughthisispointless)attributesofgraphelementstobedeleted.
EXAMPLE(13)
1
...
2
modify{
3
...
4
eval{ y.i =40; }
5
eval{ y.j =0; ; }
6
x:IJNode;
7
y:IJNode;
8
delete(x);
9
eval{
10
x.i= 1;
11
y.j= x.i;
12
x.i= x.i+ 1;
13
y.i= y.i+ x.i;
14
}
15
}
Thistoyexampleyieldsy.i=42,y.j=1.
5.4 Replace/ModifyPart
53
EXAMPLE(14)
Theimagesfromabovevisualizethebasicgraphoperationsintroducedinthischapter,ren-
deredbythedebugger(cf.Chapter21).
Theguretotheleftshowshowthepatternofexamplerulerfrombelowismatchedinatiny
examplegraph(builtfromnodesoftypesNodeandN,thelatterbearinganattributeioftype
int,andedgesoftypeEdge). Matchednodesarecoloredinlight-brown,incontrasttothe
defaultyellowofunmatchednodes$1and$3,andhavethenameofthepatternelementthat
wasmappedtotheminscribed,hereweseepatternnodenmatchedto$0,andpatternnode
mmatchedto$2.Theunmatchededges$4and$7areshownwithathinarrow,thematched
edge$5withathickarrow,inadditionithastheauto-assignedname
edge0inscribed.The
attributeconditionn.i == 42issatisedascanbeseenfromtheinfotagshownatnode$0.
Notethatmcouldhavebeenmatchedto$1instead.
Thegure totherightshowshowthemodications oftherewritepart areappliedat the
matchedspot.Node$2boundtomisdeleted,thisisshownwithgraycolor("fadetogray");
accordingtoSPOsemantics,itdragsedges$4and$5withit.Node$8iscreatedforpattern
nodeo,andedge$9forpatternedge
edge1(whichisagainanauto-generatedname,whichis
whatGrGen.NETdoesunderthecoversforanonymouspatternelements.) Graphelement
creationis visualizedingreencolor. . Additionally,theattribute e assignment n.i i = = 43was
carriedout.
1
rule r
2
{
3
n:N --> m:Node;
4
if{ n.i == 42;}
5
6
modify {
7
delete(m);
8
n --> o:Node;
9
eval {n.i= 43;}
10
}
11
}
54
RuleLanguage
CHAPTER 6
BASIC TYPES AND D ATTRIBUTE EVALUATION
EXPRESSIONS
6.1 Built-InTypes
Besidesuser-denednodetypes,edgetypes,andenumerationtypes(asintroducedinChap-
ter4),GrGen.NETsupportsthebuilt-inprimitivetypesinTable6.1(andbuilt-ingeneric
types, cf. 13). . The e exact type format is backendspecic. . TheLGSPBackend d maps the
GrGen.NETprimitivetypestothecorrespondingC#primitivetypes.
boolean
Coversthevaluestrueandfalse
byte, short, , int, long
Asignedinteger,with8bits,with16bits,with32bits,with
64bits
float,double
A oating-point number,withsingleprecision,withdouble
precision
string
Acharactersequenceofarbitrarylength
object
Containsa.NETobject
Table6.1: GrGen.NETbuilt-inprimitivetypes
P
P
P
P
P
P
P
P
P
to
from
enum
boolean
int
double
string
object
enum
=/|
boolean
=
int
implicit
=
(int)
double
implicit
implicit
=
string
implicit
implicit
implicit
implicit
=
implicit
object
(object) (object) (object) (object) ) (object)
=
Table6.2: GrGen.NETtypecasts
Table6.2listsGrGen.NET’simplicittypecastsandtheallowedexplicittypecasts.Of
courseyouarefreetoexpressanimplicittypecastbyanexplicittypecastaswellas\cast"
atypetoitself.Theintisthedefaultintegertype,inthetableitstandsforalltheinteger
types.Thedoubleisthedefault oatingpointtype,inthetableitstandsforallthe oating
points types. . Theintegertypesare e implicitlycastedupwardsfromsmallertolargertypes
(byte < short < < int t < long),whereasadowncastrequiresanexplicitcast. Thebyteand
shorttypes arenotusedincomputations,they arecastedupto int (orlong ifrequired
bythecontext.) The oatingpointtypesareimplicitlycastedupwards(float < < double),
andrequireanexplicitcastdownwards,too. Asspeciedbythetable,integernumbersare
automaticallycastedto oatingpointnumbers,andcastablewithanexplicitcastviceversa.
According tothe table neither r implicit t nor explicit casts from m int t to any enumtype are
allowed. Thisisbecausetherangeofanenumtypeisverysparseingeneral. . Forthesame
55
56
BasicTypesandAttributeEvaluationExpressions
reasonimplicitandexplicitcastsbetweenenumtypesarealsoforbidden.Thus,enumvalues
canonlybeassignedtoattributeshavingthesameenumtype. Acastofanenumvalueto
astringvaluewillreturnthedeclarednameoftheenumvalue. Acastofanobjectvalueto
astringvaluewillreturn\null"oritwillcallthetoString()methodofthe.NETobject.
Everythingisimplicitlycastedtostringtoenableconcisetextoutputwithouttheneedfor
boilerplate casting. . Be e carefulwith assignmentsofobjects: : GrGen.NET T does not know
your.NETtypehierarchyandthereforeitcannotchecktwoobjectsfortypecompatibility.
ObjectsoftypeobjectarenotveryusefulforGrGen.NETprocessingandtheim/exporters
can’thandlethem,buttheycanbeusedontheAPIlevel.
EXAMPLE(15)
 Allowed:
x.myfloat = x.myint; x.mydouble = (float) x.myint;
x.mystring = = (string) ) x.mybool;
 Forbidden:
x.myfloat = x.mydouble;andx.myint t = = (int) ) x.mybool;
MyEnum1 = (MyEnum1Type) int; ; and d MyEnum2 2 = (MyEnum2Type) MyEnum1; ; where
myenum1andmyenum2aredierentenumtypes.
NOTE(24)
Unlikeaneval part(whichmust not containassignments to node or edge attributes) the
declarationofanenumtypecancontainassignmentsofintvaluestoenumitems(seeSec-
tion4.2). Thereasonis,thattherangeofanenumtypeisjustdenedinthatcontext.
6.2 Expressions
GrGen.NETsupportsnumerousoperationsontheentitiesofthetypesintroducedabove,
whichareorganizedintoleftassociativeexpressions. Inthefollowingtheywillbeexplained
withtheir semantics andrelative priorities one type after another in n the order r ofthe rail
diagrambelow.
Expression
-
BoolExpr
-
RelationalExpr
-
IntExpr
-
FloatExpr
-
StringExpr
-
TypeExpr
-
PrimaryExpr
-
Documents you may be interested
Documents you may be interested