2024-04-15 22:16:14 +03:00
|
|
|
# Generate lexers for RSlang
|
|
|
|
|
2024-05-05 15:11:10 +03:00
|
|
|
$bison = 'C:\ProgramData\chocolatey\bin\win_bison.exe'
|
2024-04-15 22:16:14 +03:00
|
|
|
$workDir = Resolve-Path -Path "${PSScriptRoot}\..\ccl\rslang\src"
|
|
|
|
$grammar = 'RSParserImpl.y'
|
|
|
|
|
|
|
|
function BuildParser {
|
|
|
|
if (-not (Test-Path -Path $bison)) {
|
|
|
|
Write-Error "Cannot find bison at ${bison}"
|
|
|
|
Exit 1
|
|
|
|
}
|
|
|
|
Set-Location -Path ${workDir}
|
|
|
|
Write-Host "Building ${grammar}"
|
2024-10-14 12:39:55 +03:00
|
|
|
& $bison $grammar -Wcounterexamples
|
2024-04-15 22:16:14 +03:00
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
|
|
Write-Error 'Grammar generation failed'
|
|
|
|
Exit 1
|
|
|
|
}
|
|
|
|
Exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
BuildParser
|