# File scanGeneric.rb, line 15 def zerlege(input) ergarray=Array.new(0) # Zusammenstellen des regulären Ausdrucks aus dem Token-Array tempStr="\\A(" @@tokenArray.each do |regex| tempStr=tempStr+regex.source+"|" end tempStr=tempStr.chomp("|") tempStr=tempStr+("\)") tempRegexp=Regexp.new(tempStr) #print tempRegexp.source while (input.size > 0) do tokentemp="" c=(input.match(tempRegexp)) if (c[0]!=nil and input.index(c[0])==0) tokentemp=c[0] end if(tokentemp=="") return Array.new end ergarray << tokentemp input=input.sub(tokentemp, '') input=input.strip end return ergarray end