Sorry, I am a beginner in parsing, so my question may be obvious.
Is it possible to parse this output with antlr ?
I get this output from a VMWare tool so this maybe usefull for a lot of persons.
has someone written a grammar that could be used as an example to modify ?
I see that we have (type), array [] and object {}.
Guest information:
(vim.vm.GuestInfo) {
dynamicType = <unset>,
toolsStatus = "toolsOk",
toolsVersionStatus = "guestToolsCurrent",
toolsVersionStatus2 = "guestToolsCurrent",
toolsRunningStatus = "guestToolsRunning",
toolsVersion = "9349",
toolsUpdateStatus = (vim.vm.GuestInfo.ToolsUpdateStatus) null,
guestId = "windows7Server64Guest",
guestFamily = "windowsGuest",
guestFullName = "Microsoft Windows Server 2008 R2 (64-bit)",
hostName = "
gechem8dla-2-cl2.asg.com",
ipAddress = "10.33.6.110",
net = (vim.vm.GuestInfo.NicInfo) [
(vim.vm.GuestInfo.NicInfo) {
dynamicType = <unset>,
network = "10.33.6.xxx",
ipAddress = (string) [
"fe80::6405:beef:8dc0:2586",
"10.33.6.110"
],
macAddress = "00:0c:29:d6:a5:18",
connected = true,
deviceConfigId = 4000,
dnsConfig = (vim.net.DnsConfigInfo) {
dynamicType = <unset>,
dhcp = false,
hostName = "",
domainName = "
asg.com",
ipAddress = (string) [
"10.33.0.39",
"10.2.2.30"
],
},
ipConfig = (vim.net.IpConfigInfo) {
dynamicType = <unset>,
ipAddress = (vim.net.IpConfigInfo.IpAddress) [
(vim.net.IpConfigInfo.IpAddress) {
dynamicType = <unset>,
ipAddress = "fe80::6405:beef:8dc0:2586",
prefixLength = 64,
origin = "linklayer",
state = "unknown",
lifetime = <unset>,
},
(vim.net.IpConfigInfo.IpAddress) {
dynamicType = <unset>,
ipAddress = "10.33.6.110",
prefixLength = 23,
origin = "dhcp",
state = "preferred",
lifetime = <unset>,
}
],
dhcp = (vim.net.DhcpConfigInfo) {
dynamicType = <unset>,
ipv6 = (vim.net.DhcpConfigInfo.DhcpOptions) null,
ipv4 = (vim.net.DhcpConfigInfo.DhcpOptions) {
dynamicType = <unset>,
enable = true,
},
},
autoConfigurationEnabled = <unset>,
},
netBIOSConfig = (vim.net.NetBIOSConfigInfo) null,
}
],
ipStack = (vim.vm.GuestInfo.StackInfo) [
(vim.vm.GuestInfo.StackInfo) {
dynamicType = <unset>,
dnsConfig = (vim.net.DnsConfigInfo) {
dynamicType = <unset>,
dhcp = false,
hostName = "gechem8dla-2-cl2",
domainName = "
asg.com",
ipAddress = (string) [
"10.33.0.39",
"10.2.2.30"
],
},
ipRouteConfig = (vim.net.IpRouteConfigInfo) {
dynamicType = <unset>,
ipRoute = (vim.net.IpRouteConfigInfo.IpRoute) [
(vim.net.IpRouteConfigInfo.IpRoute) {
dynamicType = <unset>,
network = "0.0.0.0",
prefixLength = 0,
gateway = (vim.net.IpRouteConfigInfo.Gateway) {
dynamicType = <unset>,
ipAddress = "10.33.6.1",
device = "0",
},
},
(vim.net.IpRouteConfigInfo.IpRoute) {
dynamicType = <unset>,
network = "10.33.6.0",
prefixLength = 23,
gateway = (vim.net.IpRouteConfigInfo.Gateway) {
dynamicType = <unset>,
ipAddress = <unset>,
device = "0",
},
},
(vim.net.IpRouteConfigInfo.IpRoute) {
dynamicType = <unset>,
network = "10.33.6.110",
prefixLength = 32,
gateway = (vim.net.IpRouteConfigInfo.Gateway) {
dynamicType = <unset>,
ipAddress = <unset>,
device = "0",
},
},
(vim.net.IpRouteConfigInfo.IpRoute) {
dynamicType = <unset>,
network = "10.33.7.255",
prefixLength = 32,
gateway = (vim.net.IpRouteConfigInfo.Gateway) {
dynamicType = <unset>,
ipAddress = <unset>,
device = "0",
},
},
(vim.net.IpRouteConfigInfo.IpRoute) {
dynamicType = <unset>,
network = "224.0.0.0",
prefixLength = 4,
gateway = (vim.net.IpRouteConfigInfo.Gateway) {
dynamicType = <unset>,
ipAddress = <unset>,
device = "0",
},
},
(vim.net.IpRouteConfigInfo.IpRoute) {
dynamicType = <unset>,
network = "255.255.255.255",
prefixLength = 32,
gateway = (vim.net.IpRouteConfigInfo.Gateway) {
dynamicType = <unset>,
ipAddress = <unset>,
device = "0",
},
},
(vim.net.IpRouteConfigInfo.IpRoute) {
dynamicType = <unset>,
network = "fe80::",
prefixLength = 64,
gateway = (vim.net.IpRouteConfigInfo.Gateway) {
dynamicType = <unset>,
ipAddress = <unset>,
device = "0",
},
},
(vim.net.IpRouteConfigInfo.IpRoute) {
dynamicType = <unset>,
network = "fe80::6405:beef:8dc0:2586",
prefixLength = 128,
gateway = (vim.net.IpRouteConfigInfo.Gateway) {
dynamicType = <unset>,
ipAddress = <unset>,
device = "0",
},
},
(vim.net.IpRouteConfigInfo.IpRoute) {
dynamicType = <unset>,
network = "ff00::",
prefixLength = 8,
gateway = (vim.net.IpRouteConfigInfo.Gateway) {
dynamicType = <unset>,
ipAddress = <unset>,
device = "0",
},
}
],
},
dhcpConfig = (vim.net.DhcpConfigInfo) null,
}
],
disk = (vim.vm.GuestInfo.DiskInfo) [
(vim.vm.GuestInfo.DiskInfo) {
dynamicType = <unset>,
diskPath = "C:\",
capacity = 42841665536,
freeSpace =
12623646720,
}
],
screen = (vim.vm.GuestInfo.ScreenInfo) {
dynamicType = <unset>,
width = 800,
height = 600,
},
guestState = "running",
powerPolicy = (vim.vm.PowerPolicy) null,
appHeartbeatStatus = "appStatusGray",
appState = "none",
guestOperationsReady = true,
interactiveGuestOperationsReady = false,
}