38. Ragelの書きかた # ---- Literal ---string = ("'" . (any - "'")* . "'") |('"' . (any - '"')* . '"'); integer = digit+; atom = (alpha (alpha | digit)* ); # ---- Operator ---operator = "+" | "-" | "*" | "/"; main := |* atom => { material := Ore{ Token: ATOM, Value: data[ts:te], } material.Research() ores = append(ores, material) }; String => { material := Ore{ Token: STRING, Value: data[ts:te], } mater
![Goで言語処理系(の途中まで)を作ろう](https://cdn-ak-scissors.b.st-hatena.com/image/square/ae80913028b6fb6bbe1a0c25c1f5f89a889ee0a0/height=288;version=1;width=512/https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Fgo-131014003606-phpapp01-thumbnail.jpg%3Fwidth%3D640%26height%3D640%26fit%3Dbounds)