using pdf.js in mvc : Convert pdf image to jpg online application software utility azure html web page visual studio GrGenNET-Manual2-part1919

1.7 AnExampleRuleApplicationontheRepresentation
7
TherulefoldCondisusedtoreplaceaconditionaljumpbyanunconditionaljump,iit
dependsjustonaconstantvalue.Tothisend,thecondisretypedtoJmp,andthedependency
ontheconstantvaluec0isdeleted.Thesyntaxname:typedeclaresanodeofthegiventype.
Anedge isdeclaredwiththesame syntax, justinscribedintoanedge --> representation.
An<original>sux denotesretyping,specifyingtheoriginalelementtoberetyped. . The
patternmatchesfurtherontheblockswhereexecutioncontinues:trueBlockandfalseBlock.
Inthetruecase(if f c0.value == 1; g),thefalseEdgetothefalseBlockisdeletedand
thetrueEdgetothetrueBlockretypedtoanormalControlflowedge;inthefalsecase,the
oppositeiscarriedout.
Here the true case e applies s as s you can see e from the value 1 1 inscribedinthe e matched
constant $5. . The e elements fromthe graph that were boundto the pattern elements are
highlightedinlight-brown,withtheirpatternnamesuxedindoubleangles,e.g. the e cond
was matched d to $7. . Blocks s thatbecome unreachable(withoutcontrol owpredecessors)
areassumedtogetdeletedinalaterstepofthetransformation,asareduplicateconstants.
ThebenetsofusingGrGen.NETcanbealreadyfeltfromthisexample,theyincreaseat
anacceleratingspeedasthepatterns(andrewrites)growinsizeandcomplexity. Notethat
theruleismodular,i.e. independentfromotherfunctionality|traditionally,functionality
issmearedovermultiplegraphrepresentationtraversalpasses,andmultiplestepsofapass.
(a)BeforefoldingtheCond,matchhighlighted.
(b)AfterfoldingtheCond.
Figure1.3: Situationreachedduringfolding g the programgraphof the minimumplus one
functionwhenappliedtoconstantarguments(renderedbythedebugger).
Convert pdf image to jpg online - 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 into jpg format; change pdf to jpg image
Convert pdf image to jpg online - 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
change format from pdf to jpg; change from pdf to jpg
8
Introduction
1.8 WhytouseGrGen.NET
GrGen.NEToersprocessing ofgraphrepresentationsattheirnaturallevelofabstraction.
Graphrepresentationsaretypicallyemployedinengineering(blueprints,designs),model
transformation(models), computer r linguistics (syntax graphs,semantic nets),orcompiler
construction (intermediate e representations, , program graphs) { but a graph is maybe the
mostnaturalrepresentationofthedataofyourdomain,too?
GrGen.NETisbuiltonarichandecientmetamodelimplementingmulti-graphs,with
multiple inheritance on node andedge types. . The e nodes and edges are wired in scalable
ringlists,whichgiveaccesstotheir incident elements inconstanttime,toallelementsofa
typeinconstanttime,andallowtoaddanddeleteelementsinconstanttime.
GrGen.NETfeaturesmodularrulesthatdon’tsmearfunctionalityintotraversalcodeas
isthecaseintraditionalpointerstructurepasses.Itoersdeclarativegraphpatternsofhigh
expressiveness,savingyoua lotofboilerplatecodethat wouldbeneededfor codingthem
manually. Andit t implements ecient graphchange rollback, , thus s allowing youtoeasily
crawlsearchspaceswithoutownbookkeeping(forundoingthechanges).
GrGen.NETcontainsaC#-likeprogramminglanguage,soyoudon’trunagainstwalls
incaseofsubtaskswheretherulesandpatternsdon’tworkwell.Thegeneral-purposesystem
ishighlyextensibleandcustomizable,youcanexpresssolutionsttingwelltoyourtaskat
hand.
GrGen.NEToerstheconvenienceofdedicatedlanguageswithwell-readablesyntaxand
statictypechecking,insteadofclunkyinternalDSLs,limitedannotations,orannoyingXML.
Itslanguagesarebroughttolifebyanoptimizingcompilerthatprunesnotneededgenerality
andgeneratespatternmatchersadaptedtothecharacteristicsofthehostgraphathand. A
runtimelibraryissuppliedthatimplementsaneasy-to-useAPI,andfeaturesbuilt-ingraph
serialization/deserialization.
Thesystemshipswithareadilyavailableshellapplicationforlemappingtasks,which
especially oers s step-wise and d visual debugging, saving you from chasing reference chains
in the debugger r of your r programming g language. . Further r mature development support is
oeredwithsearchplanexplanationandprolinginstrumentation.Moreover,GrGen.NET
isproperlydocumentedinanextensiveusermanual.
Traditionalprogrammingofgraphrepresentationprocessingistedious,itrequirescareful
orchestration of functionality attached to o passes, , boilerplate e code for r patterns, , and d low-
level pointer ddling. . You u are e more e productive e with h GrGen.NET in one-shot-coding a
solution, but t esp. . are e you so for r a a continuous development process s or r when n changes s are
neededafterwards,aGrGen.NET-specicationcanbeadapted atamuchhigherpace.
Altogether,GrGen.NEToersthehighestcombinedspeedofdevelopmentandexecution
forgraphrepresentationprocessingyoucannd.
Online Convert PDF to Jpeg images. Best free online PDF JPEG
Drag and drop your PDF in the box above and we'll convert the files for you. JPG is the most common image format on the internet.
batch convert pdf to jpg online; convert pdf to jpeg
Online Convert Jpeg to PDF file. Best free online export Jpg image
Convert a JPG to PDF. the files, try out some settings and then create the PDF files with JPG is the most widely used image format, but we believe in diversity
convert pdf to jpg batch; advanced pdf to jpg converter
CHAPTER 2
OVERVIEW
GrGen.NET iscombinedfromtwogroupsofcomponents: : The e rst consistsofthecom-
piler grgen and two o runtime e libraries, , which oer the basic functionality y of the system;
thecompilertransformsspecicationsofdeclarativegraphrewriterulesintohighlyecient
.NET-assemblies. The e second consists of the interactive command line GrShell l and the
graphvieweryComp,whichoerarapidprototypingenvironmentsupportinggraphicaland
stepwisedebuggingofrulesthatarecontrolledbysequences.
2.1 SystemOverview
Figure2.1givesanoverviewoftheGrGen.NETsystemcomponentsandtheinvolvedles.
Model
.gm
Actions
.grg
Shell
Script
.grs
App
.cs
libGr
.dll
Model
.dll
lgsp
Backend
.dll
Actions
.dll
Application.exe
GrShell.exe
GrGen.exe
csc.exe
User
creates
creates
creates
creates
generates / compiles
compiles
GrGen-based algorithmic core
uses / 
references
uses / 
references
Defines and implements  API
Runtime libs
Generated libs
in Model Language
in Rule Language with
embedded Sequences
in Model Language
in GrShell Language with
embedded Sequences
in C# / a .NET language with
embedded Sequences
Figure2.1:GrGen.NETsystemcomponentsandartifacts
A graph rewrite e system
1
is dened d by a a rule e set t le e (*.grg, , written in the e rule and
computationslanguage),whichmayincludefurtherrulesetles,andusezeroormoregraph
modeldescriptionles(*.gm,writteninthemodellanguage). Executablecodeisgenerated
from these specications by GrGen.exe; ; the e generated parts s are e assisted by y the e runtime
libraries libGr r and lgspBackend. . Together r they form the e system that t can be used via
anAPI byarbitrary.NET-applications,fortheprocessingofagraph-basedrepresentation.
1
Inthiscontext,systemislessagrammarrewritesystem,butratherasetofinteractingsoftwarecompo-
nents.
9
C# Create PDF from images Library to convert Jpeg, png images to
Batch convert PDF documents from multiple image formats, including Jpg, Png, Bmp, Gif, Tiff, Bitmap, .NET Graphics, and REImage.
convert pdf pictures to jpg; convert pdf file to jpg
C# Image Convert: How to Convert Adobe PDF to Jpeg, Png, Bmp, &
C# sample code for PDF to jpg image conversion. This demo code convert PDF file all pages to jpg images. // Define input and output files path.
c# convert pdf to jpg; best pdf to jpg converter for
10
Overview
One application n employing g the e API is shipped with h GrGen.NET, the e shell l application
GrShell. Itmaybeusedinteractively,esp. fordebugging,ormaybescripted(intheshell
language,whichallowsvialibGrtoexecutesequences,aconciselanguageoeredtocontrol
ruleapplications).
Figure2.2depictsthemajorruntimeobjects.
Application.exe
Debugger
GrShell.exe
modifies
yComp.exe
Graph
Graph Processing
Environment
Sequence
(calls Actions)
displays
displays
request execution of
modifies
executes
manages transactions
stores variables
Figure2.2: GrGen.NETmajorruntimeobjects
The central object t is s the graph, , it t adheres to the speciedgraph h model. . (In n general
youhavetodistinguishbetweenagraphmodelonthe metalevel,ahostgraphcreatedas
instanceofthegraphmodel,andastaticallyspeciedpatterngraphofarulethatmatches
a portionof the host graphat runtime). . It t maybemodieddirectly by GrShell,or by
a user application. . But t typically is it changedby the applicationofoneof thegenerated
actions,mostoftenfromwithinasequence,whichis parsedintoanoperatortreeandthen
interpreted,bythegraphprocessingenvironment.Theprocessingenvironmentmaintainsthe
globalvariablesinaddition,andmodiesthegraphdirectly incaseoftransactionrollback
(basedonthegraphchangeeventsrecordedsincetransactionstart).
TheGrShellisareadilyavailableexecutionenvironmentthatissucientformapping
tasksthatrequireonlyconsoleorleoutput. Butevenwhenyouwanttointegrateagraph
basedalgorithmiccoreintoyourexisting.NETapplication,orareforcedtowriteonebecause
youmustsupplyalong-runningapplicationreactingtoeventsfromtheenvironment,esp. to
userinput,mayyoubeinterestedinadditionallyusingtheGrShellbecauseofitsdebugging
abilities. EmployingthegraphvieweryCompitcanvisualizethegraphatanytimeduring
execution. Moreover, , it t canvisualize the e applicationof f a rule, highlighting the matched
patterninthehost graph, , andthechanges s carriedout. . It t cando so for actionsexecuted
fromasequence,whichcanbeexecutedstep-by-step,underdebuggercontrol,highlighting
thecurrentlyexecutedruleinthesequence.
2.2 TheTools
AlltheprogramsandlibrariesofGrGen.NETareopensourcelicensedunderLGPL.Notice
that the yComp p graphviewer r is not a part of GrGen.NET; ; yComp ships s withits own
licensegrantedbyyFilesforacademicuse. yCompisclosed-sourceandonlyfreefornon-
commercialuse{thismeansaboveallthatyouarenotallowedtoshipitwithareleaseof
C# Image Convert: How to Convert Tiff Image to Jpeg, Png, Bmp, &
RasterEdge.XDoc.PDF.dll. C:\input.tif"; String outputFilePath = @"C:\output.jpg"; // Convert tiff to jpg. C# sample code for TIFF to jpg image conversion.
convert from pdf to jpg; .pdf to .jpg converter online
VB.NET PDF Convert to Images SDK: Convert PDF to png, gif images
PDF. Convert PDF documents to multiple image formats, including Jpg, Png, Bmp, Gif, Tiff, Bitmap, .NET Graphics, and REImage. Turn
convert multiple pdf to jpg; batch convert pdf to jpg
2.2 TheTools
11
yourowncommercialsoftware,incontrasttotheGrGen.NETlibraries.
Executinga generatedgraphrewrite systemrequires .NET2.0orlater; compilingand
debuggingagraphrewritesysteminadditionrequiresJAVA1.5orlater. Youndthetools
inthebinsubdirectoryofyourGrGen.NETinstallation.
2.2.1 GrGen.exe
TheGrGen.exe assemblyimplementstheGrGen.NET generator. . The e Gr-
Gen.NETgenerator parses aruleset andits modellesandcompiles them
into.NETassemblies. Thecompiledassembliesformaspecicgraphrewriting
systemtogetherwiththeGrGen.NETbackend.
Usage
[mono] GrGen.exe e [-keep p [<dest-dir>]] [-use e <existing-dir>] ] [-debug]
[-b <backend-dll>] ] [-o o <output-dir>] [-r r <assembly-path>]
[-lazynic] [-noinline] ] [-profile]
[-statistics <statisticsfile>]
<rule-set>
rule-setisalecontainingarulesetspecicationaccordingtoChapter5.Usuallysuch
alehasthesux.grg. Thesux.grgmaybeomitted. . BydefaultGrGen.NET
triestowritethecompiledassembliesintothesamedirectoryastherulesetle.This
canbechangedbytheoptionalparameteroutput-dir.
Options
-keep
KeepthegeneratedC#source les. . Ifdest-dir r is s omitted, , asub-
directory tmpgrgenn
2
withinthecurrent directory willbe created.
Thedestinationdirectorycontains:
 printOutput.txt|asnapshotof f stdoutduringprogramexe-
cution.
 NameModel.cs|the e C#
source le(s) of f the e rule-
setModell.dllassembly.
 NameActions
intermediate.cs|apreliminaryversionofthe
C#sourceleoftherule-set’sactionsassembly.Thisleisfor
internaldebugpurposesonly(itcontainsthefrontendactions
output).
 NameActions.cs|the e C#
source le of the rule-
setActions.dllassembly.
-use
Don’tre-generateC#sourceles. Insteadusethelesinexisting-dir
tobuildtheassemblies.
-debug
Compiletheassemblieswithdebuginformation.
-lazynic
Negatives, Independents, and Conditions s are only executedat the
endofmatching(normallyasap).
-noinline
Subpatternusagesandindependentsarenotinlined.
-profile
Instrumentsthematchercodetocountthesearchstepscarriedout.
-statistics Generate e matchers s that are e optimized d for r graphs of f the class de-
scribedbythestatisticsle(see20.14onhowtosavesuchstatistics).
-b
Usethebackendlibrarybackend-dll (defaultisLGSPBackend).
-r
Linktheassemblyassembly-path asreferencetothecompilationre-
sult.
-o
Storegeneratedassembliesinoutput-dir.
2
nisanincreasingnumber.
C# PDF Image Extract Library: Select, copy, paste PDF images in C#
Get JPG, JPEG and other high quality image files from PDF document. Able to extract vector images from PDF. Extract image from PDF free in .NET framework
convert pdf into jpg online; change from pdf to jpg
VB.NET PDF Image Extract Library: Select, copy, paste PDF images
Scan high quality image to PDF, tiff and various image formats, including JPG, JPEG, PNG, GIF, TIFF, etc. Extract image from PDF free in .NET framework
convert pdf to jpg 100 dpi; convert multi page pdf to single jpg
12
Overview
Requires
.NET 2.0 (or r above) ) or Mono 1.2.3 (or above). . JavaRuntime e Environment 1.5 (or
above).
NOTE(1)
Regardingthecolumninformationintheerrorreportsofthecompilerpleasenotethattabs
countasonecharacter.
NOTE(2)
As.NETsupportsintegrationwithnativecode,youmayevenuseaGrGen.NET-generated
graphrewritingkernelfromanativeapplication.
NOTE(3)
Thegrgencompiler consists ofaJavafrontendusedby the C#backend d grgen.exe. . The
javafrontendcanbeexecuteditselftogetavisualizationofthemodelandtherewriterules,
intheformofadumpofthecompilerIRasa.vcgle:
java -jar grgen.jar r -i yourfile.grg
NOTE(4)
If you run into o Unable e to process specification: : The e system m cannot t find the
file specifiederrors, , grgenistypically y not abletoexecute the JAVAfrontend. . Check
whether your r path h contains a a zombie java variable from m an old installation n pointing to
nowhere; remove it t in n this s case. . Installinga a JDK to a non system pathandadding the
bin folder r ofthe JDK tothe pathvariablemay help. . (Normally y just installing aJREis
sucient.)
2.2.2 GrShell.exe
The GrShell.exe is s a a shell application on top of f the libGr. . GrShell l is
capableofcreating,manipulating,anddumpinggraphsaswellasperforming
graphrewritingwithgraphicaldebugsupport. Forfurtherinformationabout
theGrShelllanguageseeChapter20.
Usage
[mono] grShell.exe [-N] [-SI] [-C "<commands>"] <grshell-script>*
Openstheinteractiveshell.TheGrShellwillincludeandexecutethecommandsinthe
optionallistofgrshell-scripts(usually*.grsles)inthegivenorder.Thegrssuxes
may be omitted. . GrShell l returns 0onsuccessfulexecution, or r in n non-interactive
mode-1if the speciedshellscript couldnot be executed,or-2 ifa validate with
exitonfailurefailed. Thisallowsyoutobuildatest-suiteconsistingofshellscripts.
2.2 TheTools
13
Options
-N
Enablesnon-debugnon-guimodewhichexitsonerrorwithanerrorcodein-
steadofwaitingforuserinput.
-SI ShowIncludesprintsouttotheconsolewhenincludesareenteredandleft.
-C
ExecutethequotedGrShellcommandsimmediately(beforetherstscript
le).Insteadofalinebreakuseadoublesemicolon;;toseparatecommands.
Takecarethatanexecinsidesuchacommandlineneedstobeexitedwith#x
(toopenandimmediatelycloseashellcomment,neededasexecterminator,
becausenewlineterminationisnotavailablehere).
Requires
.NET2.0(orabove)orMono1.2.3(orabove).
NOTE(5)
The shell supports some e new w set t conguration n options that t map p to o the grgen compiler
ags(see20.9),usethembeforeany new w graphcommandssothatmatchersaregenerated
accordingtothecompiler agsyouwoulduseifyouwouldexecutethecompilerdirectly.
EXAMPLE(1)
The -C option is often not as s helpful as needed because e bash splits the command given
inside "" alongside spaces. . Unless s you u are a shell wizardincontrol of f escaping g and un-
escaping,youwanttoworkwithheredocuments. Thefollowingexampleshellscriptfrom
examples/MovieDatabase-TTC2014showshowtoexecuteanGrShell-scriptembeddedas
heredocumentonalllesinafolder.
1
#!/bin/bash
2
forfile in*.xmi;do
3
GrShell-N<<HERE
4
importmovies.ecore$fileGrgenifyMovieDatabase.grg
5
redirectemit$file.grs
6
execcreate_MovieDatabaseModel;> [create_Movie];>[create_Actor] ;>[create_Actress];>
[create_personToMovie]
7
redirectemit-
8
validateexitonfailure execnoEdgesLeft
9
quit
10
HERE
11
done
2.2.3 LibGr.dll
ThelibGrisa.NETassemblyimplementingGrGen.NET’sAPI.SeetheextractedHTML
documentationforinterfacedescriptionsathttp://www.grgen.net/doc/API_4_4/;ashort
introductionisgiveninchapter24.
2.2.4 lgspBackend.dll
ThelgspBackendisa.NETassemblycontainingthelibGrSearchPlanbackend,theonly
backendsupportedby GrGen.NETas ofnow,implementingtogether withthe generated
assembliestheAPIoeredbylibGr. Itallowstoanalyzethegraphandtoregeneratethe
matcherprograms atruntime,onuserrequest,see20.14. Foramoredetailedintroduction
havealookatchapter26.
14
Overview
2.2.5 yComp.jar
yComp[KBG
+
07]isagraphvisualizationtoolbasedonyFiles[yWo07].Itiswellintegrated
andshippedwithGrGen.NET,butit’snotapart ofGrGen.NET.yCompimplements
severalgraphlayoutalgorithmsandhasleformatsupportforVCG,GMLandYGFamong
others.
Usage
Usually yComp p willbe loaded by y the GrShell. . Youmight t want to open n yComp
manuallybytyping
java -jar yComp.jar [<graph-file>]
OrbyexecutingthebatchleycompunderLinux/ycomp.batunderWindows,which
willstartyComponthegivenlewithincreasedheapspace. Thegraph-le e maybe
anygraphleinasupportedformat.yCompwillopenthisleonstartup.
Hints
Thelayoutalgorithmcompilergraph(yComp’sdefaultsetting,aversionofhierarchic
optimizedfor graphbasedcompilerintermediaterepresentations) maynot beagood
choiceforyourgraphathand.Insteadorganicororthogonalmightbeworthtrying.
Usetherightmostblueplaybuttontostartthelayoutprocess.Dependingonthegraph
sizethismaytakeawhile.
Requires
JavaRuntimeEnvironment1.5(orabove).
2.3 TheLanguagesandtheirFeatures
Theprocessofgraphrewritingatruntimecanbedividedintofoursteps:Creatinganinstance
graphaccordingtoamodel,searchingapatternakandingamatch,performingchangesto
thematchedspotinthehostgraph,and,nally,selectingwhichrule(s)toapplywherenext.
Thisprocessisprogrammedatspecicationtimeutilizingagraphmodellanguage,arule
andcomputationslanguage,andthesequenceslanguageforcontrollingruleapplications.
2.3.1 GraphModelLanguage
Atthefoundationyoundthegraphmodel(meta-model)languagegivenwithclassdef-
initionsinthe styleofanobject-orientedlanguage,withsome in uences ofdatadenition
languagesasoeredbydatabases.
Itallowsyoutospecifynode andedgetypes,withmultipleinheritance onthetypes(see
Chapter 4). . Theyare e usedinbuilding atyped,directedmultigraph(supporting multiple
edgesofthesametypebetweentwonodes). Inaddition,youmaydeclareundirectedandar-
bitrarilydirectededges;ormayevenregisterexternaltypeswithGrGen.NET.Furthermore,
connectionassertionsallowyoutorestrictthe\shape"ofthegraphs.
2.3 TheLanguagesandtheirFeatures
15
Node and edge types can be e equipped d with typed d attributes, of f the commonly y known
elementary types (integerand oating-point numbers, , strings,booleans, andenums) ) or of
somecontainertypes(availablearehashmapandarraybasedtypes). Inaddition,methods
supportingdynamicdispatchmaybegiven.
Moreover,youmaycongureindices(seeChapter22):attributeindicesforaquicklookup
ofagraphelementbasedontheattributevalue,orincidencecountindicesforaquicklookup
basedonthenumberofincidentedges.Severalindicesarealreadybuilt-inandautomatically
usedby thepatternmatchers,notablythetypeindex for quicklookups basedonelement
type,andtheincidentelementsindexgivingaccesstotheneighbouringelementsinconstant
time.
2.3.2 RuleandComputationsLanguage
OntopofthegraphmodellanguageandattheheartofGrGen.NETdoyoundtherule
andcomputationslanguage.
Itsupportspattern-basedrules,whicharebuiltbyapatterntobematchedandarewriteto
becarriedout;orputdierently:aleft-hand-sidepreconditionpatternandaright-hand-side
postconditionpattern(seeChapter5). Apatternisdescribedbygraphlets,aspecicationof
nodesconnectedbyedgesinanintuitive,easilywritable,easilyreadable,andeasilychange-
able syntax.Complexpatternsarecombinedfromelementarypatternswithnestedpatterns
(deningalternative,optional,multipleanditeratedstructures,ornegativeandindependent
applicationconditions,seeChapter7)andsubpatterndenitionsandusages(seeChapter8).
Besidesthosepartsfordeclarativeprocessingofstructuralinformationareattributeconditions
(seeChapter6)andattributeevaluationsavailable,theformerareexpressionscomputingan
outputvaluebyreadingattributesofmatchedelements,thelatterarestatementschanging
attributevalueswithassignments.
Theattribute processing expressions andstatements are infact parts of a full- edged
imperativeprogramminglanguageintegratedwiththedeclarativepattern-basedrulelanguage
(seeChapter12).Theexpressionscanquerythegraphwithamultitudeofavailablefunctions
inadditiontoreadingtheattributesofmatchedelementsandcarryingoutcomputationswith
theattributes;theycomputeavalueandcanbeabstractedintofunctions. Thestatements
supportdirectgraphchangesandsupplycontrol owstatementsanddefvariabledeclarations
inadditiontotheattributeassignments;theychangethestateandcanbeabstractedinto
procedures.Youespeciallyndsubgraphoperationsfortheprocessingofnestedgraphs,with
subgraphextraction,subgraphcomparison,andsubgraphinsertion(seeChapter14).
Patternmatchingcanbeadjustedne-grainedwithhomomorphicmatchingforselected
elements(withhomdeclarations,sotheycanmatchthesamegraphelements),overridingthe
defaultisomorphicmatching,andwithtypeconstraints(forbiddingcertainstatictypes or
requiringequivalenceofdynamictypeofs).
Therewritepartofarulekeeps,addsanddeletesgraphelementsaccordingtotheSPO
approach,asspeciedbyelementdeclarationsandreferencesintheLHSandRHSpatterns
(therearethreeadditionalruleapplicationsemanticsavailable:DPOorexactpatternsonly
orinducedsubgraphs only). . Therewritepart t supportstwomodesof specication: : Arule
caneitherexpressthechangestothematch(modify-mode,requiringdeletiontobespecied
explicitly)orspecifyawholenewsubgraph(replace-mode).
Arichbouquetofsingleelementrewriteoperationsisavailableontopofthebasicones
withretyping akarelabeling,thatallowstochangethetypeofagraphelementwhilekeep-
ingitsincidentelements,withthecreationofnewnodes/edges ofonlydynamicallyknown
typesorasexactcopiesofothernodes/edges,andwithnodemergingandedgeredirection
constructs(seeChapter10). Besideschangingthegraphcanyouemituser-denedtextto
stdoutorles(supportingmodel-to-texttransformations;seeChapter11).
Aspecialclass of computations are available with h the post-match lter r functions (see
Chapter15),thatallowtoinspectandmanipulatethesetofmatchesfoundwhenapplying
16
Overview
arule(withallbracketing).Thiswayyoucanaccumulateinformationoverthematches,or
lterthematchessetforthemostinterestingmatches.Severalltersforsortingandclipping
arealreadysuppliedorcanbegeneratedautomaticallyonrequest. Symmetry y reductionis
available with alter r for duplicate e matches due to permuted elements s from automorphic
patterns.
GrGen.NETrulesaremodularorlocal:youjustnotedownthefunctionality. Typically
itissmearedintographtraversalcodeofglobalvisitingpasses.Thislimitsthechangesneeded
during development and d maintenance, , and d together with the e concise and d easily editable
patterns saves s youfrom m many y large-scale tedious modications that are normally needed
inthose cases. . Youarestillfree e to buildlocal(or evenglobal) passesby combining rules
andtests(testsareruleswithonlyaLHSpattern)utilizingparameters: inputandoutput
parametersaresupportedbyrulesandtests,thesubpatterns,andfunctionsandprocedures.
They aretypicallyusedtodeneandadvancethelocationofprocessinginthegraph,but
theyarealsousedforattributecomputations. Inadditionvisited ags s canbequeriedand
written,formarkingalreadyprocessedelements.
Subpatterns allowfor patternreuse,andallow via subpattern n recursion n tomatchsub-
structuresextendingintodepth (e.g. iteratedpaths{butforjustcheckinganiteratedpath
condition,i.e.thetransitiveclosureofarelation,therearepredenedandevenmoreecient
functionsavailablethatcanbesimplycalled.)Iteratedpatternsallowtomatchsubstructures
splittingintobreadth (e.gmultinodes).Bothcombinedallowtomatchentiretreelikestruc-
tures withinasinglerule e application. . Subpatterns s andnestedpatterns arematchedfrom
the outermost to the innermost patterns with recursive descent, handing alreadymatched
elementsdown;onascend,theycanyieldelementsfoundouttothedefelementsoftheir
containingpattern.Thenestedpatternsandsubpatternsalsosupportnestedrewriteparts,so
thatcomplexstructuresarenotonlymatched(parsing),butcanalsogetrewritten(transduc-
tion)|yieldingstructuredirectedtransformation,alongsidestructuresdenedbygraphlets
combinedinanEBNF-grammar-likeway[Jak11].
ThosefeaturesandtheiroptimizedimplementationcrownGrGen.NETthekingofgraph
pattern matching and rewriting, and allow you to process s graph h representations at their
naturallevelofabstraction,witha exibilityandperformancecomingneartowhatyoucan
achievebyprogrammingthingsbyhand.
Agraph rewritesystemdescribed inthoselanguages s canbeemployedviaan n API I by
.NET-applications,typicallywritteninC#(seeChapter24). Theotherwayroundyoucan
includeC#-codeintoyourspecicationsbyusingexternaltypesorcallingexternalfunctions
andprocedures,aswellassequences(seeChapter25).
2.3.3 RuleApplicationControlLanguage
On top of the rules s and d computations s language do you u nd the e sequences s language, , for
controllingtheapplicationoftherules(andproceduresorfunctions),determiningwhichrule
toapplywhere next.
This strategy language allows to determine the e rule e that t is s called d next by its control
operators andconstructs (see Chapter9). . The e basiconesavailablearethe sequential l and
logical operators,thedecisions,andtheloops(deningthecontrol- oworchestration). . The
locationwheretoapplyarulemaybedenedwithparametershandedintothecalledrules,
andreceivedback fromthem. . Thesequencessupport t variables s tostore e the locations (for
data- oworchestration). Arulemaybeappliedfortherstmatchfound,orforallmatches
thatareavailablewithall-bracketing.
Thesequences oer a computations s sublanguage e that supports calling procedures s and
functions, basic graph queryingandmodication, visited  ags management, and storages
manipulation(seeChapter17). Therstones s allowtobypasstherulesofthelayerbelow
forsimpletasks,andespeciallyallowtoextract,insertandcomparesubgraphs.Visited ags
usedinmarkingprocessedelementsmustbeallocatedandfreed,thesequencecomputations
Documents you may be interested
Documents you may be interested